0

I am trying to create a shopping cart application in SWING, which uses SOAP webservice to get items from DB.

I have generated WebService client using WSDL URL in eclipse (CXF implementation) and exported as JAR to add it as dependency in my Swing application.

Following code snippet calls my SOAP web service in Swing application:

ItemWebServiceService itemWebServiceService = new ItemWebServiceService(ItemWebServiceService.WSDL_LOCATION,SERVICE_NAME);
IItemServiceSEI itemWebService = itemWebServiceService.getItemWebServicePort();
    try
    {
        ilv = new ItemListView(itemWebService.fetchItems(productID), this);
    } catch (ApplicationException_Exception e)
    {
        e.printStackTrace();
    }

above code works fine, when i run my application in Netbeans. But when i run my application from JAR file or as a web start, i am getting following error.

Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:85)
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:218)
at org.apache.cxf.jaxws.ServiceImpl.initialize(ServiceImpl.java:161)
at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:129)
at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:99)
at javax.xml.ws.Service.<init>(Unknown Source)
at com.boeing.petstore.web.ws.ItemWebServiceService.<init>(ItemWebServiceService.java:43)
at com.boeing.patterns.petstore.widgets.WorkView.productSeleced(WorkView.java:113)
at com.boeing.patterns.petstore.widgets.ProductListView$1.run(ProductListView.java:92)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

I verified my dist folder, all libraries are available in lib folder and all these jars in the classpath declaration of META-INF.MF file.

Dist Folder contains:

lib Folder

JNLP file

App Jar

Did anyone have idea about the above problem?

  • What is the value of ItemWebServiceService.WSDL_LOCATION? I would guess that it is referencing something invalid from the JAR file's perspective. Also, this will probably help: http://stackoverflow.com/a/4178783 – Patrick Jul 10 '14 at 14:08
  • http://stackoverflow.com/questions/9069138/apache-cxf-client-loads-fine-in-eclipse-but-standalone-jar-throws-nullpointerexc –  Jul 15 '14 at 11:00
  • Thanks patrick and Sebo for your comments. – Jagan Sankar Jul 16 '14 at 09:31
  • https://stackoverflow.com/a/19631555/390829 resolved this for me. – sjakubowski Aug 25 '17 at 13:46

1 Answers1

0

I too face the same problem kindly refer the below link this may help you

JAX-WS = When Apache CXF is installed it "steals" default JDK JAX-WS implementation, how to solve?

Community
  • 1
  • 1
Ganesh
  • 1