Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WAS 6.1 - EJB 3 and Web Service Annotations

524 views
Skip to first unread message

rja...@aol.com

unread,
Feb 19, 2008, 6:29:30 PM2/19/08
to
Folks, <br />
<br />
Does anyone know if WebSphere 6.1 with the EJB 3 and the Webservice packs will support EJB 3 beans annotated with JAX-WS?<br />
<br />
@HandlerChain( file="handler-chain.xml")<br />
@WebService(name = "Simple3EJB")<br />
@Stateless<br />
public class Simple3EJB implements Simple3EJBLocal, Simple3EJBRemote {<br />
<br />
@WebMethod<br />
@WebResult(name = "sum")<br />
public DataSum addInts(int x, int y) {<br />
int retVal = 0;<br />
retVal = x + y;<br />
DataSum dataSum = new DataSum(retVal);<br />
return dataSum;<br />
}<br />
<br />
}<br />
<br />
It not working right now in AST. It doesn't seem to understand the web service annotations. I have applied the service packs for EJB 3 and Web Services for WAS 6.1.<br />
<br />
Regards,<br />
<br />
Robert Jackson

Ben_

unread,
Feb 20, 2008, 5:14:20 AM2/20/08
to
Don't know for sure, but when I played with WSFeP with RAD, it required RAD
7.0.0.3 to have support for code completion and all stuff. Applying the
Feature Pack like you'd apply to WAS is not an option: you also need to
update the IDE for it to support the new way of coding.

HTH.

Paul Ilechko

unread,
Feb 20, 2008, 8:56:16 AM2/20/08
to
rja...@aol.com wrote:

> It not working right now in AST. It doesn't seem to understand the web service annotations. I have applied the service packs for EJB 3 and Web Services for WAS 6.1.<br />


I'm not sure that the two packs are currently compatible. You might want
to open a PMR and get a definitive answer on that from support.

Ben_

unread,
Feb 20, 2008, 9:28:51 AM2/20/08
to

Install guide covers the case where you want to apply EJB3 on top of WSFeP
and vice-versa.

Paul Ilechko

unread,
Feb 20, 2008, 10:08:39 AM2/20/08
to

OK, good. I know that the betas did not work together - I hoped that the
GA code would ...

Jacek Laskowski

unread,
Feb 20, 2008, 7:42:53 PM2/20/08
to
Hi,<br />
<br />
I asked the same quesiton on RADv7.5 forum and got a response that EJB3 exposed as web services are not supported. So, although you can install EJB3 and WS feature packs atop WAS 6.1 in a single profile and they will work fine (tested and verified by myself) no EJB3 with @WebService annotations will work. They will as pure EJBs, but not as web services. You can certainly develop your EJBs with these annotations, but the runtime environment (WAS 6.1 + feature packs) are not ready for it yet.<br />
<br />
Jacek<br />
<br />
---<br />
Jacek Laskowski<br />
<a href="http://www.JacekLaskowski.pl">http://www.JacekLaskowski.pl</a>

Randy Schnier

unread,
Feb 22, 2008, 2:28:20 PM2/22/08
to
The two feature packs each support their respective specifications (EJB 3.0 and JAX-WS), but are not tightly coupled to each other in a manner that would support EJB3 beans simultaneously acting as JAX-WS endpoints. On the feature packs you will need to write a simple "redirector" object to act as the JAX-WS endpoint, which has the same methods and signatures as your target EJB 3.0 bean. Each method in the redirector object invokes the corresponding method on the target EJB3 bean.

The web service feature pack provides an update for AST 6.1, which among other things provides support for the webservice annotations. To get this update, you can use the Eclipse updater function inside AST 6.1. You can use tools and wizards in the updated AST 6.1 to help create the redirector object I mentioned above. Basically you run the wsgen utility against your EJB3 impl class, annotated with @WebService as you've shown in your example...to generate a WSDL file and schema xsd file:

wsgen -cp . -wsdl com.xyz.Simple3EJB

Then you run the 'Generate Java Bean Skeleton' wizard against the wsdl file you just generated. The resulting Java skeleton object will have the same methods and signatures as your original EJB impl class, with empty implementations. To make this object a "redirector" to your EJB3 bean, you basically fill in the method implementations to invoke the same method on the target EJB3 bean. You can do the EJB imvocation either through the EJB remote interface (cross-server) or the EJB local interface (if your target EJB3 bean is located in the same server as where you have the redirector object).

rja...@aol.com

unread,
Feb 22, 2008, 5:48:24 PM2/22/08
to
Folks,<br />
<br />
Thanks to all of you for the information. I was able to verify all this information. I was also able to verify this information. <br />
<p />

Jacek Laskowski

unread,
Feb 27, 2008, 6:31:38 PM2/27/08
to
Hi Randy,<br />
<br />
I followed the steps until I hit the deployment problem.<br />
<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d WASWSDLGenera E WSWS7054E: The Web Services Description Language (WSDL) file could not be generated for the itso.bank.EchoServiceBeanPortImpl Web service implementation class because of the following error: java.lang.Exception: A WSDL Definition could not be generated for the implementation class: itso.bank.EchoServiceBeanPortImpl<br />
<strike>2/27/08 15:19:31:578 PST</strike> 0000006d WSModuleDescr E WSWS7027E: JAX-WS Service Descriptions could not be correctly built because of the following error: javax.xml.ws.WebServiceException: WSWS7054E: The Web Services Description Language (WSDL) file could not be generated for the itso.bank.EchoServiceBeanPortImpl Web service implementation class because of the following error: java.lang.Exception: A WSDL Definition could not be generated for the implementation class: itso.bank.EchoServiceBeanPortImpl<br />
at com.ibm.ws.websvcs.wsdl.WASWSDLGenerator.generateWsdl(WASWSDLGenerator.java:210)<br />
at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.generateWSDL(EndpointDescriptionImpl.java:1754)<br />
at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.&lt;init&gt;(EndpointDescriptionImpl.java:352)<br />
at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.setupServiceDescriptionImpl(ServiceDescriptionImpl.java:228)<br />
at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.&lt;init&gt;(ServiceDescriptionImpl.java:186)<br />
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescriptionFromDBCMap(DescriptionFactoryImpl.java:192)<br />
at org.apache.axis2.jaxws.description.DescriptionFactory.createServiceDescriptionFromDBCMap(DescriptionFactory.java:135)<br />
at com.ibm.ws.websvcs.desc.WSModuleDescriptorImpl.buildServices(WSModuleDescriptorImpl.java:328)<br />
at com.ibm.ws.websvcs.desc.WSModuleDescriptorImpl.getServices(WSModuleDescriptorImpl.java:268)<br />
at com.ibm.ws.webservices.admin.deploy.ServiceIndexDataBuilder.getWSData(ServiceIndexDataBuilder.java:50)<br />
at com.ibm.ws.webservices.admin.deploy.ServiceIndexServerTaskImpl.listWebServices(ServiceIndexServerTaskImpl.java:142)<br />
at com.ibm.ws.webservices.admin.deploy.ServiceIndexServerTaskImpl.listWebServices(ServiceIndexServerTaskImpl.java:107)<br />
at com.ibm.ws.webservices.admin.deploy.ServiceIndexServerTask.performTask(ServiceIndexServerTask.java:163)<br />
at com.ibm.ws.management.application.SchedulerImpl.run(SchedulerImpl.java:262)<br />
at java.lang.Thread.run(Thread.java:810)<br />
Caused by: java.lang.Exception: A WSDL Definition could not be generated for the implementation class: itso.bank.EchoServiceBeanPortImpl<br />
at com.ibm.ws.websvcs.wsdl.WASWSDLGenerator.generateWsdl(WASWSDLGenerator.java:183)<br />
... 14 more<br />
<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R Problem encountered during annotation processing; <br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R see stacktrace below for more information.<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R java.lang.ClassCastException: com.sun.tools.apt.mirror.declaration.ClassDeclarationImpl incompatible with com.sun.mirror.declaration.InterfaceDeclaration<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.getEndpointInterfaceDecl(WebServiceVisitor.java:429)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.isLegalImplementation(WebServiceVisitor.java:545)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.shouldProcessWebService(WebServiceVisitor.java:352)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.visitClassDeclaration(WebServiceVisitor.java:145)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.sun.tools.apt.mirror.declaration.ClassDeclarationImpl.accept(ClassDeclarationImpl.java:109)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.buildModel(WebServiceAP.java:347)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.process(WebServiceAP.java:232)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:78)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.sun.tools.apt.comp.Apt.main(Apt.java:472)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:486)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.sun.tools.apt.main.Main.compile(Main.java:1103)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.sun.tools.apt.main.Main.compile(Main.java:966)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.sun.tools.apt.Main.processing(Main.java:113)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.sun.tools.apt.Main.process(Main.java:103)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.sun.tools.apt.Main.process(Main.java:85)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.sun.tools.ws.wscompile.CompileTool.buildModel(CompileTool.java:605)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.sun.tools.ws.wscompile.CompileTool.run(CompileTool.java:538)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.sun.tools.ws.util.ToolBase.run(ToolBase.java:56)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.sun.tools.ws.util.WSToolsObjectFactoryImpl.wsgen(WSToolsObjectFactoryImpl.java:44)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.ibm.ws.websvcs.wsdl.WASWSDLGenerator.generateWsdl(WASWSDLGenerator.java:179)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.generateWSDL(EndpointDescriptionImpl.java:1754)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.&lt;init&gt;(EndpointDescriptionImpl.java:352)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.setupServiceDescriptionImpl(ServiceDescriptionImpl.java:228)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.&lt;init&gt;(ServiceDescriptionImpl.java:186)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescriptionFromDBCMap(DescriptionFactoryImpl.java:192)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at org.apache.axis2.jaxws.description.DescriptionFactory.createServiceDescriptionFromDBCMap(DescriptionFactory.java:135)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.ibm.ws.websvcs.desc.WSModuleDescriptorImpl.buildServices(WSModuleDescriptorImpl.java:328)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.ibm.ws.websvcs.desc.WSModuleDescriptorImpl.getServices(WSModuleDescriptorImpl.java:268)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.ibm.ws.webservices.admin.deploy.ServiceIndexDataBuilder.getWSData(ServiceIndexDataBuilder.java:50)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.ibm.ws.webservices.admin.deploy.ServiceIndexServerTaskImpl.listWebServices(ServiceIndexServerTaskImpl.java:142)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.ibm.ws.webservices.admin.deploy.ServiceIndexServerTaskImpl.listWebServices(ServiceIndexServerTaskImpl.java:107)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.ibm.ws.webservices.admin.deploy.ServiceIndexServerTask.performTask(ServiceIndexServerTask.java:163)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at com.ibm.ws.management.application.SchedulerImpl.run(SchedulerImpl.java:262)<br />
<strike>2/27/08 15:19:31:562 PST</strike> 0000006d SystemErr R at java.lang.Thread.run(Thread.java:810)<br />
<br />
I've created a web service client-only dynamic web project and am stuck with ejb-ref definition in web.xml file to the ejb the web service impl delegates calls to. I defined it as follows:<br />
<br />
&lt;ejb-ref&gt;<br />
&lt;description&gt;&lt;/description&gt;<br />
&lt;ejb-ref-name&gt;ejb/echo&lt;/ejb-ref-name&gt;<br />
&lt;ejb-ref-type&gt;Session&lt;/ejb-ref-type&gt;<br />
&lt;home&gt;&lt;/home&gt;<br />
&lt;remote&gt;itso.bank.EchoService&lt;/remote&gt;<br />
&lt;/ejb-ref&gt;<br />
<br />
The EchoService is in another ear. The web (web services client) project deploys and works fine until I execute the web service which in turn calls the ejb via ejb/echo reference. I'm getting an error message saying that ejb is not part of the ear so I should not expect it working.<br />
<br />
Caused by: com.ibm.ejs.container.EJBNotFoundException: EJB with interface itso.bank.EchoService not present in application WebServiceProjectEAR<br />
at com.ibm.ejs.container.HomeOfHomes.getHomeByInterface(HomeOfHomes.java:567)<br />
at com.ibm.ws.ejbcontainer.injection.factory.EJBLinkObjectFactory.getObjectInstance(EJBLinkObjectFactory.java:252)<br />
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:316)<br />
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:917)<br />
... 42 more<br />
<br />
So, I added the web (web service client) project as a part of the EAR with the ejb it delegates calls to. The above exception's thrown upon deployment. What am I doing wrong?<br />

Jacek Laskowski

unread,
Feb 27, 2008, 9:22:30 PM2/27/08
to
Hi,<br />
<br />
Just to let you know I got it working. Thanks Randy for the tip. Don't know if I'm now able to describe it clearly as the entire technique seems like a candidate for the gratest hack in 2008 ;-)<br />

Jacek Laskowski

unread,
Feb 29, 2008, 7:05:05 PM2/29/08
to
Hi,<br />
<br />
Please correct me if I'm wrong, but the wire/pass-through approach with POJO-based JAX-WS service implementation can't allow to bundle the web app with the web service in the EAR of the @WebService EJB 3.0 bean. Can anyone work it around and make such a configuration working? <br />

Randy Schnier

unread,
Mar 3, 2008, 11:55:37 PM3/3/08
to
I know of no reason this would not work -- the web service POJO is bundled in a WAR module; the EJB 3.0 bean is bundled in an ejb-jar module. I'm pretty sure at least one of the customers I'm working with is doing exactly that. What symptom are you experiencing?

rja...@aol.com

unread,
Mar 10, 2008, 12:22:30 PM3/10/08
to
Folks,<br />
<br />
I want to thank everyone again for contributing to this thread.<br />
<br />
I've tried the redirector strategy and I getting a weird error. I cannot find the error anywhere, and I wonder if it could be related to security or my install. <br />
<br />
1) Created a WAR with a JAX-WS 2.0 Annotated POJO. The POJO is a redirector for EJB methods.<br />
2) Put the War and my EJB into an EAR file. (Wonder web annotations might cause problems, but I think that are ignored).<br />
3) Packed it in a EAR file. EAR uses JavaEE5 application.xml file...<br />
<br />
It deploys fine but when I try to access the webservice, here is what I get:<br />
<br />
<ul class="jive-dash">
<li>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;</li>
<li>&lt;soapenv:Body&gt;</li>
<li>&lt;soapenv:Fault&gt;</li>
</ul>
&lt;faultcode&gt;soapenv:Client&lt;/faultcode&gt; <br />
&lt;faultstring&gt;java.lang.NoClassDefFoundError: com.ibm.ws.wssecurity.trust.server.sts.Util.STSPolicySetUtil (initialization failure)&lt;/faultstring&gt; <br />
&lt;detail /&gt; <br />
&lt;/soapenv:Fault&gt;<br />
&lt;/soapenv:Body&gt;<br />
&lt;/soapenv:Envelope&gt;<br />
<br />
Any Ideas...<br />
<br />

rja...@aol.com

unread,
Mar 11, 2008, 9:41:34 AM3/11/08
to
Folks,<br />
<br />
I wonder if I need to configure some type of Policies?<br />
<br />
Robert Jackson

sourabh...@tcs.com

unread,
Mar 12, 2008, 4:03:23 AM3/12/08
to
Dear Robert Jackson,<br />
<br />
We are also getting same error. Please do let me know, if you have got resolution to this problem. <br />

rja...@aol.com

unread,
Mar 12, 2008, 12:02:59 PM3/12/08
to
Folks,<br />
<br />
It's good to know that it's not just me. I've pretty much tried everything I can think of to get this to work.<br />
<br />
1) Just tried a simple POJO in a WAR.<br />
2) Compiling with Several jdk 1.5.1 java versions (IBM and Sun)<br />
3) Etc..<br />
<br />
An IBMer helping me out noticed that the FFDC file seems to list this as the primary problem.<br />
<br />
Caused by: java.lang.NullPointerException<br />
at javax.xml.bind.ContextFinder.handleClassCastException(ContextFinder.java:95)<br />
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:147)<br />
at javax.xml.bind.ContextFinder.find(ContextFinder.java:299)<br />
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)<br />
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)<br />
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:244)<br />
at com.ibm.ws.wssecurity.platform.websphere.trust.server.sts.STSConfigurationMapLoaderImpl.loadSTSConfigurationMap(STSConfigurationMapLoaderImpl.java:75)<br />
at com.ibm.ws.wssecurity.trust.server.sts.Util.STSConfigUtil.loadSTSConfigurationMap(STSConfigUtil.java:610)<br />
at com.ibm.ws.wssecurity.trust.server.sts.Util.STSConfigUtil.getSTSConfigurationMap(STSConfigUtil.java:679)<br />
at com.ibm.ws.wssecurity.trust.server.sts.Util.STSPolicySetUtil.configure(STSPolicySetUtil.java:147)<br />
at com.ibm.ws.wssecurity.trust.server.sts.Util.STSPolicySetUtil.initialize(STSPolicySetUtil.java:386)<br />
at com.ibm.ws.wssecurity.trust.server.sts.Util.STSPolicySetUtil.&lt;clinit&gt;(STSPolicySetUtil.java:60)<br />
at java.lang.J9VMInternals.initializeImpl(Native Method)<br />
at java.lang.J9VMInternals.initialize(J9VMInternals.java:194)<br />
<p />
I noticed some else had this problem with JAX-WS when there were multiple jars with JAX-WS apis in the classpath.<br />
<br />
Maybe there is a problem with the service packs. My next thing to try is to just install the Webservices service pack in a another WebSphere install.<br />
<br />
Regards,<br />
<br />
Robert Jackson

rja...@aol.com

unread,
Mar 12, 2008, 5:01:00 PM3/12/08
to
Folks,<br />
<br />
1) I've found out is that you need to have this jar in your classpath for the client:<br />
<br />
Appserver\runtimes\com.ibm.jaxws.thinclient_6.1.0.jar<br />
<br />
2) You also need to run the client using the IBM JDK. <br />
<br />
I'm still getting strange errrors though.<br />
<br />
Here's my current Application Server Setup.<br />
<br />
WebSphere Base 6.1.0.13<br />
EJB 3.0.6.0.13<br />
WS FEP 6.1.0.9<br />
<br />
From myceclipse I'm getting this error:<br />
<br />
Exception in thread "main" HTTP Status-Code 400: Bad Request<br />
at com.sun.xml.ws.transport.http.client.HttpClientTransport.checkResponseCode(Http ClientTransport.java:226)<br />
at com.sun.xml.ws.transport.http.client.HttpClientTransport.getHeaders(HttpClientT ransport.java:145)<br />
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPip e.java:116)<br />
at com.sun.xml.ws.protocol.soap.ClientMUPipe.process(ClientMUPipe.java:58)<br />
at com.sun.xml.ws.handler.HandlerPipe.process(HandlerPipe.java:107)<br />
at com.sun.xml.ws.handler.HandlerPipe.process(HandlerPipe.java:107)<br />
at com.sun.xml.ws.client.Stub.process(Stub.java:121)<br />
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:122)<br />
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:238)< br />
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:212)< br />
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:105)<br />
at $Proxy13.sayGreeting(Unknown Source)<br />
at com.ca.sample.HelloWorldClient.main(HelloWorldClient.java:12)<br />
<p />
From the command line I'm gettting this error:<br />
<br />
Exception in thread "main" java.lang.NoSuchMethodError: javax.xml.soap.MessageFactory.newInstance(Ljava/lang/String;)Ljavax/xml/soap/Me ssageFactory;<br />
at com.sun.xml.ws.api.SOAPVersion.<init>(SOAPVersion.java:141)<br />
at com.sun.xml.ws.api.SOAPVersion.<clinit>(SOAPVersion.java:68)<br />
at com.sun.xml.ws.api.BindingID.<clinit>(BindingID.java:300)<br />
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parseBinding(RuntimeWSDLParser.jav a:269)<br />
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parseWSDL(RuntimeWSDLParser.java:1 92)<br />
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parseWSDL(RuntimeWSDLParser.java:1 54)<br />
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:99)<b r />
at com.sun.xml.ws.wsdl.WSDLContext.<init>(WSDLContext.java:65)<br />
at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:207)<b r />
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:165)<br />
at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:49)<br />
at javax.xml.ws.Service.<init>(Service.java:57)<br />
at samples.example1.HelloWorldService.<init>(HelloWorldService.java:40)<br />
at com.ca.sample.HelloWorldClient.main(HelloWorldClient.java:10)

da...@illsley.org

unread,
Mar 12, 2008, 5:57:45 PM3/12/08
to
Robert,<br />
Which JDK are you using?<br />
David

Sourabh Sodani

unread,
Mar 13, 2008, 5:15:33 AM3/13/08
to
When I tried through client, I have got following error:<br />

Caused by: java.lang.NullPointerException<br />
at javax.xml.bind.ContextFinder.handleClassCastException(ContextFinder.java:95)<br />
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:213)<br />
at javax.xml.bind.ContextFinder.find(ContextFinder.java:368)<br />
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)<br />
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)<br />
at org.apache.axis2.jaxws.message.databinding.JAXBUtils$4.run(JAXBUtils.java:819)<br />
at org.apache.axis2.java.security.AccessController.doPrivileged(AccessController.java:130)<br />
at org.apache.axis2.jaxws.message.databinding.JAXBUtils.JAXBContext_newInstance(JAXBUtils.java:816)<br />
at org.apache.axis2.jaxws.message.databinding.JAXBUtils.createJAXBContextValue(JAXBUtils.java:313)<br />
at org.apache.axis2.jaxws.message.databinding.JAXBUtils.getJAXBContext(JAXBUtils.java:146)<br />
at org.apache.axis2.jaxws.message.databinding.JAXBBlockContext.getJAXBContext(JAXBBlockContext.java:111)<br />
at org.apache.axis2.jaxws.message.databinding.impl.JAXBBlockImpl._outputFromBO(JAXBBlockImpl.java:199)<br />
at org.apache.axis2.jaxws.message.impl.BlockImpl.outputTo(BlockImpl.java:331)<br />
at org.apache.axis2.jaxws.message.impl.BlockImpl.serialize(BlockImpl.java:255)<br />
at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerializeAndConsume(OMSourcedElementImpl.java:573)<br />
at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:802)<br />
at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:831)<br />
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:274)<br />
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:262)<br />
at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:831)<br />
at org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:456)<br />
at org.apache.axis2.transport.http.SOAPMessageFormatter.getBytes(SOAPMessageFormatter.java:94)<br />
at com.ibm.ws.websvcs.transport.http.SOAPOverHTTPSender.prepareHttpRequestHeaders(SOAPOverHTTPSender.java:1908)<br />
at com.ibm.ws.websvcs.transport.http.SOAPOverHTTPSender.sendSOAPRequest(SOAPOverHTTPSender.java:465)<br />
at com.ibm.ws.websvcs.transport.http.SOAPOverHTTPSender.send(SOAPOverHTTPSender.java:366)<br />
at com.ibm.ws.websvcs.transport.http.HTTPTransportSender.invoke(HTTPTransportSender.java:274)<br />
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:550)<br />
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:335)<br />
at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:299)<br />
at org.apache.axis2.jaxws.core.controller.AxisInvocationController.execute(AxisInvocationController.java:582)

christop...@mobi.ch

unread,
Mar 13, 2008, 8:58:10 AM3/13/08
to
@rjack: <u>Exception in thread "main" java.lang.NoSuchMethodError: javax.xml.soap.MessageFactory.newInstance(Ljava/lang/String;)Ljavax/xml/soap/Me ssageFactory;</u>: You probably use SAAJ 1.2 instead of 1.3. Please make sure that you have the WS FeaturePack activated in the profile of the used server.

rja...@aol.com

unread,
Mar 13, 2008, 10:41:31 AM3/13/08
to
Folks,<br />
<br />
<b>I'm using the JDK supplied with WebSphere...</b><br />
java version "1.5.0"<br />
Java(TM) 2 Runtime Environment, Standard Edition (build pwi32devifx-20071025 (SR6b))<br />
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Windows XP x86-32 j9vmwi3223-20071007 (JIT enabled)<br />
J9VM - 20071004_14218_lHdSMR<br />
JIT - 20070820_1846ifx1_r8<br />
GC - 200708_10)<br />
JCL - 20071025<br />
C:\IBM\WebSphere\AppServer\java\bin<br />
<br />
This JDK seems to have JAX-WS 2.0 built in. I'm also using it in my ant script for building the server side application.<br />
<br />
I'm using the client jar that comes with WebSphere for the client. This like the problem is happening on the client side.<br />
<br />
Robert Jackson

rja...@aol.com

unread,
Mar 13, 2008, 12:53:30 PM3/13/08
to
Folks,<br />
<br />
I got my simple example to work as a pojo in the Servlet containter. I installed just the Web Services pack on top of the base. <br />
<br />
I had also tried just creating a profile with Web Services only using an install with both packs. That didn’t work either.<br />
<br />
So it seems the Webservices and EJB 3.0 service packs are in conflict or I am installing them incorrectly.<br />
<br />
If anyone has sucessfully installed both packs and gotten web services to work, please share your procedure. Here's the procedure I followed.<br />
<br />
1) Use Factory Install Tool to creat install of:<br />
WAS 6.1.013 Base<br />
EJB 3.0 Service Pack<br />
Webservices Service Pack<br />
<br />
2) Installled everything<br />
3) Created New Web Services Profile-Appsrv02<br />
4) Augmented Appsrv02 with EJB 3.0 Pack<br />
<br />
Regards,<br />
<br />
Robert Jackson<br />
<br />
Regards,<br />
<br />
Robert Jackson

Sourabh Sodani

unread,
Mar 14, 2008, 5:39:43 AM3/14/08
to
Dear Robert,<br />
<br />
I tried to install everything from scratch, FYI.. it worked. Am not getting HandleCastException now. <br />
<br />
Please note that IF you are using web service and ejb fix packs, please make sure that they are of same version of the application server ie. 6.1.0.13.<br />
To check versions of different feature packs and the server, a command "versioninfo" could be used. Please run in "&lt;websphere folder&gt;/bin" folder<br />
<br />
Following are the recommended helps:<br />
1. http://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/topic/com.ibm.iea.wasfpws_v6/wasfpws/6.1/Overview/WASv61_WSFP_Overview.pdf?dmuid=20070621102004645575< br />
2. WAS 6.1 Feature Pack for Web Services\win\WEBSV\docs\GettingStarted_en.html (in your Feature Pack installation image)<br />
<br />
Thanks,<br />
Sourabh Sodani.

Randy Schnier

unread,
Mar 14, 2008, 9:37:20 AM3/14/08
to
To the best of my knowledge, the web services feature pack (with updates to bring it up to the 6.1.0.13 level) and EJB 3.0 feature pack (at the 6.1.0.13 level) are not in conflict. However, it is important to install them, and their updates, in a certain order. For example, the GA of the web services feature pack is at 6.1.0.9, while the GA of the EJB 3.0 feature pack is at 6.1.0.13. You need to apply updates to the web service feature pack to get it up to 6.1.0.13 before installing the EJB 3.0 feature pack.

Here's a procedure that's been verified to work:

- Install WAS 6.1 GA
- Install webservices feature pack GA
- Use update installer to install interim fix PK53084
- Use update installer to install WAS 6.1 fixpack 13 and webservices feature pack fixpack 13 *at the same time*
- Install EJB 3.0 feature pack GA

For reference, here are the various URLs to download from:

6.1.0.13 fixpack URL: http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg24017334
(contains WAS 6.1.0.13, *fixpak for webservice feature pack to bring it up to 6.1.0.13 level*, and webservice fp iFixes)


Feature pack for web services GA URL: http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg21264563

Feature pack for EJB 3.0 GA URL: http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg21287579

Ben_

unread,
Mar 14, 2008, 10:03:02 AM3/14/08
to
> To the best of my knowledge, the web services feature pack (with updates
> to bring it up to the 6.1.0.13 level) and EJB 3.0 feature pack (at the
> 6.1.0.13 level) are not in conflict.

I hope they're not because it's clearly documented in their install guide
how to install them concurrently and it would be non-sense to not be able to
develop an application using the two...

rja...@aol.com

unread,
Mar 14, 2008, 1:07:02 PM3/14/08
to
Folks,<br />
<br />
Thank you for the install information. I will try it.<br />
<br />
What about the Profiles? The create/augment order should not matter right.<br />
<br />
Robert

Ben_

unread,
Mar 17, 2008, 5:01:01 AM3/17/08
to
> The create/augment order should not matter right.

Doesn't matter. It's documented.

rja...@aol.com

unread,
Mar 17, 2008, 1:08:35 PM3/17/08
to
Folks,<br />
<br />
Following the instructions, I've gotten it to work. Thanks for everybody's help.<br />
<br />
I've noticed two things in the process:<br />
<br />
1) As a WeSphere Developer on the cutting edge, I've got to get used to reading release notes, install Guides, and Info Center install information.<br />
<br />
2) Seems like this a pretty complex install compared to the other App Servers that support JavaEE5. <br />
<br />
Again, I do appreciate the help of the IBM folks and others on the forum.<br />
<br />
Regards,<br />
<br />
Robert Jackson

Ben_

unread,
Mar 17, 2008, 1:29:24 PM3/17/08
to
> 1) As a WeSphere Developer on the cutting edge, I've got to get used to
> reading release notes, install Guides, and Info Center install
> information.

Yes, I know it's boring... But cutting edge or not, RTFM is often a time
saver.

> 2) Seems like this a pretty complex install compared to the other App
> Servers that support JavaEE5. <br />

Feature packs are *additions*. Even with that WAS 6.1 is not Java EE 5
certified.

rja...@aol.com

unread,
Mar 18, 2008, 7:00:02 PM3/18/08
to
Folks,<br />
<br />
I got the POJO WEb -&gt; EJB strategy to work on the simeple example. When I tried a more complex data class I got this error:<br />
<br />
com.ibm.ws.exception.RuntimeWarning: javax.xml.ws.WebServiceException: WSWS7054E: The Web Services Description Language (WSDL) file could not be generated for the egolf.ListScoringImpl Web service implementation class because of the following error: java.lang.Exception: A WSDL Definition could not be generated for the implementation class: egolf.ListScoringImpl<br />
<br />
I can take this same EAR and run it in Weblogic with no problem. "ListScoringImpl" is the POJO in the front end talkng to the EJB. The EAR installs fine, but I get the Error when I try to run it.<br />
<br />
1) Has anyone else encountered this problem? The FFDC incident files don't contain any more information.<br />
<br />
2) I should be able to create the using all standard Java tools right?<br />

<br />
<ul class="jive-dash">
<li>JDK 1.6 (1.5 target)</li>
<li>JAX-WS 2.0</li>
</ul>
<br />
3) Any ideas how to debug this? I wonder if it's related to Axis? Or if I can use Axis to debug it?<br />
<p />
Robert Jackson

rja...@aol.com

unread,
Mar 19, 2008, 6:05:55 PM3/19/08
to
Folks,<br />
<br />
I suspect my application might be having this problem because POJO in the web container that has the web service annotations used classes in the EJB container for parameters and return values. <br />
<br />
I'm going to try to open a trouble ticket with IBM.<br />

Randy Schnier

unread,
Mar 20, 2008, 4:57:10 PM3/20/08
to
What classes within the EJB container are you referring to? Classes within the EJB module of the EJB 3.0 bean that the webservice POJO is invoking?

If so, then you'll need to include those classes in the web module where the POJO resides.

rja...@aol.com

unread,
Mar 27, 2008, 4:27:09 PM3/27/08
to
<div class="jive-quote"><span class="jive-quote-header">Guest wrote:</span><br />
What classes within the EJB container are you referring to? Classes within the EJB module of the EJB 3.0 bean that the webservice POJO is invoking?<br/>
<br/>
If so, then you'll need to include those classes in the web module where the POJO resides.<br/>
<br/>
rja...@aol.com wrote:<br/>
<div class="jive-quote">Folks,<br/>
<br/>

I suspect my application might be having this problem because POJO in the web container that has the web service annotations used classes in the EJB container for parameters and return values. <br/>
<br/>
I'm going to try to open a trouble ticket with IBM.<br/>
<br/>
Regards,<br/>
<br/>
Robert Jackson</div></div>

Folks,<br />
<br />
Thanks to your help and other folks at IBM, I've come very close toa a solution. It turns out the Data classes were not the problem. I did not have my targets set correct for the EJB project and Web Services. Im building with 1.6jdk targeting 1.5 for WebSphere.<br />
<br />
1) For EJB I updated it as follows:<br />
<br />
&lt;javac srcdir="${src_directory}"<br />
destdir="${class_file_directory}"<br />
debug="on"<br />
deprecation="on"<br />
optimize="off"<br />
includes="**"<br />
source="${source}"<br />
target="${target}"&gt; <br />
&lt;classpath refid="project_classpath"/&gt;<br />
&lt;/javac&gt;<br />
<br />
source and target are set to 1.5 in the properties file.<br />
<br />
2) For Web Service Ant tasks, I'm using sun JAX-WS 2.0 stuff. The wsgen task doesn't allow you to specify a target, but apt task does.<br />
<br />
&lt;taskdef name="ws_apt" classname="com.sun.tools.ws.ant.Apt"&gt;<br />
&lt;classpath refid="jaxws.classpath"/&gt;<br />
&lt;/taskdef&gt;<br />
<br />
&lt;ws_apt destdir="${class_file_directory}"<br />
sourcedestdir="${web_service_gen_source}"<br />
sourcepath="${src_directory}" debug="true" target="${target}"&gt;<br />
&lt;!--&lt;classpath refid="project_classpath"/&gt;--&gt;<br />
&lt;classpath&gt;<br />
&lt;path path="${class_file_directory}"/&gt;<br />
&lt;path refid="project_classpath"/&gt;<br />
&lt;/classpath&gt;<br />
&lt;source dir="${src_directory}"&gt;<br />
&lt;include name="${web_service_files}.java"/&gt;<br />
&lt;/source&gt;<br />
<br />
&lt;/ws_apt&gt;<br />
<br />
Now, I'm able to run web services in the servlet container that access 3.0 EJBs in the EJB container. <b>I have one remaining issue.</b><br />
<br />
3) My issue is with this infocenter article: Link:<a class="jive-link-external" href="http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.ejbfep.multiplatform.doc/info/ae/ae/rejb_webservice.html">&lt;cl ick here&gt;</a><br />
<br />
This article talk about using a servlet to frontend a 3.0 EJB. I would rather use a plain POJO in the servlet container, but this does not work.<br />
<br />
Does anyone know how to implement the strategy discussed in this article? Any examples? <br />
<br />
Seems like it's problematic getting a servlet to be a web service. I'm not sure I understand what this meeans: <b>You can do this by simply declaring a link between the desired Endpoint name in the Web service deployment descriptor of the EJB module. During deployment and installation of the bean into the Application Server environment, the bean is linked to the specified Web service endpoint</b><br />

Randy Schnier

unread,
Mar 28, 2008, 1:19:59 PM3/28/08
to
The InfoCenter article should have said "a servlet *or a Java object* as the webservice impl."

The sentence "you can do this by simply declaring a link..." refers to the first paragraph of the article, prior to when the two feature-pack-specific paragraphs were inserted. The "this" being referred to is "...by enabling you to expose an EJB stateless session bean as a Web service."

I'm going to open a problem report on the infocenter to get that fixed. Sorry for any confusion.

Sourabh Sodani

unread,
Apr 7, 2008, 3:40:06 AM4/7/08
to
Folks,<br />
<br />
As I was not able to expose a session EJB3 bean as a web service, I used a simple java object defined as web service impl and which looks-up this Session EJB3 bean locally. It worked for me. <br />
<br />
Now my requirement is to propogate the transacion object from my simple java object web service imple to EJB3 bean. As this is a simple java object, I am not sure how to obtain a transaction object and begin a transaction. Had it been a servlet or ejb, i could have got the transaction object from either servlet context or ejb context. All help will be appreciated.<br />
<br />
Thanks in advance,<br />
Sourabh Sodani.

da...@illsley.org

unread,
Apr 7, 2008, 7:03:51 AM4/7/08
to
A POJO web services runs in the web container so you should be able get the ServletContext from the WebServiceContext. Though it's about a different JAX-WS impl, you can find details of the relevant (standard) property at [1]<br />
<br />
I hope that helps,<br />
David<br />
<br />
[1]https://jax-ws.dev.java.net/articles/MessageContext.html
0 new messages