Mikheil Kapanadze [http://community.jboss.org/people/mkapanadze] created the discussion
"Re: NullPointerException in JBossXSEntityResolver.getXMLInputSource still happening in 5.1.0" To view the discussion, visit: http://community.jboss.org/message/608002#608002 -------------------------------------------------------------- I had this error today, but on older JBoss (4.2.3). WSDL was a bit complex but not wrong (it was auto-generated from EJB, deployed on JBoss 5.1.0 - both wsimport and wsconsume were OK with it. I'll describe how I have fixed it for myself. Maybe it will be helpful for anyone. I had to create web service client and add to some application, deployed on 4.2.3. I've generated classes using wsimport and created the client. After that, I got the above mentioned error. As everyone knows, when you generate JAX-WS classes, wsimport uses absolute path of the filename in the ***Service.java. It looks like this: @WebServiceClient(name = "MyService", targetNamespace = " http://www.example.com/NS/my-NS http://www.example.com/NS/my-NS", wsdlLocation = "file:/D:/path/to/wsdl/Service.wsdl") and the same path exists after few lines, in static initialization block. When you deploy the application on the server, in most cases the pathname will be incorrect. To avoid this, I often place my .wsdl files in the package and create service class using MyService(URL wsdlLocation, QName serviceName) constructor but today it caused NPE for me. I have tried to make above mentioned static initialization block and @WebServiceClient annotation little bit usable. Here are steps: 1. Choose name of your package where wsimport will place generated classes. Say, com.mikheil.demo.ws.client 2. Put your WSDL in classpath, inside the SAME package. Let's suppose it's name is MyService.wsdl 3. When executing wsimport, pass *-wsdllocation MyService.wsdl* to it I use Maven and plugin parameter there is wsdlLocation So, here is how my service looks like: @WebServiceClient(name = "MyService", targetNamespace = " http://www.example.com/NS/my-NS http://www.example.com/NS/my-NS", wsdlLocation = "MyService.wsdl") public class MyService extends Service { private final static URL MYSERVICE_WSDL_LOCATION; private final static Logger logger = Logger.getLogger(com.mikheil.demo.ws.client.MyService.class.getName()); static { URL url = null; try { URL baseUrl; baseUrl = com.mikheil.demo.ws.client.MyService.class.getResource("."); url = new URL(baseUrl, "MyService.wsdl"); } catch (MalformedURLException e) { logger.warning("Failed to create URL for the wsdl Location: 'MyService.wsdl', retrying as a local file"); logger.warning(e.getMessage()); } URL MYSERVICE_WSDL_LOCATION; = url; } // Some constructors, etc } Obviously, now it's possible to create web service client using default constructor. ...And, NullPointerException disappeared too! -------------------------------------------------------------- Reply to this message by going to Community [http://community.jboss.org/message/608002#608002] Start a new discussion in JBoss Web Services at Community [http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]
_______________________________________________ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user