Skip to content
Advertisement

Soap Webservice Client for JAVAFX Application

I am trying to call the webservice for my application. If I call it in a sample project it is working perfectly fine. But when I merge it with My Java FX it is giving me so many errors. Web Service Client is auto generated using the Eclipse. I am trying to call the Methods only. Can Anyone help me?

JavaScript

Model:

JavaScript

Module info file

JavaScript

and IF I keep Jaxrpc in classpath instead of module path I get error like this Description
The type javax.xml.rpc.ServiceException cannot be resolved. It is indirectly referenced from required .class files

Advertisement

Answer

OK, this won’t really be an answer, more pointers to related issues and potential approaches to come up with solutions. But I’ll post it as an answer as it is likely better to do that than lots of comments.

Unfortunately, you have multiple errors and issues, so I’ll try to deal with some of them seperately.


According to:

The error:

JavaScript

can occur when --module-path is wrong and the module can’t be found. Probably, that is at least one of your issues. The linked answer is for Idea and I don’t use Eclipse, so I don’t know how to resolve the issue in Eclipse, but perhaps you could do some research to find out.


Regarding:

JavaScript

there is some info on what is going on here:

This fix appears tricky to me. Please review the linked questions and solutions. It looks like either you need to either

  1. Forego Java 9+ modularity OR
  2. Manage your dependencies to not include the violating transitive dependency OR
  3. Change to a library that doesn’t rely on the broken library (probably the preferred solution in this case).

The broken library causing this issue is likely the version of jaxrpc you are using. My guess is that some of the relevant XML libraries were only added to standard Java in Java 9, but the jaxrpc library you are using was developed prior to that. So, jaxrpc either includes the XML libraries in its classes or makes use of a transitive library that does the same. This causes a conflict because the XML libraries can only be included once in the project.


Further info on your issues is in this answer:

The info is so ugly . . . you could read the answer, it may either help or discourage you.


Some things you could do to help resolve the situation

What should be done about this is kind of tricky and will depend on your skill level and how or if you can solve it. I’ll offer up some advice on some things you could do, but there are other options. You know your application better than I so you may be able to come up with better solutions for your application.

I’d advise separating these things out, just as a way of troubleshooting, get a project which works with all of the JavaFX components and one which works with all of the SOAP components and make sure they build and do what you want. Then try to combine the two projects either by integrating them into one project or running them in separate VMs with communication between the two (e.g. via an added REST API, though that is a much more complicated solution, so think hard about that before attempting it).

Also, upgrade to the latest version of JavaFX. I don’t think it will fix your issue, but it can’t hurt and it is possible some refinements in recent JavaFX versions may have done some things which might help ease some of your issues (though not all of them, as some of your issues stem from jaxrpc usage in a modular project, which is unrelated to JavaFX).

Also, and probably more importantly, consider using a different SOAP client framework that interacts better with modular Java 9+ than the broken implementation that jaxrpc appears to have.

In terms of whether you should make your application modular or not (include a module-info or not), I don’t really know the best approach for you. Certainly, whichever way you choose you will run into issues. But, the issues and how to resolve them will be different depending on the chosen solution path (as I guess you have already discovered during the course of your investigation for the question).

If necessary, isolate the issues down to single separate issues. If you need help in resolving each separate issue post new questions that feature minimal reproducible example code to replicate the issue. Mind if you do so, that the code is absolutely minimal and also complete so that it replicates and asks about only one issue, not a combination of more than one and that the questions are appropriate tagged – e.g. if the question is about jaxrpc and modularity it should include jaxrpc and modular tags and no JavaFX code or tags (and vice versa) and certainly on pdf code or dependencies anywhere if that isn’t part of the problem.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement