java - I am trying to run a war file in jboss using resteasy services but not able to do so -


i trying run rest easy web services on jboss eap 6.0 server jboss server , running when trying copy war file in deployment folder of jboss throughing moduleclassloader exception....please me finding solution problem.....

this 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" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="webapp_id" version="3.0"> <display-name>demo-resteasywebservices</display-name>    <context-param>     <param-name>resteasy.scan</param-name>     <param-value>true</param-value> </context-param>    <context-param>     <param-name>resteasy.servlet.mapping.prefix</param-name>     <param-value>/rest</param-value> </context-param>   <listener>     <listener-class>org.jboss.resteasy.plugins.server.servlet.resteasybootstrap</listener-class> </listener>  <servlet>     <servlet-name>resteasy-servlet</servlet-name>     <servlet-class>org.jboss.resteasy.plugins.server.servlet.httpservletdispatcher</servlet-class>  </servlet>  <servlet-mapping>     <servlet-name>resteasy-servlet</servlet-name>     <url-pattern>/rest/*</url-pattern> </servlet-mapping> 

this pom.xml-

<project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">    <modelversion>4.0.0</modelversion>    <groupid>demo-resteasywebservices</groupid>   <artifactid>demo-resteasywebservices</artifactid>   <version>0.0.1-snapshot</version>    <packaging>war</packaging>    <dependencies>      <dependency>         <groupid>org.jboss.resteasy</groupid>         <artifactid>resteasy-jaxrs</artifactid>         <version>2.3.6.final</version>         <scope>provided</scope>     </dependency>      <dependency>         <groupid>jdk.tools</groupid>         <artifactid>jdk.tools</artifactid>         <scope>system</scope>         <version>1.8.0</version>         <systempath>${java_home}/lib/tools.jar</systempath>     </dependency>      <dependency>         <groupid>log4j</groupid>         <artifactid>log4j</artifactid>         <version>1.2.17</version>     </dependency>   </dependencies>  <build>     <plugins>         <plugin>              <groupid>org.apache.maven.plugins</groupid>             <artifactid>maven-compiler-plugin</artifactid>             <version>3.1</version>             <configuration>                 <source>1.7</source>                 <target>1.7</target>             </configuration>          </plugin>         <plugin>             <groupid>org.apache.maven.plugins</groupid>             <artifactid>maven-war-plugin</artifactid>             <version>2.6</version>             <configuration>                 <warsourcedirectory>webcontent</warsourcedirectory>                 <failonmissingwebxml>false</failonmissingwebxml>             </configuration>         </plugin>          <plugin>             <artifactid>maven-assembly-plugin</artifactid>             <configuration>                 <version>5</version>                 <descriptorrefs>                     <descriptorref>jar-with-dependencies</descriptorref>                 </descriptorrefs>                 <archive>                     <manifest>                         <mainclass></mainclass>                     </manifest>                 </archive>                 <!-- <modules> <webmodule> <groupid>com.macys.smt</groupid> <artifactid>apm-hbaseservice</artifactid>                      <contextroot>/apmservice</contextroot> </webmodule> </modules> -->             </configuration>             <executions>                 <execution>                     <id>make-assembly</id>                     <phase>package</phase>                     <goals>                         <goal>single</goal>                     </goals>                 </execution>             </executions>         </plugin>     </plugins>   </build> 

java program

package com.rest;  import javax.ws.rs.get; import javax.ws.rs.path; import javax.ws.rs.pathparam; import javax.ws.rs.core.response;  @path("/message") public class restservicesmessage {  @get @path("/{param}") public response displaymessage(@pathparam("param") string msg) {     string message= "restfull web services message" + msg;      return response.status(200).entity(message).build();  } 

}

the exception

10:58:05,801 error [org.apache.catalina.core.containerbase.[jboss.web].[default-host].[/demo-resteasywebservices-0.0.1-snapshot]] (serverservice thread pool -- 9) jbweb000285: error configuring application listener of class org.jboss.resteasy.plugins.server.servlet.resteasybootstrap: java.lang.classnotfoundexception: org.jboss.resteasy.plugins.server.servlet.resteasybootstrap [module "deployment.demo-resteasywebservices-0.0.1-snapshot.war:main" service module loader] @ org.jboss.modules.moduleclassloader.findclass(moduleclassloader.java:213) [jboss-modules.jar:1.3.6.final-redhat-1] @ org.jboss.modules.concurrentclassloader.performloadclassunchecked(concurrentclassloader.java:459) [jboss-modules.jar:1.3.6.final-redhat-1] @ org.jboss.modules.concurrentclassloader.performloadclasschecked(concurrentclassloader.java:408) [jboss-modules.jar:1.3.6.final-redhat-1] @ org.jboss.modules.concurrentclassloader.performloadclass(concurrentclassloader.java:389) [jboss-modules.jar:1.3.6.final-redhat-1] @ org.jboss.modules.concurrentclassloader.loadclass(concurrentclassloader.java:134) [jboss-modules.jar:1.3.6.final-redhat-1] @ org.jboss.as.web.deployment.webinjectioncontainer.newinstance(webinjectioncontainer.java:78) [jboss-as-web-7.5.0.final-redhat-21.jar:7.5.0.final-redhat-21] @ org.apache.catalina.core.standardcontext.contextlistenerstart(standardcontext.java:3294) [jbossweb-7.5.7.final-redhat-1.jar:7.5.7.final-redhat-1] @ org.apache.catalina.core.standardcontext.start(standardcontext.java:3780) [jbossweb-7.5.7.final-redhat-1.jar:7.5.7.final-redhat-1] @ org.jboss.as.web.deployment.webdeploymentservice.dostart(webdeploymentservice.java:163) [jboss-as-web-7.5.0.final-redhat-21.jar:7.5.0.final-redhat-21] @ org.jboss.as.web.deployment.webdeploymentservice.access$000(webdeploymentservice.java:61) [jboss-as-web-7.5.0.final-redhat-21.jar:7.5.0.final-redhat-21] @ org.jboss.as.web.deployment.webdeploymentservice$1.run(webdeploymentservice.java:96) [jboss-as-web-7.5.0.final-redhat-21.jar:7.5.0.final-redhat-21] @ java.util.concurrent.executors$runnableadapter.call(unknown source) [rt.jar:1.7.0_71] @ java.util.concurrent.futuretask.run(unknown source) [rt.jar:1.7.0_71] @ java.util.concurrent.threadpoolexecutor.runworker(unknown source) [rt.jar:1.7.0_71] @ java.util.concurrent.threadpoolexecutor$worker.run(unknown source) [rt.jar:1.7.0_71] @ java.lang.thread.run(unknown source) [rt.jar:1.7.0_71] @ org.jboss.threads.jbossthread.run(jbossthread.java:122) 

it solved removing listner class in web.xml file.....and because ambari server using port 8080 changed port of ambari , resteasy webservices working fine on 8080 port jboss.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -