ejb@glassfish.java.net

Re: Eclipse RCP client for Glassfish v2.1 using EJB3

From: Andreas Kozma <andreas.kozma_at_ansis.com>
Date: Thu, 7 May 2009 10:31:27 +0200

Thanks a lot for your quick answer, Kenneth. We managed to connect to
GF as described in the #nonJavaEEwebcontainerRemoteEJB section of the
EJB FAQ;


1.)
- running a simple unit test (with a normal java classpath) worked
like a charm

- running an Eclipse RCP test app with one plugin worked as well. as
each plugin has its own class loader, all classes in all four required
GF jars (appserv-deployment-client.jar, appserv-ext.jar, appserv-
rt.jar, javaee.jar) are visible in the plugin itself.


- running with two plugins (where one plugin contains the four GF jars
and the jar with the required EJB3 remote interfaces and entity beans,
the other contains the actual functionality) doesn't work. Probably we
export the wrong packages from the first Jar to the consuming plugin.

Question: what packages from the four Jars need to be exported from
the plugin containing the jars, so that the consuming plugin can run
the lookup properly to access the EJBs? If you could give us a hint,
it would save us many hours of trial-and-error. Good practise suggests
only to export the required packages (ie. package from which classes
need to be loaded by consuming plugin), rather than exporting hundreds
of packages.


2.)
In JBoss we needed to supply a jndi.properties file in the EAR or the
EJB3 project. Is this required in GF? If yes, what is the format? We
used

java
.naming
.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory
java.naming.factory.url.pkgs=com.sun.enterprise.naming
java.naming.provider.url=iiop://localhost:3700

but I'm not sure it was required.


3.)
Another question where we didn't find any hints on the web: how can
you configure an fresh GF instance in batch mode? We have various GF
instances running on developer machines, test servers, client
deployments, etc and we would like to find a way to just run a script
or modify a few xml files (like in JBoss). Everybody refers us to the
Admin console, but that is not automatable.



PS: Once all this works, we would be happy to contribute our
experiences into an updated FAQ to save everybody trying to run RCP
clients with GF a lot of time.




Thanks in advance and kind regards,

- Andreas Kozma
www.ansis.com



On May 6, 2009, at 9:10 , Kenneth Saks wrote:

>
> On May 6, 2009, at 2:18 PM, Andreas Kozma wrote:
>
>> Hi Glassfish users!
>>
>> We are developing a 300k line EJB3 application using JBoss AS and
>> the Eclipse RCP platform for our Rich client.
>>
>> We would like to move our application server to Glassfish, but we
>> have difficulty getting our rich client to connect to the AS by
>> following the instructions on the glassfish: EJB FAQ.
>>
>> We have the following problems/questions:
>>
>> - is anybody of you using Eclipse RCP to develop your rich client?
>> if yes, which JARs do put into the plugin containing the server
>> classes? which packages do export? We were getting all sorts of
>> strange class cast and verify errors when trying to set the
>> standalone client mode.
>>
>> - as our RCP client needs to run on an unforeseen number of client
>> machines, we need to be able to set the host name in the login
>> panel. How do we pass it to the InitialContext?
>
> Hi Andreas,
>
> The easiest approach is to set the the host as -
> Dorg.omg.CORBA.ORBInitialHost=<server> when starting the stand-
> alone client JVM. If you can't do that for whatever reason, then
> follow the instructions in https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
> #nonJavaEEwebcontainerRemoteEJB.
>
>
>> We tried [ env.setProperty(Context.PROVIDER_URL, "iiop://localhost:
>> 3700"); ]
>
> You shouldn't use this property with Glassfish's naming provider.
>
>>
>> - is there a way to run an Eclipse or NetBeans RCP app as an
>> Application Client Component that can directly inject EJB3 resources?
>
> There's a separate appclient command for running application client
> components in GlassFish. I don't know if the IDEs integrate with
> that.
>
>>
>>
>>
>> Thank you very much for your help!
>>
>>
>> Kind regards,
>>
>> - Andreas Kozma
>> www.ansis.com
>>
>> <ansis_logo.gif>
>>
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.