This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Services and the fly likes exception when using -wsdl with wsgen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "exception when using -wsdl with wsgen" Watch "exception when using -wsdl with wsgen" New topic
Author

exception when using -wsdl with wsgen

Goran Markovic
Ranch Hand

Joined: Sep 26, 2008
Posts: 399
Hi. I haven't recently used external generation of .wsld and .xsd files from web service implementation class, but last time when I did, it was working just fine. However, now when I try I get the exception :

The only differences between last time generation and now is a new system installation. I believe that some libraries are not in the classpath, but try to put them as environment variables but, still nothing is changed... What did I wrong???
thanks
Goran Markovic
Ranch Hand

Joined: Sep 26, 2008
Posts: 399
Hi, the problem is resolved. Yesterday when I was setting "WSIT Installation Instructions", and the webservices-api.jar from wsit installation has been copied into JAVA_HOME/../lib/endorsed directory.
I have just erased it and it works fine. But what should I do if I need to generate those artifacts again, and in order to wsit works fine I need there webservices-api.jar?
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Have you tried to include the JAR on the classpath using the -cp option of wsgen?
Best wishes!
Goran Markovic
Ranch Hand

Joined: Sep 26, 2008
Posts: 399
Hi Ivan, of course I did. But just as I said until I erase the webservice-api.jar from the mentioned location, the exception above raised over, and over again. When I erase it's ok everything.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi again!
I think it is a bad idea to store libraries in the endorsed directory in the Java installation. This means that they are available to all Java applications that run on your system. This may cause conflicts if you include another JAR with the same classes etc on the classpath of an application.
A quote from this article: http://www.ibm.com/developerworks/library/j-classpath-windows/

JAR files in the jre\lib\endorsed directory are also added to the classpath of all applications run with that virtual machine. The difference is that these files are actually added to the bootclasspath rather than the usual classpath and can replace the standard classes shipped with the JDK. This approach is especially useful for upgrading the XML parser and fixing bugs in the VM.

Once again, though, while this approach seems convenient, it is also a long-term mistake for the same reason. If you need to replace JDK classes, use the -Xbootclasspath/p option at runtime to avoid accidentally loading the wrong version of a class.

What I meant was that you, instead of storing the library in the endorsed directory could include it using the -cp option of wsgen, if the library is needed to generate artifacts.
I have successfully used WSIT but never installed anything in the endorsed directory.
Best wishes!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: exception when using -wsdl with wsgen
 
Similar Threads
Error in invoking weservices deployed in jboss
Which hibernate property is causing the existing data to be deleted?
javax.xml.soap.SOAPException: Unable to internalize message
Running Ivan's SAAJExamples from the study guide
SOAPException : Urgent help needed.