You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Barbara Allori <ba...@akros.it> on 2003/03/07 10:28:18 UTC
runservertests
Hello,
I am a new Italian user.
I am getting a LogConfigurationException when trying to run a servlet test:
org.apache.commons.logging.LogConfigurationException:
java.lang.reflect.InvocationTargetException at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:509)
at
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:285)
at
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:255)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:381)
I'm using Tomcat 4.1 and Cactus 1.4.1; I have put the
commons-logging-1.0.jar in common/lib directory of Tomcat and also in the
web-inf/lib dir of my web application.
If I want to use the runservertests task with already running
servers, how to is possible?
Thanks
Barbara
Re: runservertests
Posted by Barbara Allori <ba...@akros.it>.
If I try removing the commons-logging.jar from WEB-INF/lib I get this
exception:
javax.servlet.ServletException: Invoker service() exception at
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:516)
at
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at
I'm in this situation:
in the build.xml I wrote:
<path id="project.class.test.path">
<pathelement location="${lib.dir}/classes12.jar"/>
<pathelement location="${aspectjrt.jar}"/>
<pathelement location="${lib.dir}/xerces.jar"/>
<pathelement
location="${tomcat.home.40}/common/lib/commons-logging-api.jar"/>
<pathelement location="${commons.httpclient.jar}"/>
<pathelement location="${commons.logging.jar}"/>
<pathelement location="${log4j.jar}"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${cactus.framework.jar}"/>
<pathelement location="${servlet.jar}"/>
<pathelement location="${cactus.ant.jar}"/>
<pathelement location="${classes.dir}"/>
<pathelement location="${classes.test.dir}"/>
<pathelement
location="${tomcat.home.40}/common/lib/commons-collections.jar"/>
<pathelement path="${java.class.path}"/>
</path>
......
<target name="test">
<junit printsummary="yes" fork="yes" haltonfailure="yes">
<classpath>
<path refid="project.class.test.path"/>
<pathelement location="${java.class.path}"/>
</classpath>
<formatter type="xml"/>
<test name="test.SuiteMia" haltonfailure="no" todir="${report}"
outfile="JUnit-Report"/>
</junit>
</target>
...
In the batch file that I use for the build I set the path and the classpath
in this way:
SET ANT_HOME=D:\ApacheGroup\jakarta-ant-1.5
SET CACTUS_HOME=D:\ApacheGroup\jakarta-cactus-13-1.4.1
SET JUNIT=D:\JUnit\junit3.8
SET JAVA_HOME=D:\jdk1.3.1
SET MYAPP=D:\JavaDev\GERIPWEB\web\webroot\WEB-INF
SET TOMCAT40 = D:\Applicativi\Apache Group\Tomcat 4.1
SET PATH=%PATH%;%ANT_HOME%\bin;%JAVA_HOME%\bin
SET CLASSPATH=%MYAPP%\classes
SET CLASSPATH=%CLASSPATH%;%MYAPP%
SET CLASSPATH=%CLASSPATH%;%CACTUS_HOME%\lib\catalina-ant.jar
SET CLASSPATH=%CLASSPATH%;%CACTUS_HOME%\lib\commons-logging-1.0.jar
SET CLASSPATH=%CLASSPATH%;%JUNIT%\junit.jar
SET CLASSPATH=%CLASSPATH%;%ANT_HOME%\lib\optional.jar
SET CLASSPATH=%CLASSPATH%;%ANT_HOME%\lib\ant.jar
SET CLASSPATH=%CLASSPATH%;%ANT_HOME%\lib\xalan-2.3.1.jar
SET CLASSPATH=%CLASSPATH%;%ANT_HOME%\lib\xercesImpl.jar
SET CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
SET CLASSPATH=%CLASSPATH%;
This is web.xml:
<web-app>
<context-param>
<param-name>property_file</param-name>
<param-value>/WEB-INF/property.properties</param-value>
</context-param>
<servlet>
<servlet-name>Login</servlet-name>
<display-name>Login</display-name>
<servlet-class>Login.serv_Login</servlet-class>
</servlet>
<servlet>
<servlet-name>servsked</servlet-name>
<servlet-class>skeduler.serv_Sked</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Menu</servlet-name>
<url-pattern>/Menu</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>100</session-timeout>
</session-config>
</web-app>
My Tomcat 4.1 distribution contains Commons-Logging:
common/lib
commons-logging-api.jar
server/lib
commons-logging.jar
Is the problem bound to invoker? Have you some other ideas?
Re: runservertests
Posted by Christopher Lenz <cm...@gmx.de>.
Barbara Allori wrote:
>> Normally the Tomcat 4.1 distribution contains Commons-Logging:
>>
>> common/lib
>> commons-logging-api.jar
>> server/lib
>> commons-logging.jar
>
> Me too I have this configuration, and the TOMCAT VERSION IS 41.1.12.
>
> The common-logging.jar is also in the classpath that I use to run the
> tests, is it the problem?
Those should be different JVMs, thus not affecting each other.
Just for fun, try removing the commons-logging.jar from WEB-INF/lib
-chris
Re: runservertests
Posted by Barbara Allori <ba...@akros.it>.
>>>
>>>Try with putting the Commons-Logging JAR *only* in WEB-INF/lib
>>This doesn't resolve the problem, because now the error is
>>The server encountered an internal error () that prevented it from
>>fulfilling this request.</u></p><p><b>exception</b>
>><pre>org.apache.commons.logging.LogConfigurationException:
>>org.apache.commons.logging.LogConfigurationException:
>>org.apache.commons.logging.LogConfigurationException: Class
>>org.apache.commons.logging.impl.Log4JCategoryLog does not implement Log
>>at
>>org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:530)
>>at
>>org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:285)
>>at
>>org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:255)
>>at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:382) at
>>org.apache.cactus.server.ServletTestRedirector.around112_doGet
>
>This seems to be a pretty common error with Commons-Logging, but I've
>never encountered it myself yet.
>
>Normally the Tomcat 4.1 distribution contains Commons-Logging:
>
>common/lib
> commons-logging-api.jar
>server/lib
> commons-logging.jar
Me too I have this configuration, and the TOMCAT VERSION IS 41.1.12.
The common-logging.jar is also in the classpath that I use to run the
tests, is it the problem?
>Is this the layout used by the Tomcat version you're using? Which exact
>version of Tomcat 4.1 are you using?
>
>-chris
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: cactus-user-help@jakarta.apache.org
>
Cordiali Saluti,
Ing. Barbara Allori
Akros Informatica s.r.l
ballori@akros.it
Re: runservertests
Posted by Christopher Lenz <cm...@gmx.de>.
Hi Barbara,
Barbara Allori wrote:
> At 11.26 07/03/2003 +0100, you wrote:
>> Barbara Allori wrote:
>>> I'm using Tomcat 4.1 and Cactus 1.4.1; I have put the
>>> commons-logging-1.0.jar in common/lib directory of Tomcat and also in
>>> the web-inf/lib dir of my web application.
>>
>> Try with putting the Commons-Logging JAR *only* in WEB-INF/lib
>
> This doesn't resolve the problem, because now the error is
>
> The server encountered an internal error () that prevented it from
> fulfilling this request.</u></p><p><b>exception</b>
> <pre>org.apache.commons.logging.LogConfigurationException:
> org.apache.commons.logging.LogConfigurationException:
> org.apache.commons.logging.LogConfigurationException: Class
> org.apache.commons.logging.impl.Log4JCategoryLog does not implement Log
> at
> org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:530)
> at
> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:285)
> at
> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:255)
> at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:382) at
> org.apache.cactus.server.ServletTestRedirector.around112_doGet
This seems to be a pretty common error with Commons-Logging, but I've
never encountered it myself yet.
Normally the Tomcat 4.1 distribution contains Commons-Logging:
common/lib
commons-logging-api.jar
server/lib
commons-logging.jar
Is this the layout used by the Tomcat version you're using? Which exact
version of Tomcat 4.1 are you using?
-chris
Re: runservertests
Posted by Barbara Allori <ba...@akros.it>.
At 11.26 07/03/2003 +0100, you wrote:
>Hello Barbara,
>
>Barbara Allori wrote:
>>Hello,
>> I am a new Italian user.
>>I am getting a LogConfigurationException when trying to run a servlet test:
>>org.apache.commons.logging.LogConfigurationException:
>>java.lang.reflect.InvocationTargetException at
>>org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:509)
>>at
>>org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:285)
>>at
>>org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:255)
>>at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:381)
>
>I assume this exception is thrown on the server side?
Yes
>>I'm using Tomcat 4.1 and Cactus 1.4.1; I have put the
>>commons-logging-1.0.jar in common/lib directory of Tomcat and also in the
>>web-inf/lib dir of my web application.
>
>Try with putting the Commons-Logging JAR *only* in WEB-INF/lib
This doesn't resolve the problem, because now the error is
The server encountered an internal error () that prevented it from
fulfilling this request.</u></p><p><b>exception</b>
<pre>org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: Class
org.apache.commons.logging.impl.Log4JCategoryLog does not implement Log at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:530)
at
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:285)
at
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:255)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:382) at
org.apache.cactus.server.ServletTestRedirector.around112_doGet
>-chris
Thanks Barbara
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: cactus-user-help@jakarta.apache.org
>
Cordiali Saluti,
Ing. Barbara Allori
Akros Informatica s.r.l
ballori@akros.it
Re: runservertests
Posted by Christopher Lenz <cm...@gmx.de>.
Hello Barbara,
Barbara Allori wrote:
> Hello,
> I am a new Italian user.
> I am getting a LogConfigurationException when trying to run a servlet test:
>
> org.apache.commons.logging.LogConfigurationException:
> java.lang.reflect.InvocationTargetException at
> org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:509)
> at
> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:285)
> at
> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:255)
> at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:381)
I assume this exception is thrown on the server side?
> I'm using Tomcat 4.1 and Cactus 1.4.1; I have put the
> commons-logging-1.0.jar in common/lib directory of Tomcat and also in
> the web-inf/lib dir of my web application.
Try with putting the Commons-Logging JAR *only* in WEB-INF/lib
> If I want to use the runservertests task with already running
> servers, how to is possible?
In that case, you don't need the <runservertests> task, the purpose of
which is just to start a server and stop it when some Ant target has
completed.
To run the tests on a running server, just use the plain <junit> task.
The Cactus test cases will take care of communicating with the server,
provided that you are specifying the required system properties.
> Thanks
> Barbara
>
>
-chris