I want to use CFCProxy to make calls into CF from a Java class. In the
examples I’ve seen I need import the CFCProxy class into my java class as
follows:
import coldfusion.cfc.CFCProxy;
First question… is CFCProxy implemented? If so, how do I tell my Java
compiler where it is?
To anyone looking to build a java class that uses the CFCProxy, here’s what
I figured out:
Add the lucee.jar to your classpath when compiling your class (for me
it’s C:/lucee/lib/lucee.jar)
In your yourclass.java, add:
import coldfusion.cfc.CFCProxy;
Create an instance of your CFC:
cfcConnector = new CFCProxy(cfcPath, true); //cfcPath needs to be absolute
Then to call the onMessage() method in your CFC:
Object args = { “my message” };
cfcConnector.invoke(“onMessage”, args); // call the method “onMessage”
defined in your CFCOn Thursday, September 22, 2016 at 4:49:56 PM UTC-6, JP wrote:
I want to use CFCProxy to make calls into CF from a Java class. In the
examples I’ve seen I need import the CFCProxy class into my java class as
follows:
import coldfusion.cfc.CFCProxy;
First question… is CFCProxy implemented? If so, how do I tell my Java
compiler where it is?
To anyone looking to build a java class that uses the CFCProxy, here’s
what I figured out:
Add the lucee.jar to your classpath when compiling your class (for me
it’s C:/lucee/lib/lucee.jar)
In your yourclass.java, add:
|
importcoldfusion.cfc.CFCProxy;
|
Create an instance of your CFC:
|
cfcConnector =newCFCProxy(cfcPath,true);//cfcPath needs to be absolute
|
Then to call the onMessage() method in your CFC:
|
Objectargs ={“my message”};
cfcConnector.invoke(“onMessage”,args);// call the method “onMessage”
defined in your CFC
|
On Thursday, September 22, 2016 at 4:49:56 PM UTC-6, JP wrote:
I want to use CFCProxy to make calls into CF from a Java class. In
the examples I've seen I need import the CFCProxy class into my
java class as follows:
|
importcoldfusion.cfc.CFCProxy;
|
First question... is CFCProxy implemented? If so, how do I tell my
Java compiler where it is?
–
Get 10% off of the regular price for this years CFCamp in Munich,
Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp.
189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp
I wrote that document originally years ago, back in the Railo days.
Micha added to it some recent, Lucee-5 stuff. The PageContext in the
example is not linked to the correct Application, so it does not give
you the correct session.
Lucee is made of two parts: Loader and Core. Loader provides an API,
while Core is “use-at-your-own-risk” private implementations. To run
the code examples, you need to have the Lucee Loader, which is exposed
via the Lucee.jar in your classpath.
In general we would love to see more Java users’ involvement and/or
contributions, so it’d be great if you can update whatever errors you
find in the Wiki.
I’m considering working on a Websocket implementation for Lucee,
possibly as an extension, but am still collecting information as to how
it would be best used. I also need to discuss this with Micha and
others before we implement anything.
On Thursday, September 22, 2016 at 4:49:56 PM UTC-6, JP wrote:
I want to use CFCProxy to make calls into CF from a Java class. In
the examples I've seen I need import the CFCProxy class into my
java class as follows:
|
importcoldfusion.cfc.CFCProxy;
|
First question... is CFCProxy implemented? If so, how do I tell my
Java compiler where it is?
–
Get 10% off of the regular price for this years CFCamp in Munich,
Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp.
189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp
@Igal, will that give me the current session, etc?
Btw, I would love to see some working code examples from that page you
referenced ( http://docs.lucee.org/guides/working-with-source/java-using-lucee-in-java.html).
I’ve played around with some of those code examples, and it was challenging
to find all the import classes that are needed. As someone who knows just
enough about Java to compile and build, and write some basic code, it’s not
clear which libraries are needed and it took me several hours just to get
my code to compile.On Thursday, September 22, 2016 at 4:49:56 PM UTC-6, JP wrote:
I want to use CFCProxy to make calls into CF from a Java class. In the
examples I’ve seen I need import the CFCProxy class into my java class as
follows:
import coldfusion.cfc.CFCProxy;
First question… is CFCProxy implemented? If so, how do I tell my Java
compiler where it is?
Sent by typing with my thumbs.> On 28 Sep 2016, at 22:47, Igal @ Lucee.org <@Igal> wrote:
John,
I wrote that document originally years ago, back in the Railo days. Micha added to it some recent, Lucee-5 stuff. The PageContext in the example is not linked to the correct Application, so it does not give you the correct session.
Lucee is made of two parts: Loader and Core. Loader provides an API, while Core is “use-at-your-own-risk” private implementations. To run the code examples, you need to have the Lucee Loader, which is exposed via the Lucee.jar in your classpath.
In general we would love to see more Java users’ involvement and/or contributions, so it’d be great if you can update whatever errors you find in the Wiki.
I’m considering working on a Websocket implementation for Lucee, possibly as an extension, but am still collecting information as to how it would be best used. I also need to discuss this with Micha and others before we implement anything.
On 9/28/2016 1:47 PM, JP wrote: @Igal, will that give me the current session, etc?
Btw, I would love to see some working code examples from that page you referenced (http://docs.lucee.org/guides/working-with-source/java-using-lucee-in-java.html). I’ve played around with some of those code examples, and it was challenging to find all the import classes that are needed. As someone who knows just enough about Java to compile and build, and write some basic code, it’s not clear which libraries are needed and it took me several hours just to get my code to compile.
On Thursday, September 22, 2016 at 4:49:56 PM UTC-6, JP wrote:
I want to use CFCProxy to make calls into CF from a Java class. In the examples I’ve seen I need import the CFCProxy class into my java class as follows:
import coldfusion.cfc.CFCProxy;
First question… is CFCProxy implemented? If so, how do I tell my Java compiler where it is?
–
Get 10% off of the regular price for this years CFCamp in Munich, Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp
–
Get 10% off of the regular price for this years CFCamp in Munich, Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp
I was hoping to use cfcproxy to call into my app from within a Java websocket wrapper. That reference page you wrote could be really cool if it included links to working sample code or some sort of SDK would be a great place to start. I don’t consider myself a Java developer, but I’m definitely interested in getting more fluent so that I could extend my Lucee apps.
Lucee really needs a websocket solution badly. I hope a solution can be built soon!