Java SOAP WSDL service NoClassDefFoundError - java

I have been struggling with the creation of a SOAP web service and I simply can't get it working.
I have written my service, and then, from Eclipse, I created a Web service. And although the saving in the db worked just fine when I tested the service locally (created a simple main method), when I try testing it from the generated Web service I get NoClassDefFoundError.
If anyone has the time to take a look I would be gratefull.
https://dane289#bitbucket.org/dane289/soapservice_problems.git
Thank you in advance!

The problem was that eclipse was not adding the jars to the WAR file.
After adding them to the war via the eclipse menu Assembly something everything worked fine.

Related

404 (Not Found) for all Spring REST services in Angular web app

I am taking over an old colleague's code and he used JHipster to build a Maven-Spring-Angular project.
I am able to compile, package his code and I used a simple Chrome Web Server (plugin), point it at the project's "target" folder which contains all the web components (i.e. assets, bower_components, META-INF, WEB-INF, etc) and his code, a dashboard can run successfully on the Chrome Web Server.
Problem is, all API calls to the Java back-end are failing.
IMAGE: API calls 404 error
IMAGE: Sample endpoint, api/data
Am I missing any steps when trying to run the project locally on my PC?
Will update the answer in details soon but just want to share the solution.
Chrome Web Server is not a proper Servlet Container hence Spring wasn't able to start. Since Spring did not start, requests to the endpoints could not be handled.

Deploying axis2.war to container broke client calls to external axis2 webservices

I have several existing web-apps deployed as standalone war files in the app container (resin). Some use axis2 jar files and axis2-generated Stub files to make calls to external SOAP based web services. They were all working fine prior to this.
I recently deployed axis2.war to the same container in order to create web services (unrelated to the client code mentioned above).
As soon as I restart the app container, client calls to the external webservices seem to be "intercepted" by my newly deployed axis2.war.
Services appear temporarily in the "Available Services" page of the axis2 web-app, with what appears to be randomly generated name based on the original external webservice name.
These services disappear shortly after, but the result is that my client code fails with a 500 error, as the local Axis2.war doesnt know how to handle those requests.
I have been searching for 2 days and haven't found mention of anyone experiencing anything similar. I am not even sure how to explain what is going on, as my client code never references localhost to make those web service calls. I am assuming this has to do with some configuration in axis2.war?
If anyone has any idea or insight into what might be happening, I would really appreciate any information.
Thanks for your help

Logging to log4j log file from webservice server app using Axis2 and Netbeans 7

I'm new to webservice development. I'm using Netbeans 7.0 with the Axis2 plugin and Tomcat 7.
I have a server application that is just a bunch of web methods with no UI or anything, and I created it pretty much following the tutorial at http://netbeans.org/kb/69/websvc/gs-axis.html. I use the Axis2 plugin to deploy to Tomcat.
So when I created my server application, there is no main method or anything. Typically if I want to log to a log4j log file, I'd put something like this in my main method to define where the config file for log4j resides...
PropertyConfigurator.configure("./conf/log4j.properties");
I do this on the webservice client and it works just fine, but of course that has a main method. So where would I put it in a webservice server application that has no main method? I know it doesn't have to be in the main method, but it has to be in some block of code that I know will execute, and I can't really guarantee which of my web methods will be executed first, so I can't really just stick it in one of my web methods.
I did check out other posts on StackOverflow, but didn't really find any that describe what to do in this scenario.
Anyone know the right way to do this?
I would use a ContextListener:
http://www.java2s.com/Tutorial/Java/0400__Servlet/SetServletContextListenerinwebXML.htm

Eclipse WTP, Axis 2 Web Service Client

I'm trying to build a web service and a client for this service. I'm using Eclipse 3.5.1 with axis2-1.4.1. I'm facing a problem:
I created the web service via the web service wizard and the service shows up in the axis service list. If I porint to the wsdl - its generated.
Now when I'm trying to build the client, I choose the wsdl, the client project and take the next button, well at the client web service configuration everything is empty. There is nor service name, no port name. Am I facing a bug? Anyoneelse faced something like this?
Regards
Well, so let me sum up:
The eclipse wizard seems buggy yes. It didn't show anything after the first step. What I've done? I created my stubs from the command line and WSDL2Java. The produced code works.
This problem occus with axis2-1.5.1 too, so no difference here.
I faced the same issue.
You can use Eclipse Eclipse Java EE IDE for Web Developers.
Version: Helios Service Release 1
And Axis2-1.3. It creates the stub.
I'm using Juno and Axis2 1.6.2 and I'm getting the same problem - the WTP wizard just doesn't work for me.
I downloaded the Code Generator Wizard for Eclipse Plug-in and this produced the client code for me. Follow the link for more info on installation and use.

How to cache a WSDL with Java-WS

I've created an app that interacts with a SOAP service using java WS. I generate classes and manage the WSDL using the built in netbeans functions.
Every time I run the application, it has to download the WSDL and parse it again. The WSDL is frozen at each version so I don't think this is necessary. I've tried to reference it as a local file, but then my app complains it can't find the file when it's installed on another machine.
Does anyone know how I can stop Java WS needing to re-parse the WSDL, or at least cache it locally?
I've figured it out...
This page has the info
Developing client application with locally packaged WSDL

Categories

Resources