6 Replies Latest reply on Nov 20, 2006 5:00 PM by jean

Hallo,
I use struts in my web-application which I would like to deploy in jboss.
The Problem that I have is that Tomcat in Jboss cannot see the servlet.jar in WEB-INF/lib. Can someone help me with that Exection?
Thank you!

```
18:47:08,781 INFO [Server] Starting JBoss (MX MicroKernel)...
18:47:08,781 INFO [Server] Release ID: JBoss [Zion] 4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)
18:47:08,796 INFO [Server] Home Dir: C:\Programme\jboss-4.0.5.GA
18:47:08,796 INFO [Server] Home URL: file:/C:/Programme/jboss-4.0.5.GA/
18:47:08,796 INFO [Server] Patch URL: null
18:47:08,796 INFO [Server] Server Name: default
18:47:08,796 INFO [Server] Server Home Dir: C:\Programme\jboss-4.0.5.GA\server\default
18:47:08,796 INFO [Server] Server Home URL: file:/C:/Programme/jboss-4.0.5.GA/server/default/
18:47:08,796 INFO [Server] Server Log Dir: C:\Programme\jboss-4.0.5.GA\server\default\log
18:47:08,796 INFO [Server] Server Temp Dir: C:\Programme\jboss-4.0.5.GA\server\default\tmp
18:47:08,796 INFO [Server] Root Deployment Filename: jboss-service.xml
18:47:09,031 INFO [ServerInfo] Java version: 1.5.0_09,Sun Microsystems Inc.
18:47:09,031 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.5.0_09-b03,Sun Microsystems Inc.
18:47:09,031 INFO [ServerInfo] OS-System: Windows XP 5.1,x86
18:47:09,750 INFO [Server] Core system initialized
18:47:11,234 INFO [WebService] Using RMI server codebase: http://Jeanette:8083/
18:47:11,250 INFO [Log4jService\$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
18:47:14,218 INFO [ServiceEndpointManager] WebServices: jbossws-1.0.3.SP1 (date=200609291417)
18:47:15,015 INFO [Embedded] Catalina naming disabled
18:47:15,062 INFO [ClusterRuleSetFactory] Unable to find a cluster rule set in the classpath. Will load the default rule set.
18:47:15,062 INFO [ClusterRuleSetFactory] Unable to find a cluster rule set in the classpath. Will load the default rule set.
18:47:15,281 INFO [Http11BaseProtocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0-8080
18:47:15,281 INFO [Catalina] Initialization processed in 219 ms
18:47:15,281 INFO [StandardService] Starting service jboss.web
18:47:15,296 INFO [StandardEngine] Starting Servlet Engine: Apache Tomcat/5.5.20
18:47:15,312 INFO [StandardHost] XML validation disabled
18:47:15,343 INFO [Catalina] Server startup in 62 ms
18:47:15,609 INFO [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=.../deploy/http-invoker.sar/invoker.war/
18:47:15,828 INFO [WebappLoader] Dual registration of jndi stream handler: factory already defined
18:47:16,156 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=.../deploy/jbossweb-tomcat55.sar/ROOT.war/
18:47:17,062 INFO [TomcatDeployer] deploy, ctxPath=/pvWEB, warUrl=.../tmp/deploy/tmp19220pvWEB-exp.war/
18:47:17,468 INFO [TilesPlugin] Tiles definition factory loaded for module ''.
18:47:17,515 INFO [JBossCacheManager] init(): replicationGranularity_ is 0 and invaldateSessionPolicy is 2
18:47:17,515 WARN [TomcatDeployer] Failed to setup clustering, clustering disabled. NoClassDefFoundError: org/jboss/cache/CacheException
18:47:17,671 INFO [TomcatDeployer] deploy, ctxPath=/jbossws, warUrl=.../tmp/deploy/tmp19227jbossws-context-exp.war/
18:47:17,765 INFO [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=.../deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
18:47:18,484 INFO [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=.../deploy/management/console-mgr.sar/web-console.war/
18:47:18,984 INFO [MailService] Mail Service bound to java:/Mail
18:47:19,109 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-local-jdbc.rar
18:47:19,140 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-xa-jdbc.rar
18:47:19,156 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-local-jdbc.rar
18:47:19,171 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-xa-jdbc.rar
18:47:19,203 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jms/jms-ra.rar
18:47:19,234 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/mail-ra.rar
18:47:20,046 INFO [WrapperDataSourceService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
18:47:20,265 INFO [A] Bound to JNDI name: queue/A
18:47:20,265 INFO [B] Bound to JNDI name: queue/B
18:47:20,265 INFO [C] Bound to JNDI name: queue/C
18:47:20,265 INFO [D] Bound to JNDI name: queue/D
18:47:20,265 INFO [ex] Bound to JNDI name: queue/ex
18:47:20,281 INFO [testTopic] Bound to JNDI name: topic/testTopic
18:47:20,281 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
18:47:20,281 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
18:47:20,281 INFO [testQueue] Bound to JNDI name: queue/testQueue
18:47:20,328 INFO [UILServerILService] JBossMQ UIL service available at : /0.0.0.0:8093
18:47:20,359 INFO [DLQ] Bound to JNDI name: queue/DLQ
18:47:20,484 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
18:47:20,515 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
18:47:20,640 INFO [EARDeployer] Init J2EE application: file:/C:/Programme/jboss-4.0.5.GA/server/default/deploy/pvEAR.ear
18:47:20,953 INFO [TomcatDeployer] deploy, ctxPath=/pvWeb, warUrl=.../tmp/deploy/tmp19259pvEAR.ear-contents/pvWeb-exp.war/
18:47:20,984 INFO [WebappClassLoader] validateJarFile(C:\Programme\jboss-4.0.5.GA\server\default\.\tmp\deploy\tmp19259pvEAR.ear-contents\pvWeb-exp.war\WEB-INF\lib\javax.servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
18:47:20,984 INFO [WebappClassLoader] validateJarFile(C:\Programme\jboss-4.0.5.GA\server\default\.\tmp\deploy\tmp19259pvEAR.ear-contents\pvWeb-exp.war\WEB-INF\lib\servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
18:47:21,359 INFO [TilesPlugin] Tiles definition factory loaded for module ''.
18:47:21,375 INFO [JBossCacheManager] init(): replicationGranularity_ is 0 and invaldateSessionPolicy is 2
18:47:21,375 WARN [TomcatDeployer] Failed to setup clustering, clustering disabled. NoClassDefFoundError: org/jboss/cache/CacheException
18:47:21,406 INFO [EARDeployer] Started J2EE application: file:/C:/Programme/jboss-4.0.5.GA/server/default/deploy/pvEAR.ear
18:47:21,500 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
18:47:21,562 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
18:47:21,578 INFO [JkMain] Jk running ID=0 time=0/32 config=null
18:47:21,578 INFO [Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)] Started in 12s:782ms

```

• ###### 1. Re: servlet.jar not loadet

I removed the servlet.jar from WEB-INF/lib...

I deploy my web-application on Jboss. The problem is that Jboss only see my index.jsp but not the other classes. In the index.jsp ist only a forward to an action (struts actions):

```<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<logic:redirect forward="welcomeAction"/>
```

Jboss don't see my action classes. Can anybody help me?

I get the exception:

```21:08:09,281 ERROR [RequestProcessor] No action instance for path /WelcomeAction could be created
java.lang.ClassNotFoundException: action.WelcomeAction
at org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.java:117)
at org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:143)
at org.apache.struts.action.RequestProcessor.processActionCreate(RequestProcessor.java:292)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:230)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol\$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
```

• ###### 2. Re: servlet.jar not loadet

How are your class packaged? They should either be as a jar file in WEB-INF/lib, or in a class hierarchy under WEB-INF/classes.

• ###### 3. Re: servlet.jar not loadet

my classes are packed in WEB-INF/classes. There are all my action-classes and forms...
I put the references (ActionServlet ...taglibs...) of my struts-framework in the web.xml of my web-application. Maybe the tomcat don's see my struts-framework? Do I have to put the references in web.xml of tomcat oder web.xml of my web-application?

• ###### 4. Re: servlet.jar not loadet

So the WelcomeAction class file is located at WEB-INF/classes/action/WelcomeAction.class, is that correct? And the struts jar files are located at WEB-INF/lib?

• ###### 5. Re: servlet.jar not loadet

The Tomcat-Deployer in Jboss makes that packege:

```22:26:26,211 INFO [TomcatDeployer] deploy, ctxPath=/pvWeb, warUrl=.../tmp/deploy/tmp9268pvEAR.ear-contents/pvWeb-exp.war/
```

and in pvWeb-exp.war WelcomeAction class is located at WEB-INF/classe/action/WelcomeAction.class and struts.jar is in WEB-INF/lib

• ###### 6. Re: servlet.jar not loadet

The problem ist that the right packege name is pvWEB.war and not pvWeb-exp.war. The last name was given autamaticly.

Maybe the deployer use the wrong .war-file.
I think I have wrong "dist" entries in my build.xml

```
<project name="blank" basedir="../" default="all">

<!-- Local system paths -->

<property name="distpath.project" value="/jboss-4.0.5.GA/server/default/deploy/jbossweb-tomcat55.sar/"/>
<!-- Project settings -->
<property name="project.title" value="pv"/>
<property name="project.distname" value="pvWEB"/>
<property name="project.version" value="1.3"/>

<!-- Path settings -->
<property name="doc.path" value="./doc/api"/>
<property name="doc.src" value="./src/java"/>

<!-- classpath for Struts 1.3 -->
<path id="compile.classpath">

<pathelement path ="lib/commons-beanutils.jar"/>
<pathelement path ="lib/commons-digester-1.6.jar"/>
<pathelement path ="lib/struts.jar"/>
<pathelement path ="classes"/>
<pathelement path ="\${classpath}"/>
</path>

<!-- Check timestamp on files -->
<target name="prepare">
<tstamp/>
</target>

<!-- Copy any resource or configuration files -->
<target name="resources">
<copy todir="classes" includeEmptyDirs="no">
<fileset dir="src/java">
<patternset>
<include name="**/*.conf"/>
<include name="**/*.properties"/>
<include name="**/*.xml"/>
</patternset>
</fileset>
</copy>
</target>

<!-- Normal build of application -->
<target name="compile" depends="prepare,resources">
<javac srcdir="src/java" destdir="classes">
<classpath refid="compile.classpath"/>
</javac>
</target>

<!-- Remove classes directory for clean build -->
<target name="clean"
description="Prepare for clean build">
<delete dir="classes"/>
<mkdir dir="classes"/>
</target>

<!-- Build entire project -->
<target name="project" depends="clean,prepare,compile"/>

<!-- Create binary distribution -->
<target name="dist"
description="Create binary distribution">

<mkdir
dir="\${distpath.project}"/>
<jar
jarfile="\${distpath.project}/\${project.distname}.jar"
basedir="./classes"/>
<copy
file="\${distpath.project}/\${project.distname}.jar"
todir="\${distpath.project}"/>

<war
basedir="D:/workspace/pvWEB"
warfile="../../\${project.distname}.war"
webxml="D:/workspace/pvWEB/WebContent/WEB-INF/web.xml">
<exclude name="**/\${distpath.project}/**"/>
</war>
<move file="../../\${project.distname}.war" tofile="\${distpath.project}/\${project.distname}.war" />
</target>

<!-- Build project and create distribution-->
<target name="all" depends="project,dist"/>

</project>
```

and that is what the server delpoy:

```
22:52:59,492 INFO [Server] Starting JBoss (MX MicroKernel)...
22:52:59,492 INFO [Server] Release ID: JBoss [Zion] 4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)
22:52:59,492 INFO [Server] Home Dir: C:\Programme\jboss-4.0.5.GA
22:52:59,492 INFO [Server] Home URL: file:/C:/Programme/jboss-4.0.5.GA/
22:52:59,492 INFO [Server] Patch URL: null
22:52:59,492 INFO [Server] Server Name: default
22:52:59,492 INFO [Server] Server Home Dir: C:\Programme\jboss-4.0.5.GA\server\default
22:52:59,492 INFO [Server] Server Home URL: file:/C:/Programme/jboss-4.0.5.GA/server/default/
22:52:59,492 INFO [Server] Server Log Dir: C:\Programme\jboss-4.0.5.GA\server\default\log
22:52:59,492 INFO [Server] Server Temp Dir: C:\Programme\jboss-4.0.5.GA\server\default\tmp
22:52:59,508 INFO [Server] Root Deployment Filename: jboss-service.xml
22:52:59,742 INFO [ServerInfo] Java version: 1.5.0_09,Sun Microsystems Inc.
22:52:59,742 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.5.0_09-b03,Sun Microsystems Inc.
22:52:59,742 INFO [ServerInfo] OS-System: Windows XP 5.1,x86
22:53:00,227 INFO [Server] Core system initialized
22:53:01,711 INFO [WebService] Using RMI server codebase: http://Jeanette:8083/
22:53:01,727 INFO [Log4jService\$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
22:53:04,696 INFO [ServiceEndpointManager] WebServices: jbossws-1.0.3.SP1 (date=200609291417)
22:53:05,524 INFO [Embedded] Catalina naming disabled
22:53:05,555 INFO [ClusterRuleSetFactory] Unable to find a cluster rule set in the classpath. Will load the default rule set.
22:53:05,571 INFO [ClusterRuleSetFactory] Unable to find a cluster rule set in the classpath. Will load the default rule set.
22:53:05,789 INFO [Http11BaseProtocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0-8080
22:53:05,805 INFO [Catalina] Initialization processed in 234 ms
22:53:05,805 INFO [StandardService] Starting service jboss.web
22:53:05,805 INFO [StandardEngine] Starting Servlet Engine: Apache Tomcat/5.5.20
22:53:05,821 INFO [StandardHost] XML validation disabled
22:53:05,852 INFO [Catalina] Server startup in 47 ms
22:53:06,133 INFO [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=.../deploy/http-invoker.sar/invoker.war/
22:53:06,352 INFO [WebappLoader] Dual registration of jndi stream handler: factory already defined
22:53:06,680 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=.../deploy/jbossweb-tomcat55.sar/ROOT.war/
22:53:07,742 INFO [TomcatDeployer] deploy, ctxPath=/pvWEB, warUrl=.../tmp/deploy/tmp18099pvWEB-exp.war/
22:53:08,180 INFO [TilesPlugin] Tiles definition factory loaded for module ''.
22:53:08,274 INFO [TomcatDeployer] deploy, ctxPath=/jbossws, warUrl=.../tmp/deploy/tmp18106jbossws-context-exp.war/
22:53:08,383 INFO [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=.../deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
22:53:09,117 INFO [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=.../deploy/management/console-mgr.sar/web-console.war/
22:53:09,617 INFO [MailService] Mail Service bound to java:/Mail
22:53:09,742 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-local-jdbc.rar
22:53:09,774 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-xa-jdbc.rar
22:53:09,789 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-local-jdbc.rar
22:53:09,805 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-xa-jdbc.rar
22:53:09,836 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jms/jms-ra.rar
22:53:09,852 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/mail-ra.rar
22:53:10,649 INFO [WrapperDataSourceService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
22:53:10,867 INFO [A] Bound to JNDI name: queue/A
22:53:10,883 INFO [B] Bound to JNDI name: queue/B
22:53:10,883 INFO [C] Bound to JNDI name: queue/C
22:53:10,883 INFO [D] Bound to JNDI name: queue/D
22:53:10,883 INFO [ex] Bound to JNDI name: queue/ex
22:53:10,899 INFO [testTopic] Bound to JNDI name: topic/testTopic
22:53:10,899 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
22:53:10,899 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
22:53:10,899 INFO [testQueue] Bound to JNDI name: queue/testQueue
22:53:10,946 INFO [UILServerILService] JBossMQ UIL service available at : /0.0.0.0:8093
22:53:10,977 INFO [DLQ] Bound to JNDI name: queue/DLQ
22:53:11,102 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
22:53:11,133 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
22:53:11,258 INFO [EARDeployer] Init J2EE application: file:/C:/Programme/jboss-4.0.5.GA/server/default/deploy/pvEAR.ear
22:53:11,539 INFO [TomcatDeployer] deploy, ctxPath=/pvWeb, warUrl=.../tmp/deploy/tmp18138pvEAR.ear-contents/pvWeb-exp.war/22:53:12,086 INFO [TilesPlugin] Tiles definition factory loaded for module ''.
22:53:12,117 INFO [EARDeployer] Started J2EE application: file:/C:/Programme/jboss-4.0.5.GA/server/default/deploy/pvEAR.ear
22:53:12,211 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
22:53:12,274 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
22:53:12,289 INFO [JkMain] Jk running ID=0 time=0/31 config=null
22:53:12,289 INFO [Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)] Started in 12s:781ms

```