Mule ESB application deployed on JBoss: mapped-name is required for org.apache.cxf.binding.BindingFactoryManagerImpl - jboss5.x

I'm trying to deploy Mule ESB application on JBoss (5.1.0.GA), as .war file.
When I start JBoss, I'm getting followiong error:
13:37:06,952 ERROR [StandardContext] Context [/OMS] startup failed due to previous errors
java.lang.RuntimeException: mapped-name is required for org.apache.cxf.binding.BindingFactoryManagerImpl/bus of deployment OMS.war
at org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXmlResourceEnvRefs (WebResourceHandler.java:287)
at org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXml(WebResourceHandler.java:325)
at org.jboss.web.tomcat.service.TomcatInjectionContainer.processMetadata(TomcatInjectionContainer.java:550)
Here is jboss-classloading.xml
<classloading xmlns="urn:jboss:classloading:1.0"
name="OMS.war"
domain="OMS"
export-all="NON_EMPTY"
import-all="false">
</classloading>
jboss-web.xml
<jboss-web>
<class-loading>
<loader-repository>
<loader-repository-config>
java2ParentDelegation=false
</loader-repository-config>
</loader-repository>
</class-loading>
</jboss-web>
And web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
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_2_5.xsd">
<context-param>
<param-name>org.mule.config</param-name>
<param-value>_includes.xml,_subflows.xml,monitor_flow.xml,claim_flow.xml,orders_flows.xml,parcel_flow.xml,create_claim_flow.xml,request_flows.xml,retry_flow.xml,inbound_parcel_flow.xml,server_status_flow.xml,insurance_policy_flow.xml</param-value>
</context-param>
<listener>
<listener-class>org.mule.config.builders.MuleXmlBuilderContextListener</listener-class>
</listener>
</web-app>
These 3 xml files are under WEB-INF. All .jar files are under WEB-INF/lib
Any help would be appreciated. Thank you.

Related

Eclipse we-app Error using google cloud

Eclipse is returning a couple of quite frustrating errors.
attribute xmlns must be declared for element type web-app
attribute version must be declared for element type web-app
This is the source code for web.xml
I got it from following the instructions from this site.
https://cloud.google.com/appengine/docs/java/gettingstarted/ui_and_code
Here is also the code...
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE web-app PUBLIC
"-//Oracle Corporation//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
<servlet>
<servlet-name>guestbook</servlet-name>
<servlet-class>com.example.guestbook.GuestbookServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>guestbook</servlet-name>
<url-pattern>/guestbook</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>guestbook.jsp</welcome-file>
</welcome-file-list>
</web-app>
The errors occur on line 5. I'm not sure s to how to fix this problem. Any input would be greatly appreciated.
You can replace the first 5 lines with this:
<?xml version="1.0" ?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
But your app will probably run properly anyway, so you can also disable that Eclipse warning.

HTTP Status 404 The requested resource is not available jersey tomcat

I am having trouble to launch my testing app on the tomcat8 server. When i enter the http://localhost:8080/loginService/rest/auth, the error message is "HTTP Status 404 -
type Status report. message: description The requested resource is not available."
And the starting page http://localhost:8080/ works fine.
I put all the jar files(jersey-client, jersey-common, jersey-container-servlet,jersey-container-servlet-core, jersey-server, javax.ws.rs-api-2.0 ....) under the WEB-INF/lib. And loginService is deployed by the server.
the web.xml file under WEB-INF
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID"
version="2.5">
<display-name>loginService</display-name>
<servlet>
<servlet-name>Jersey REST Service</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>loginTest</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Jersey REST Service</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
</web-app>
my testing app:
package loginTest;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
#Path("/auth")
public class Authenticate {
// This method is called if TEXT_PLAIN is request
#GET
#Produces(MediaType.TEXT_PLAIN)
public String test() {
return "succes";
}
}
Here are the part of the console msg which seems like a problem:
七月 10, 2014 3:06:20 下午 org.apache.catalina.core.StandardContext reload
严重: Exception starting Context with name [/loginService]
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/loginService]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3780)
at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:293)
at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5539)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1365)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1369)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1369)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1345)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: jersey/repackaged/com/google/common/base/Function
at org.glassfish.jersey.internal.ServiceFinder.<clinit>(ServiceFinder.java:165)
at org.glassfish.jersey.servlet.internal.ServletContainerProviderFactory.getAllServletContainerProviders(ServletContainerProviderFactory.java:66)
at org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer.onStartup(JerseyServletContainerInitializer.java:132)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5173)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 8 more
Caused by: java.lang.ClassNotFoundException: jersey.repackaged.com.google.common.base.Function
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1324)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1177)
... 13 more
七月 10, 2014 3:06:20 下午 org.apache.catalina.core.StandardContext reload
信息: Reloading Context with name [/loginService] is completed
And I am using tomcat8 and jersey2.10.1.
I just changed my web.xml file to :
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID"
version="2.5">
<display-name>loginService</display-name>
<servlet>
<servlet-name>Jersey REST Service</servlet-name>
<servlet-class>org.glassfish.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>loginTest</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Jersey REST Service</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
</web-app>
It seems like your application is missing some of the required libraries or (Since you already have the jercy-common.jar) there is an incompatibility in the libraries already in the classpath.
Therefore I would like to point out a perfectly working(Tested with Tomcat 8) sample in the below link.
Jersey-HelloWorld-Example
Hope this helps.
I had this problem. I just solved it by deleting all web.xml files (inside "target" folder and "main" folder). Then right click on the project in Project Explorer and java EE tools -> Generate Deployment Descriptor Stub. After that just right click again on the project -> run as -> Maven build... Then in "Goals" field write: "clean install" (whithout quotes). Click on Apply, click on Run. Then go to your Tomcat manager, undeploy the old .war file and deploy it again. Then just run it! It worked for me.
According to this link https://www3.ntu.edu.sg/home/ehchua/programming/howto/Tomcat_HowTo.html#TomcatDebug , there are many reasons for this kind of problem to occur. In addition, I had been through this problem before. I solved it through the following way. Take a look at the web.xml heading in tomcat/webapps/ROOT/WEB-INF/web.xml. And make sure your your web.xml looks like that. Specially try to compare the versions. For instance:
Mine was:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app version="3.0"
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">
........
..........
</web-app>
The tomcat version that you install can be like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app version="4.0"
metadata-complete="true"
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_4_0.xsd">
........
..........
</web-app>
If you look at both they have version difference and metadata attribute difference. So header of both your web.xml and tomcat/webapps/ROOT/WEB-INF/web.xml must be identical. By changing version number within the header of my web.xml into 4 solved my problem. Whatever version you have, make sure it is identical with the ROOT's web.xml version. Hope it helps

Deploy Servlet to Tomcat hosting

I create Facebook JSP Application. I use Restful Java Client Web Services. And created .java file. in this file have Servlet. but can not deploy it into the hosting. I deployed follow
WEB-INF
-classes
-facebook
-socialnetworkingservice
-facebookresponse
......and many classes
-META-INF
-org
-my
-facebook
-client
FacebookClient$FacebookCallbackServlet.class
FacebookClient$FacebookLoginServlet.class
FacebookClient.class
-lib
..lib files
-web.xml
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 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_2_5.xsd">
<servlet>
<servlet-name>FacebookClient$FacebookLoginServlet</servlet-name>
<servlet-class>org.my.facebook.client.FacebookClient$FacebookLoginServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>FacebookClient$FacebookCallbackServlet</servlet-name>
<servlet-class>org.my.facebook.client.FacebookClient$FacebookCallbackServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>FacebookClient$FacebookLoginServlet</servlet-name>
<url-pattern>/FacebookLoginServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>FacebookClient$FacebookCallbackServlet</servlet-name>
<url-pattern>/FacebookCallbackServlet/</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
META-INf ( I think it is not important)
I compile localhost and have (MyFbFriend.war)
and I get this error
"Not Found
The requested URL /FacebookLoginServlet was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."
Try
http://localhost:8080/MyFbFriend/FacebookLoginServlet/
The name of the War gives the Context of the App

Requested Resource (servlet name) not found Tomcat Eclipse IDE

I am trying to deploy a servlet on Tomcat from Eclipse using WTP plugin. Eclipse is working fine and Tomcat is also up. As when I open http://localhost:8080 I get the home page of Tomcat. I am following this exact tutorial http://www.vogella.com/articles/EclipseWTP/article.html but when I try to deploy it on tomcat by right clicking on servlet class and run as run on server I get following error. The requested resource (/test/FileCounter) is not available. I searched but could not find anything which could help me. I am using Eclipse Java EE IDE and Tomcat 6. Following is my web.xml file
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>test</display-name>
<servlet>
<description></description>
<display-name>FileCounter</display-name>
<servlet-name>FileCounter</servlet-name>
<servlet-class>com.servlets.FileCounter</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>FileCounter</servlet-name>
<url-pattern>/FileCounter</url-pattern>
</servlet-mapping>
</web-app>
I faced this same problem and just solved it !
In the Project Explorer , expand the Deployment descriptor ( just above the Java resource ) . Then expand "servlet" in that deployment descriptor , their should be your created Servlet. Right click on it and Run as --> Run on server .
But one thing isn't clear to me in Eclipse that web.xml is not defined properly but the servlet is running without it !
I just had this same problem. It appears from some reason when I created the servlet through the servlet wizard, eclipse did not create a web.xml file in the WebContent WEB-INF folder. I don't know why it didn't create it.
I added the web.xml file into the WebContent/WEB-INF folder and when I did that, I had a servlet under deployment descriptor that I could right click on and run as -> run on server
Here is the web.xml file you need:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>test</display-name>
<servlet>
<description></description>
<display-name>FileCounter</display-name>
<servlet-name>FileCounter</servlet-name>
<servlet-class>your.servlet.path.filecounter.servlets.FileCounter</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>FileCounter</servlet-name>
<url-pattern>/FileCounter</url-pattern>
</servlet-mapping>
</web-app>
Of course you will want to update your servlet class to the package name you created

Exception after adding JAX-RS facet to Dynamic Web Project in Eclipse

I am a newbie to Oracle Plugin for Eclipse (OEPE) and EJB. I am following the tutorial on following the tutorial on http://www.youtube.com/watch?v=on557289GzA&feature=relmfu titled JavaEE6 and Glassfish with Eclipse (5 of 5)
I am getting the following exception after I enable JAX-RS facet for the Dyanamic Web Project.
Exception while loading the app : java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
I recreated a new environment (Eclipse Indigo, Glassfish 3.0.1) but I am struck at the same point. There is a already a question on the same topic. But it is marked answered without answer or even a hint!!
Please help me.
My persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="OpenEducation">
<jta-data-source>jdbc/ScottConn</jta-data-source>
<class>model.Course</class>
<class>model.Customer</class>
<class>model.Registration</class>
</persistence-unit>
</persistence>
My web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<display-name>OpenEducation</display-name>
<servlet>
<description>JAX-RS Tools Generated - Do not modify</description>
<servlet-name>JAX-RS Servlet</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>JAX-RS Servlet</servlet-name>
<url-pattern>/jaxrs/*</url-pattern>
</servlet-mapping>
</web-app>
Thanks in advance.
You must have in your project at least one class marked with #Path JAX-RS annotation.