tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcus Williford" <mwillif...@gmail.com>
Subject Re: Help with Creating my own Realm extending RealmBase, ClassNotFoundException issue
Date Wed, 15 Nov 2006 20:41:42 GMT
Send attempt #2.hmmm

On 11/14/06, Marcus Williford <mwilliford@gmail.com> wrote:
>
> I have attempted to create my own Realm, as I need to do authentication
> via a custom set of rules.  I have attempted several things ( hours of
> attempting this with no luck), and can't seem to get class loaded.
>
> Tomcat5.5.20
> Elcipse 3.2
>
> 1.  I've put something like this in my server.xml
> <Realm className="com.devmonkey.agent.TestRealm"/>   I've also tried
> className="TestRealm", etc....
>
> 2.  I've compiled TestRealm into a jar, along with a
> mbeans-descriptors.xml file.  Placed this into the
> CATALINA_HOME/server/lib as a .jar file.  I have tried every angle on the
> name, placement.  I've put the class directly in the
> CATALINA_HOME/server/classes.  I've deleted the .class files on my
> webapp/classes directory to make sure there is only a single copy.
>
> 3.  TestRealm was extended from UserDatabaseRealm as a test "public class
> TestRealm extends UserDatabaseRealm"
>
> 4.  I also attempted to extend RealmBase, override the correct classes,
> etc...
>
> 5.  I get the following, no matter what I do!
>
> Nov 14, 2006 2:56:13 AM org.apache.tomcat.util.digester.Digester
> startElement
> SEVERE: Begin event threw exception
> java.lang.ClassNotFoundException : com.devmonkey.agent.TestRealm
>     at java.net.URLClassLoader$1.run(Unknown Source)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(Unknown Source)
>     at java.lang.ClassLoader.loadClass (Unknown Source)
>     at java.lang.ClassLoader.loadClass(Unknown Source)
>     at org.apache.tomcat.util.digester.ObjectCreateRule.begin(
> ObjectCreateRule.java:204)
>     at org.apache.tomcat.util.digester.Rule.begin( Rule.java :152)
>     at org.apache.tomcat.util.digester.Digester.startElement(Digester.java
> :1275)
>     at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown
> Source)
>     at
> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
> Source)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
>     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
>     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
>     at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
> Source)
>     at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
>     at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
>     at org.apache.catalina.startup.Catalina.load(Catalina.java:489)
>     at org.apache.catalina.startup.Catalina.load(Catalina.java :523)
>     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.load(Bootstrap.java:266)
>     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)
> Nov 14, 2006 2:56:13 AM org.apache.catalina.startup.Catalina load
> WARNING: Catalina.start using conf/server.xml:
> java.lang.ClassNotFoundException: com.devmonkey.agent.TestRealm
>     at org.apache.tomcat.util.digester.Digester.createSAXException (
> Digester.java:2725)
>     at org.apache.tomcat.util.digester.Digester.createSAXException(
> Digester.java:2751)
>     at org.apache.tomcat.util.digester.Digester.startElement(Digester.java
> :1278)
>     at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
>     at
> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
> Source)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
>     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
>     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
>     at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse (Unknown
> Source)
>     at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
> Source)
>     at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
>     at org.apache.catalina.startup.Catalina.load (Catalina.java:489)
>     at org.apache.catalina.startup.Catalina.load(Catalina.java:523)
>     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.load(Bootstrap.java:266)
>     at org.apache.catalina.startup.Bootstrap.main (Bootstrap.java:431)
> Nov 14, 2006 2:56:13 AM org.apache.tomcat.util.digester.DigesterstartElement
> SEVERE: Begin event threw exception
> java.lang.ClassNotFoundException: com.devmonkey.agent.TestRealm
>     at java.net.URLClassLoader$1.run (Unknown Source)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(Unknown Source)
>     at java.lang.ClassLoader.loadClass(Unknown Source)
>     at java.lang.ClassLoader.loadClass (Unknown Source)
>     at org.apache.tomcat.util.digester.ObjectCreateRule.begin(
> ObjectCreateRule.java:204)
>     at org.apache.tomcat.util.digester.Rule.begin(Rule.java:152)
>     at org.apache.tomcat.util.digester.Digester.startElement (
> Digester.java:1275)
>     at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown
> Source)
>     at
> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
> Source)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
> Source)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
>     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
>     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
>     at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
> Source)
>     at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
>     at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
>     at org.apache.catalina.startup.Catalina.load(Catalina.java:489)
>     at org.apache.catalina.startup.Catalina.start(Catalina.java :543)
>     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:294)
>     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
> Nov 14, 2006 2:56:13 AM org.apache.catalina.startup.Catalina load
> WARNING: Catalina.start using conf/server.xml:
> java.lang.ClassNotFoundException: com.devmonkey.agent.TestRealm
>     at org.apache.tomcat.util.digester.Digester.createSAXException (
> Digester.java:2725)
>     at org.apache.tomcat.util.digester.Digester.createSAXException(
> Digester.java:2751)
>     at org.apache.tomcat.util.digester.Digester.startElement(Digester.java
> :1278)
>     at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
>     at
> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
> Source)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
>     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
>     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
>     at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse (Unknown
> Source)
>     at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
> Source)
>     at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
>     at org.apache.catalina.startup.Catalina.load (Catalina.java:489)
>     at org.apache.catalina.startup.Catalina.start(Catalina.java:543)
>     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:294)
>     at org.apache.catalina.startup.Bootstrap.main (Bootstrap.java:432)
> Nov 14, 2006 2:56:13 AM org.apache.catalina.startup.Catalina start
> INFO: Server startup in 0 ms
> java.lang.reflect.InvocationTargetException
>     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:294)
>     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
> Caused by: java.lang.NullPointerException
>     at org.apache.catalina.startup.Catalina.await (Catalina.java:615)
>     at org.apache.catalina.startup.Catalina.start(Catalina.java:575)
>     ... 6 more
>
> 6.  I am starting to suspect that
> java.security.AccessController.doPrivileged has something to do with it,
> as I don't know if it is in the classpath for tomcat, but I'm not sure how I
> can troubleshoot this further.
>
> Please assist!
>
> mw
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message