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?