0

I have no experience with WebService, especially SOAP, but I have to deal with it. I work with Java 11 and with the latest Eclipse IDE. In the beginning I read a lot and also developed my own WebService. This service can only calculate the BMI. There are no errors in this service on the server side. I had the client automatically generated with the Java API for XML Webservices. However, several errors are displayed in the generated classes.

First Error: "The package javax.xml.namespace is accessible from more than one module: java.xml, jaxrpc"

If I try to fix the error, then there is a new error. Let's get back to trying to fix the bug. In some other forums I have read that in the module information "module-info.java" the "requires java.xml" should be commented out. The error seems to disappear for now, but it leads to two new errors:

"The type javax.xml.namespace.QName is not accessible" and "The type javax.xml.namespace.QName cannot be resolved. It is indirectly referenced from required .class files"

Here are a few code:

module Client {
exports ws;

requires axis;
requires java.instrument;
requires java.logging;
requires java.management;
requires java.naming;
requires java.net.http;
requires java.prefs;
requires java.rmi;
//requires java.xml;
requires jaxrpc;}

Here is a example of the DemolmplServiceLocater where java.xml.namepace are underlined red:

public DemolmplServiceLocator(java.lang.String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException {
    super(wsdlLoc, sName);
}

This is the class DemolmplService.java with the second error and "fixed" first error.

The lost one ist the Build Path from my project.

Among other things I opened a client in Java-SE1.8 project and tried out the client there. There no error was displayed and the method bmi(weight,height) was executed successfully. But I need the project at least in Java 10 or higher.

Can anyone offer me a solution, preferably a step-by-step guide?

I thank you in advance!

xjnasx
  • 1
  • 2
  • Please take all those pictures and add them in as code in the question. There is a code block you can select text with and it will format the selected text to have the code display. – user254694 Jan 15 '20 at 12:19
  • Thanks for the comment, the last two pictures are then well attached at the place and will not be removed. @user254694 – xjnasx Jan 15 '20 at 13:06
  • I think there may be multiple issues in this question, but it seems like most of it is probably answered here https://stackoverflow.com/questions/52719125/jdk-10-cannot-import-javax-xml-namespace-in-eclipse – user254694 Jan 16 '20 at 08:53
  • Does this answer your question? [JDK 10 cannot import javax.xml.namespace in Eclipse](https://stackoverflow.com/questions/52719125/jdk-10-cannot-import-javax-xml-namespace-in-eclipse) – user254694 Jan 16 '20 at 08:54

0 Answers0