Am Montag, 27. Mai 2002 12:14 schrieben Sie:
.....
yes html-mail is not a good idea - anyway an answer:
JBoss3RCx has introduced a new Classloader mechanism. This influenced loading
url protocol handler classes.
So DirContextHandler of Catalina will not be loaded and the url protocol
jndi: is not working. (in fact it is more complicated...)
Its not visible in stacktrace in your mail, but it seems to be this problem.
There should be an Malformed url exception: could not load url handler for
protocol jndi:
NOTE: this is true for embedded Catalina only.
What i done is a hack.
it registers the missing protocol in embedded catalina.
it does some other hackisch stuff...
Appended is a patch against rc3 code of jboss3. you have to compile this
beast - its not an easy job for normal cocoon users.
I sent this patch to jboss too. maybe somebody reviews that and its in the
next release. Request-ID is 561405.
Claas Thiele
--
Technological Strategy
VIRBUS AG
Fon +49(0)341-979-7430
Fax +49(0)341-979-7409
[EMAIL PROTECTED]
www.virbus.de
diff -rbBNU 3 /usr/local/devres/JBOSS/jboss-3.0.0RC2/src/jboss-all/catalina/build.xml jboss-all3.0.0RC2/catalina/build.xml
--- /usr/local/devres/JBOSS/jboss-3.0.0RC2/src/jboss-all/catalina/build.xml Fri Apr 26 18:37:33 2002
+++ jboss-all3.0.0RC2/catalina/build.xml Tue May 14 14:02:33 2002
@@ -146,6 +146,7 @@
<path id="tomcat.server.classpath">
<pathelement path="${tomcat.server.root}/bin/bootstrap.jar"/>
<pathelement path="${tomcat.server.root}/common/lib/servlet.jar"/>
+ <pathelement path="${tomcat.server.root}/common/lib/naming-resources.jar"/>
<pathelement path="${tomcat.server.root}/server/lib/catalina.jar"/>
<pathelement path="${tomcat.server.root}/server/lib/warp.jar"/>
</path>
diff -rbBNU 3 /usr/local/devres/JBOSS/jboss-3.0.0RC2/src/jboss-all/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSX.java jboss-all3.0.0RC2/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSX.java
--- /usr/local/devres/JBOSS/jboss-3.0.0RC2/src/jboss-all/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSX.java Fri Apr 26 08:31:06 2002
+++ jboss-all3.0.0RC2/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSX.java Tue May 14 16:51:58 2002
@@ -94,6 +94,8 @@
*/
private boolean useParentDelegation = true;
+ private String contextDir = null;
+
public EmbeddedCatalinaServiceSX()
{
}
@@ -146,10 +148,30 @@
this.extendedConfig = config;
}
+ public String getContextDir()
+ {
+ return this.contextDir;
+ }
+ public void setContextDir(String contextDir)
+ {
+ this.contextDir = contextDir;
+ }
+
public void startService() throws Exception
{
super.startService();
+ //registerurl handler for jndi protocol
+ String handlerPkgs = System.getProperty("java.protocol.handler.pkgs");
+ if (handlerPkgs != null) {
+ handlerPkgs += "|org.jboss.web.catalina.net";
+ }
+ else {
+ handlerPkgs = "org.jboss.web.catalina.net";
+ }
+ System.setProperty("java.protocol.handler.pkgs", handlerPkgs);
+
+
// Start create the embeded catalina container but don't let it overwrite the thread class loader
ClassLoader cl = Thread.currentThread().getContextClassLoader();
ClassLoader parent = cl;
@@ -218,7 +240,12 @@
}
log.info("deploy, ctxPath="+ctxPath+", warUrl="+warUrl);
- URL url = new URL(warUrl);
+ URL url = null;
+ if (contextDir != null) {
+ File cDir = new File(contextDir);
+ url = cDir.toURL();
+ } else {
+ url = new URL(warUrl);
// Catalina needs a war in a dir so extract the nested war
if( url.getProtocol().equals("njar") )
{
@@ -234,6 +261,7 @@
warStream.close();
log.debug("Unpacked war into dir: "+warDir);
url = warDir.toURL();
+ }
}
createWebContext(appInfo, url, webAppParser);
log.debug("Initialized: "+appInfo);
diff -rbBNU 3 /usr/local/devres/JBOSS/jboss-3.0.0RC2/src/jboss-all/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSXMBean.java jboss-all3.0.0RC2/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSXMBean.java
--- /usr/local/devres/JBOSS/jboss-3.0.0RC2/src/jboss-all/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSXMBean.java Fri Apr 26 08:31:06 2002
+++ jboss-all3.0.0RC2/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSXMBean.java Tue May 14 16:49:16 2002
@@ -53,4 +53,7 @@
rather than the servlet 2.3 load from war first model
*/
public void setJava2ClassLoadingCompliance(boolean compliance);
+
+ public void setContextDir(String contextDir);
+ public String getContextDir();
}
diff -rbBNU 3 /usr/local/devres/JBOSS/jboss-3.0.0RC2/src/jboss-all/catalina/src/main/org/jboss/web/catalina/net/jndi/Handler.java jboss-all3.0.0RC2/catalina/src/main/org/jboss/web/catalina/net/jndi/Handler.java
--- /usr/local/devres/JBOSS/jboss-3.0.0RC2/src/jboss-all/catalina/src/main/org/jboss/web/catalina/net/jndi/Handler.java Thu Jan 1 01:00:00 1970
+++ jboss-all3.0.0RC2/catalina/src/main/org/jboss/web/catalina/net/jndi/Handler.java Tue May 14 10:25:50 2002
@@ -0,0 +1,21 @@
+/*
+ * Handler.java
+ *
+ * Created on 14. Mai 2002, 10:20
+ */
+
+package org.jboss.web.catalina.net.jndi;
+
+import org.apache.naming.resources.DirContextURLStreamHandler;
+
+/**
+ *
+ * @author cthiele
+ */
+public class Handler extends DirContextURLStreamHandler {
+
+ /** Creates a new instance of Handler */
+ public Handler() {
+ }
+
+}
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>