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

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

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 an Angular app to a Weblogic server

I'm trying to figure out how to deploy an Angular.js app to a Weblogic server and am getting stuck. The goal is to have a Java Servlet running a REST API to communicate with the weblogic server while the Angular app serves up the front-end.
Typically, I used a gulpfile to build my Angular application and bower to manage the dependencies. I can't figure out how to fit the Java Servlet into the build though, and what to do about deploying the app to the weblogic server.
I read that grunt and bower can be used to generate Maven files which would then be installed as artifacts on the local repository, but it isn't making much sense to me. Has anyone done something similar to this before and have advice?
Oops. all right!?
I'm currently having to develop applications in AngularJS to be used in an application server. Specific tasks that the Gulp can provide, I will be flawed if i try to say something as use Grunt (grunt-contrib-war), but on the issues architecture're, i created e install 2 aplications to the weblogic, usually with CrossOrigin defined between them. therefore its development is separated, Service layers and consumption layer.
In a larger scope could consider using:
Service-web
Service-oauth
Service-rs
ApplicationA
ApplicationB
P.S .: Searching in npm to found: https://www.npmjs.com/package/gulp-war

Is it possible to create JAX-WS Service in JAR and not in WAR?

I'm new to Java so I may be misunderstanding some of nouns - I hope I'll get it right.
We are creating an extension to a third party software which loads our JAR dynamically. As part of the implementation, the extension should have a service endpoint (I think servlet is right noun) waiting for requests from my company's backend servers.
The entire solution should run on Websphere (probably 7.0).
I'm looking for a way to open a service endpoint without creating a WAR file. The reason I don't want the WAR is because our JAR is loaded dynamically and I'm not convinced that the third party system will be able to load the WAR.
In addition, I afraid that by creating a WAR I'll basically create a new application which will not have access to the objects allocated in the host process of our extension.
Is that doable?
Thanks,
Nadav
Yes you can, just use Enpoint.publish() method comes with JDK itself.
Please look at the link
Publishing a WS with Jax-WS Endpoint

RESTEasy client works stand-alone but fails within Tomcat

I have with me the client interface for a web service that was built using JBoss/RESTeasy. The web service calls work fine when they are invoked from a stand-alone app, but as soon as I put them into a webapp running in a Tomcat container (on the same machine), they start behaving weirdly. Some of the calls return empty results while some others simply fail with this exception:
org.jboss.resteasy.client.ClientResponseFailure: Error status 404 Not Found returned
Any idea of what might be going on? Could this be a result of a library conflict? All the required client libraries are in the WEB-INF/lib directory of the webapp.
Seems that your services are not deployed properly. Take a look at your catalina.out or some other logs for more details.

Test large number of webservices on a single computer

We have a large system of physical devices which all run a web service for control and a central control system for controlling these devices. I need to make a substitute for such a physical device in order to test the controlling unit. How will I go about running more than one instance of a test device on a single computer. The protocol used in SOAP with a wsdl written in stone. In addition to the webservice each test device needs a webserver to monitor state and generating events.
My first approach is to embed jetty and use axis2 for webservices, but I am having some trouble making that fly. I managed to get the axis2 SimpleHttpServer working with a webservice, but as far as I can tell SimpleHttpServer will not let me run Servlets or let alone wars. Is there a better approach I am missing?
I considered making a proxy server listening on any number of ports and forwarding the request to a webservice to a central webservice with an additional paramater saying which port the request originated from, but since the wsdl is writting in stone I can not pass this paramater along.
EDIT: I am using Netbeans to generate a webservice for me. Works as a charm but not enough for my project. For some reason wsimport chokes on the wsdl. I don't understand how Netbeans can deploy to the bundled Glassfish server, but if I drop the generated dist/my-project.war into tomcat the webservice doesn't work. Much less show up in web.xml. What am I missing?
Be aware that if you route your network requests through a SOCKS proxy, you can essentially redirect even hardcoded names and ports in the SOCKS proxy to whatever you need.
Axis2 is not meant to be used as a servlet container, so using SimpleHttpServer doesn't help you there.
But Jetty is a full featured Servlet container. If you want to make it work, you have to run your Wars with Jetty. (Or any other servlet container, but Jetty is perfectly fine)
I'm not Jetty expert, but this should work:
Server server = new Server(8080);
Context root = new Context(server, "/", Context.SESSIONS);
root.addServlet(new ServletHolder( yourServletInstance ), "/*");
server.start();
(Taken from Jetty Wiki)
Ok I've figured out a solution. I can use Glassfish. Then I deploy the same webapp multiple times under different names. Then I have a small proxy made in glassfish which listens on a number of ports and then translates the request to one of the instances running i glassfish.

Categories

Resources