Classpath issues with embedded tomcat

2005-07-12 Thread Ryan LeCompte
Hello all,

 

I'm running embedded tomcat 5.5.9. Let's say that I have one version of
X.jar in my main classpath when I launch my embedded Tomcat, and also a
different version of X.jar in a deployed webapp under WEB-INF/lib. Is there
a way to force tomcat to use the X.jar version that it's in WEB-INF/lib and
NOT the one that's in the main classpath? The default class loading behavior
uses the X.jar in the main classpath and not the X.jar in WEB-INF/lib, which
is causing problems since the deployed webapp doesn't suppor the version of
X.jar that the parent classloader has already loaded. Any help is greatly
appreciated!

 

Thanks,

Ryan

 



Problem configuring context resource in embedded tomcat 5.5.9

2005-07-11 Thread Ryan LeCompte
Hello all,

 

I'm trying to manually configure a context resource using embedded Tomcat
5.5.9. I'm not sure if ordering is important in the code below, but perhaps
one of you could shed some light. I don't get any exceptions or anything,
but my webapp isn't able to find the resource. Here is the relevant code:

 

  // - BEGIN LOAD CUSTOM WEBAPPS


  try {

 // Configure JDBC data source.

 ContextResource ctxResource = new ContextResource();

 ctxResource.setName("jdbc/juddiDB");

 ctxResource.setAuth("Container");

 ctxResource.setType("javax.sql.DataSource"); 

 ctxResource.setProperty("maxActive", "100");

 ctxResource.setProperty("maxIdle", "30");

 ctxResource.setProperty("maxWait", "1");

 ctxResource.setProperty("user", "user");

 ctxResource.setProperty("password", "pass");

 ctxResource.setProperty("driverClassName",
"org.firebirdsql.jdbc.FBDriver");

 ctxResource.setProperty("url",
"jdbc:firebirdsql://localhost:3050/juddi?autoReconnect=true");

 ctxResource.setProperty("validationQuery", "select count(*) from
PUBLISHER");

 NamingResources namingResources = rootcontext.getNamingResources();

 namingResources.addResource(ctxResource);

 tomcat-user@jakarta.apache.org

 // Load and configure the UDDI registry webapp.

 Context ctx = this.embedded.createContext("/juddi", getPath() +
"/webapps/juddi");

 ctx.setPrivileged(true);

 this.host.addChild(ctx); // add context to host

 ctx.getNamingResources().addResource(ctxResource);

  } catch (Exception e) {

 e.printStackTrace();

  } 

  // - END LOAD CUSTOM WEBAPPS
---  

 

All of the above code is executed after the root context is created and
initialized, and before the embedded tomcat engine is started. Any ideas?

 

Thanks!

 

Ryan

 

 



ConcurrentModificationException in 5.0.27

2005-05-25 Thread Ryan LeCompte
We discovered what appears to be a bug regarding a
ConcurrentModificationException Tomcat 5.0.27. The problem arises when two
web apps are deployed that are trying to interact with each other in some
way. The exception isn't thrown when one of the web apps is taken out of the
loop. Here is the relevant error:

 

May 25, 2005 2:41:01 PM org.apache.jk.server.JkMain start

INFO: Jk running ID=0 time=10/131  config=C:\Program Files\Apache Software
Foundation\Tomcat 5.0\conf\jk2.properties

May 25, 2005 2:41:02 PM org.apache.coyote.http11.Http11Protocol start

INFO: Starting Coyote HTTP/1.1 on http-8441

May 25, 2005 2:41:02 PM org.apache.coyote.http11.Http11Protocol start

INFO: Starting Coyote HTTP/1.1 on http-8080

May 25, 2005 2:41:02 PM org.apache.coyote.tomcat5.MapperListener init

WARNING: Error registering contexts

java.util.ConcurrentModificationException

at java.util.HashMap$HashIterator.nextEntry(Unknown Source)

at java.util.HashMap$EntryIterator.next(Unknown Source)

at java.util.HashMap.putAllForCreate(Unknown Source)

at java.util.HashMap.clone(Unknown Source)

at
mx4j.server.DefaultMBeanRepository.clone(DefaultMBeanRepository.java:56)

at
mx4j.server.MBeanServerImpl.findMBeansByPattern(MBeanServerImpl.java:1603)

at
mx4j.server.MBeanServerImpl.queryObjectNames(MBeanServerImpl.java:1568)

at
mx4j.server.MBeanServerImpl.queryMBeans(MBeanServerImpl.java:1512)

at
org.apache.coyote.tomcat5.MapperListener.init(MapperListener.java:115)

at
org.apache.coyote.tomcat5.CoyoteConnector.start(CoyoteConnector.java:1537)

at
org.apache.catalina.core.StandardService.start(StandardService.java:489)

at
org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)

at org.apache.catalina.startup.Catalina.start(Catalina.java:556)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:284)

at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:422)

May 25, 2005 2:41:02 PM org.apache.catalina.startup.Catalina start

INFO: Server startup in 37674 ms

 

Regards,

Ryan

 



SSL mutual authentication problem with Tomcat5

2004-11-18 Thread Ryan LeCompte
Hello,
 
I'm trying to have a standalone Java client communicate via SSL with a
remote Tomcat5 server. I'm setting the two system properties for specifying
the SSL trust store path and trust store password. The client is able to
successfully communicate via SSL when Tomcat is configured to not require
client-side authentication (for example in tomcat the configuration
attribute 'clientAuth="false"' would be used). However, when I turn on this
attribute and require client-side authentication, the client fails to
communicate successfully with the Tomcat5 server. The following exception is
generated:
 
java.rmi.RemoteException: HTTP transport error: java.net.SocketException:
Software caused connection abort: recv failed; nested exception is: 
 HTTP transport error: java.net.SocketException: Software caused connection
abort: recv failed
 at  .
 
 
Is there anything else that must occur on the client side when the remote
web server requires a client-side certification authentication? I'm still
new to SSL, so perhaps I have the basic concept confused. Do I have to
import another certification in the client-side keystore for this to work? I
looked in the SSL HOW-TO but didn't find an answer to my question. I also
tried importing all of the certificates in the client keystore into the
"cacerts" file in JAVA_HOME/jre/lib/security/cacerts.
 
Here is the connector configuration for SSL in server.xml:
 




 

Thank you for any help that you may be able to provide.

-- Ryan