facebook

(another) Error Generating Services

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #281102 Reply

    conorb
    Member

    Hi,

    I’m trying to create a Web Services client using the build in Xfire tools and am received the dubious “Error Generating Services” error.

    I can access the wsdl without problem running on my Tomcat 6.0 server and use the Web Services Explorer to test the services. I’d like to be able to create the client code for embedding into another project. I followed the steps for creating the Web Service Client from both the wsdl as a file and the wsdl on the URL. Both attempts fail the same way.

    Since they seem to be somewhat installation/version specific I’d thought it best to start a new thread for my particular issue.

    Here is the stack trace from the .log file:

    !ENTRY com.genuitec.eclipse.ws.xfire 4 0 2008-01-24 15:49:12.161
    !MESSAGE Error generating services
    !STACK 0
    java.lang.NullPointerException
    at org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.getExceptionClass(AbstractServiceGenerator.java:279)
    at org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.generateFaults(AbstractServiceGenerator.java:264)
    at org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.generateOperation(AbstractServiceGenerator.java:229)
    at org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.generate(AbstractServiceGenerator.java:110)
    at org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.generate(AbstractServiceGenerator.java:62)
    at org.codehaus.xfire.gen.jsr181.ServiceInterfaceGenerator.generate(ServiceInterfaceGenerator.java:48)
    at org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.generate(AbstractServiceGenerator.java:49)
    at org.codehaus.xfire.gen.Wsdl11Generator.generate(Wsdl11Generator.java:132)
    at com.genuitec.eclipse.ws.xfire.generator.WSGenJob.run(WSGenJob.java:92)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

    Here is my installation summary:

    *** Date:
    Thursday, January 24, 2008 3:53:25 PM PST

    ** System properties:
    OS=WindowsXP
    OS version=5.1
    Java version=1.5.0_08

    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    Version: 5.1.1 GA
    Build id: 20070302-5.1.1-GA

    *** Eclipse details:
    MyEclipse Enterprise Workbench

    Version: 5.1.1 GA
    Build id: 20070302-5.1.1-GA

    Eclipse Platform

    Version: 3.2.2.r322_v20070119-RQghndJN8IM0MsK
    Build id: M20070212-1330

    Eclipse Java Development Tools

    Version: 3.2.2.r322_v20070104-R4CR0Znkvtfjv9-
    Build id: M20070212-1330

    Eclipse Project SDK

    Version: 3.2.2.r322_v20070104-dCGKm0Ln38lm-8s
    Build id: M20070212-1330

    Eclipse RCP

    Version: 3.2.2.r322_v20070104-8pcviKVqd8J7C1U
    Build id: M20070212-1330

    Eclipse Graphical Editing Framework

    Version: 3.2.2.v20070208
    Build id: 20070208-1315

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\Program Files\MyEclipse 5.1.1 GA\eclipse\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    b70_70
    -clean
    -vm
    C:\Program Files\MyEclipse 5.1.1 GA\jre\bin\javaw.exe

    Any help please?

    Thanks,

    conorb

    #281149 Reply

    Loyal Water
    Member

    conorb,
    Can you try this out using MyEclipse 6.0.?. I would suggest you use the pulse launcher to launch MyEclipse. Let me know if the problem persists in the newer version as well.

    #281153 Reply

    conorb
    Member

    Nipun,

    I’ve installed MyEclipse 6.0.x on my linux machine and receive the same error when generating the Web client from the generated wsdl file.

    !ENTRY com.genuitec.eclipse.ws.xfire 4 0 2008-01-25 19:20:27.595
    !MESSAGE Error generating services
    !STACK 0
    java.lang.NullPointerException
    at org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.getExceptionClass(AbstractServiceGenerator.java:428)
    at org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.generateFaults(AbstractServiceGenerator.java:407)
    at org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.generateOperation(AbstractServiceGenerator.java:366)
    at org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.generate(AbstractServiceGenerator.java:123)
    at org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.generate(AbstractServiceGenerator.java:67)
    at org.codehaus.xfire.gen.jsr181.ServiceInterfaceGenerator.generate(ServiceInterfaceGenerator.java:49)
    at org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.generate(AbstractServiceGenerator.java:54)
    at org.codehaus.xfire.gen.Wsdl11Generator.generate(Wsdl11Generator.java:167)
    at com.genuitec.eclipse.ws.xfire.generator.WSGenJob.run(WSGenJob.java:245)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

    I had to add a couple of import statements to my wsdl file because myEclipse was complaining about namespace issues so my wsdl file did properly validate.

    Additionally I did the same exercise using the HelloWorld (default) example from the Web Client tutorial and it worked fine.

    So I don’t know if I have to change my wsdl file or how the wsdl file is generated. I moved to using the Xfire tools because they were included with MyEclipse and have previously used axis, but would like to figure out how to make this work within the ide.

    What’s the Pulse Launcher?

    Thanks,

    conorb

    #281306 Reply

    Riyad Kalla
    Member

    conorb,
    Can you share your WSDL with me so I can test this locally?

    #281319 Reply

    conorb
    Member

    @support-rkalla wrote:

    conorb,
    Can you share your WSDL with me so I can test this locally?

    wsdl sent via PM.

    Thanks for checking into this.

    I’d like to get this figured out.

    conorb

    #281340 Reply

    Riyad Kalla
    Member

    Conor,
    Thank you for the WSDL, I was able to reproduce the issue right away and file it. I requesting an evaluation ASAP, but the team is heads down on the MyEclipse Blue M1 release here very shortly. I’ll keep you posted.

    #281348 Reply

    conorb
    Member

    Thanks for checking into it. I’ve been able to correctly run the xfire WsGen command manually on my wsdl and create the server stubs. I then created a jar file and I’m now trying to wrap a client class around everything so I can “hit” my deployed web services.

    Any hints for creating the client? I can’t seem to get the right combination yet. This is getting really urgent for me.

    Thanks again,

    conorb

    #281351 Reply

    Riyad Kalla
    Member

    Conor, my only suggestion would be checking the XFire docs and attempting it manually for the client:
    http://xfire.codehaus.org/Client+and+Server+Stub+Generation+from+WSDL

    Sorry I don’t have anything more concrete right now.

    #281356 Reply

    conorb
    Member

    @support-rkalla wrote:

    Conor, my only suggestion would be checking the XFire docs and attempting it manually for the client:
    http://xfire.codehaus.org/Client+and+Server+Stub+Generation+from+WSDL

    Sorry I don’t have anything more concrete right now.

    I did that and so far I’ve got:

    //create a service

    Service serviceModel = new ObjectServiceFactory().create(AccountLibraryServicesPortType.class);

    log.info(“received service model”);

    //instantiate the factory

    XFire xfire = XFireFactory.newInstance().getXFire();

    log.info(“created xfire factory”);

    XFireProxyFactory factory = new XFireProxyFactory(xfire);

    String serviceUrl = “http://localhost:8080/app/services/MyService”;

    //create the client
    AccountLibraryServicesPortType client = null;

    client = (AccountLibraryServicesPortType) factory.create(serviceModel, serviceUrl);

    log.info(“created client service”);

    and this all works, when I try to invoke my service though I’m getting the following error:

    13:23:29,685 INFO Client:41 – received service model
    13:23:29,685 INFO Client:45 – created xfire factory
    13:23:29,732 INFO Client:55 – created client service
    org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Couldn’t instantiate class. javax.xml.bind.JAXBElement
    org.codehaus.xfire.fault.XFireFault: Couldn’t instantiate class. javax.xml.bind.JAXBElement
    at org.codehaus.xfire.aegis.type.basic.BeanType.readObject(BeanType.java:196)
    at org.codehaus.xfire.aegis.type.basic.BeanType.readObject(BeanType.java:159)
    at org.codehaus.xfire.aegis.AegisBindingProvider.readParameter(AegisBindingProvider.java:169)
    at org.codehaus.xfire.service.binding.AbstractBinding.read(AbstractBinding.java:206)
    at org.codehaus.xfire.service.binding.WrappedBinding.readMessage(WrappedBinding.java:51)
    at org.codehaus.xfire.soap.handler.SoapBodyHandler.invoke(SoapBodyHandler.java:42)
    at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
    at org.codehaus.xfire.client.Client.onReceive(Client.java:406)
    at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:139)
    at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
    at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
    at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
    at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:79)
    at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114)
    at org.codehaus.xfire.client.Client.invoke(Client.java:336)
    at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
    at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
    at $Proxy9.getMerchantParams(Unknown Source)

    I have the jaxb libraries (XFire 1.2 JAXB2 Libraries) in my project class path.

    Can anyone help with this?

    conorb

    #281382 Reply

    Riyad Kalla
    Member

    hmm… if you open the deployment dialog and select your project and hit “Browse” then drill down to the WEB-INF/lib directory, can you confirm that the JAXB libraries are getting deployed?

    namely these:

    Attachments:
    You must be logged in to view attached files.
    #281394 Reply

    conorb
    Member

    @support-rkalla wrote:

    hmm… if you open the deployment dialog and select your project and hit “Browse” then drill down to the WEB-INF/lib directory, can you confirm that the JAXB libraries are getting deployed?

    namely these:

    I found that there’s a “known issue” with xfire creating server stubs using WsGen in that it includes Jaxb generics everywhere when you may not really want/need them.

    http://dinolupo.spaces.live.com/blog/cns!1C808859B4434962!175.entry

    and

    https://wsit-docs.dev.java.net/releases/m5/DataBinding5.html

    I took their advice and hand edited my wsdl file to change minOccurs=”0″ to minOccurs=”1″ and to remove all of the nillable=”true” statements. I then created a binding file to prevent the property from getting generated and re-ran the xfire WsGen command to create new stubs.

    Once that worked (and didn’t include any Jaxb generics on my complex data types) I was able to create a new client class that successfully accessed my deployed services.

    Now that I’ve actually got something that works (besides the Web Services Explorer) I’ll go back with the original wsdl and generate everything again and see if thos jar files get properly deployed in the WEB-INF/lib directory.

    Additionally I could post a more complete description of hand rolling an xfire client if people are interested.

    conorb

    #281398 Reply

    Riyad Kalla
    Member

    Conor,
    Thank you for following up with your findings, I’m attaching them to the PR I filed for this issue so when the devs look into it, they have it as a guide of where to start looking.

Viewing 12 posts - 1 through 12 (of 12 total)
Reply To: (another) Error Generating Services

You must be logged in to post in the forum log in