Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] SWT client accessing EJBs


Hi Kili,

Thanks for the reply. I was wondering if someone has already gone through this ordeal since it seems like an SWT rich-client accessing EJBs on WAS is going to be very useful. That is of course, given efforts of SWT  to replace Swing in the rich-client UI world. You're right it is a bit off-topic a bit, so may be we should go off-line on this, if you can think of a good way to solve this problem.

>There's no concept of a 'stand-alone' client in j2ee, just `application
>clients'.

Yes, I am building that client container that the j2ee refers to but doesn't define.

> - write an InitialContextFactory that resolves JNDI lookups as
'java:comp/env/Foo' to
'cells/<cellname>/nodes/<nodename>/servers/<servername>/foo'

  - If you're using JAAS, you have to guess which Callbacks a CallbackHandler must
handle. WAS5 uses some special (undocumented) Callbacks. Have fun.


Ok, I did all of this correctly. I know that because my project (which is just a regular Java Project and not a "J2EE Application Client") runs fine when I click on the "Run" button in WSAD.

> - Include everything in .../Websfear/lib into your classpath. You don't need
everyhing, but I can't remember the 15 Jars required.


I think that's  EXACTLY what I am looking for. Do you have the list? Here's what I have so far:

java -classpath .\lib\swt.jar;.\lib\mail.jar;.\lib\websphere.jar;.\lib\ras.jar;.\lib\wsexception.jar;.\lib\utils.jar;.\lib\soap.jar;.\lib\j2ee.jar;.\lib\xmlParserAPIs.jar;.\lib\xercesImpl.jar;.\lib\querymd.jar;.\lib\ecutils.jar;.\lib\ejbcontainer.jar;.\lib\ejbportable.jar;.\lib\ivjejb35.jar;.\lib\pm.jar;.\lib\pmimpl.jar;.\lib\appprofile.jar;.\lib\rsadaptercci.jar;.\lib\rsadapterspi.jar;.\lib\rsaexternal.jar;.\lib\runtime.jar;.\lib\runtimefw.jar;.\lib\vaprt.jar;.\lib\iwsorb2.jar;.\lib\webcontainer.jar;.\lib\naming.jar;.\lib\idl.jar;.\lib\rt.jar;.\lib\dsbeans.jar;.\lib\proxy.jar;.\bin MyProgram

where rt.jar is the IBM 1.3.1 JRE jar that you mentioned to avoid com.ibm.CORBA.* failures, dsbeans.jar is utility jar for my classes, and proxy.jar has all the proxy code and stubs generated by WSAD.

So what am I missing?? I get the following error in the end..

javax.naming.ConfigurationException: Could not create an instance of the class null. .  Root excepti
on is java.lang.NullPointerException
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at com.ibm.websphere.naming.WsnInitialContextFactory.init_implClassCtor(WsnInitialContextFactory.java:123)
        at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(WsnInitialContextFactory.java:76)
        at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
        at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
        at javax.naming.InitialContext.init(Unknown Source)
        at javax.naming.InitialContext.<init>(Unknown Source)
        at com.lotus.documentmanagement.common.proxy.EJBServicesProxy.<init>(EJBServicesProxy.java:25)
        at com.lotus.documentmanagement.common.proxy.Proxy.createEJBServicesProxy(Proxy.java:16)
        at DocumentViewer.<init>(DocumentViewer.java:39)
        at DocumentViewer.main(DocumentViewer.java:146)

Still struggling,
Alex


Hi!

On Tue, Dec 03, 2002 at 03:44:38PM -0500, Alexander Kordun/CAM/Lotus wrote:
> I am writing a stand-alone SWT client that directly access EJBs deployed
> in a WAS5 server.

That's a little bit offtopic, since it's a typical problem of
misunderstanding j2ee specification and has nothing to do with SWT.
And WAS5 is very picky on this.

> Everything seems to work fine, if I run it from
> Websphere Application Developer, but fails when I try to run it from the
> command line.

If you look at the section "Application Clients" in the j2ee specs,
you will notice that *everything* runs within a container, even a client.

There's no concept of a 'stand-alone' client in j2ee, just `application
clients'. How to run a client isn't specified in j2ee specs. However,
WAS5 (as well as Sun's j2ee reference implementation) require the client
to be packaged into an .ear file that (and that's really braindamaged)
contains all EJBs the client uses.

Apparantly, WAD takes care of setting up a container for running a client.
However there's no (at least no documented) way to do the same outside
of WAD.

> I suspect that I am not including the appropriate jars. Has
> anyone done a client similar to the one I am working on? If so, I would
> really appreciate some help on the correct websphere ejb build jars.

Oh, it's really simple :-). First of all, you have to

- write an InitialContextFactory that resolves JNDI lookups as
'java:comp/env/Foo' to
'cells/<cellname>/nodes/<nodename>/servers/<servername>/foo'


- If you're using JAAS, you have to guess which Callbacks a CallbackHandler must
handle. WAS5 uses some special (undocumented) Callbacks. Have fun.


- Include everything in .../Websfear/lib into your classpath. You don't need
everyhing, but I can't remember the 15 Jars required.


- Use IBM's 1.3 JDK. Other JDKs fail on generating the RMI-IIOP stubs (since
com.ibm.CORBA.* classes are involved)


- Cross fingers.

HTH,
Kili

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx

http://dev.eclipse.org/mailman/listinfo/platform-swt-dev


Back to the top