I am trying to add Axis2 parsing/handling to my existing web application. This compiles into a WAR file, however, my understanding (hopefully incorrect) of the Axis2 process is that to run it inside of a Tomcat server you need to install the Axis2.war servlet, and then compile the Axis2 application into an .aar file and place it in the $CATALINA_HOME/axis2/services subdirectory.
I need this to work compiled into a war file and put in a normal location.
From my understanding, to use Axis2 you need the servlet container to have a transport listener, which is the Axis2.war servlet. This will then delegate to the relevant installed .aar file. I have read a lot of the documentation and can't see how to make Axis2 more transparent.
Has anyone got any knowledge of this?
You can add the axis2 as a servlet of your current application .
All you have to do is add to your web.xml something like this:
<servlet>
<servlet-name>AxisServlet</servlet-name>
<display-name>Apache-Axis Servlet</display-name>
<servlet-class>
org.apache.axis2.transport.http.AxisServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
And a mapping:
<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
Here is a guide for the configuration.
Related
I am using Weblogic 12.2.1 and I added a JAX-WS client. It runs perfectly when run in eclipse but if I try to deploy the war file through the admin console I get:
The url-pattern RegistrationService_V10 in web application webApp.war is mapped to multiple Servlets. The only place I could find a reference to that is the the com.oracle.webservices.wls.wls-soap-stack-impl package in a class called RegistrationServiceV10 which is annotaited as a webservice to RegistrationService_V10 but that is the only place I could find a reference to it, not mapped in my web.xml so where is the multiple servlet mapping coming from.
I know this question was asked some time ago, but I had the same problem, and reading the question lead me to the answer, so here's what worked for me:
I had the same problem, did I text search on every single file in the repository for the text 'RegistrationService_V10' (and 'RegistrationService_V11', as I got that as an issue too), but it wasn't present.
The problem was the presence of multiple weblogic jar files. I was using maven to copy my dependencies into the weblogic domain lib folder, but because the code was depending on weblogic it was also copying a whole host of weblogic jar files as well. This resulted in multiple copies of the same files in my weblogic application classpath (the server's own weblogic files and my imported files). Thus there was an issue with code trying to register the same service with the same name more than once.
The solution is to make sure there is only one copy of the weblogic jar files available to weblogic (which is a part of weblogic; you shouldn't be copying any in).
Hope this helps you or somebody else with the same problem.
I've been facing similar issue when uploading my war files to WebLogic server.
After scouring the internet for answers, I've stumbled this question mapped to multiple servlet which led me to OpenAM weblogic bugtracker
Workaround is to disable annotation processing by either:
starting WebLogic with -Dweblogic.servlet.DIDisabled=true parameter
or
setting metadata-complete attribute to true in web.xml
<web-app metadata-complete="true" id="WebApp_ID" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
By putting metadata-complete on my web.xml, fixes the problem for me.
I creating some application, using glassfish v4 web container.
I want to know "how to get properties of domain.xml({GLASSFISH_HOME}/glassfish/domains/{APPLICATION_NAME}/config/domain.xml) in java source using glassfish package"
Actually I need a glassfish application root context path
When I deploy my apache cxf web service using eclipse I have to include the apache cxf library in the Web Deployment Assembly in order for it to work when I deploy it on my production apache web server. This is a problem because it makes the war file very large because the cxf library is included. If I exclude the library the war file is much smaller but the web service does not work when it is deployed on the live server even though the apache cxf library is on the live server.
My assumption is I need some kind of classpath reference so the live server can see the apache cxf installation but I am not familiar with how to do this as I am new to apache.
Thanks, Jesse
Put the cxf jars on folder tomcat/lib.
Ok, this workaround worked for me:
We can set the CXF lib path on the common.loader variable which is in $CATALINA_HOME/conf/catalina.properties file. You can add (after the comma) something like this:
common.loader=....,/path/to/cxf/home/lib/*.jar
I couldn't find a way to set an enviroment variable on tomcat in order to have something like: ${cxf.home}/lib/*.jar. I tried to put -Dcxf.home=$CXF_HOME in several places in catalina.sh but it never picked it up :( - hope someone can help on this later.
Restart tomcat and it will take cxf jars
In JBoss 4.2.3 we could configure items in
[jboss_server]/deploy/jboss-web.deployer/conf/web.xml
which would be adopted by all applications deployed. We've used this to configure context params, servlets, and default tag files.
We have dozens of apps deployed in war files, and this a very handy tool.
How is this accomplished in JBoss 7.1.1? I've googled and searched but can't seem to find the solution.
You could try web fragments (part of Servlet API 3.x). You'll be able to apply the same set of filters, mappings, listeners, variables to each web app's context using one META-INF/web-fragment.xml file (inside some WEB-INF/lib/my-common-context.jar, so it'd be easily managed as a simple dependency).
I'm very new to web applications. I've been told that JBOSS 7.1.1 has an in-built JAAS system which can be enabled on my JBOSS configuration quite simply. However I'm having trouble trying to get this running, namely most internet searching I went through has just ended up with older versions of JBoss.
Does anyone have a step-by-step guide on how to implement a simple JAAS authentication screen on my WAR file in JBoss 7.1.1? Prefarbly using its h2 database. Thanks :)
Also - my machine has trouble with Eclipse, so I can't use any of Eclipse EE's nifty server running mechanisms.
Finally got it. For those of you in the future:
You need your own standard login/logout pages in jsp/html/whatever. You put that in your web.xml constraints. Then you add an xml file called "Jboss-web" and type in your security domain (the default AS 7 is called 'other'). Then lastly add users and roles using adduser.bat in config folder.