Hi Kyle, Thanks for ur reply Actually i am running this application inside WSAD and trying to connect WAS 5.0.2 Server using Standard alone Program. iam not using any servlets. plz suggest me...
posted 15 years ago
The only way to create a Java application that uses WebSphere resources like Datasources appropriately is to create what's called an application client. An Application Client is a special project type (create it with new>project and select Application Client) that you add to an EAR file. When you create the Application Client project the classpath will be set appropriately with J2EE.jar and the others.
Finally, you run an application Client by creating an application client configuration using Run... and creating one in the application client runner configuration editor.
Trust me, this is the ONLY supported way to make this work. BTW, you should probably read in the infoCenter for WebSphere about "launchClient" as well, since you'll probably want to run this at the command line at some point.
A good idea for more information might be to read the EJB client chapter of my book, which covers all of this in detail.
Yeah For ApplicationClient Module also its giving same error
posted 15 years ago
Jeez. I just realized what's happening. Believe it or not, I wrote about this in my own book! In Chapter 30, I wrote the following:
"The problem, as described in the InfoCenter, is that WebSphere J2EE application clients cannot access DataSources deﬁned inside WebSphere �because the J2EE application client does not support Java 2 Connection Factories.� The upshot of this is that you have to deﬁne your own WAS4 DataSources within the application client itself. There is a tool (the application client resource conﬁguration tool or ACRT) that allows you to do this for WebSphere, but there is no way to do the same thing within WSAD.
This tool creates an XML ﬁle (called client-resource.xmi) that deﬁnes the data sources and other J2EE resources within the client container."
In my book I ended up giving an example of using the ACRT to create the client-resource.xmi file. That's probably your best bet.