wood burning stoves 2.0*
The moose likes Tomcat and the fly likes JDBCRealm Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "JDBCRealm Problem" Watch "JDBCRealm Problem" New topic
Author

JDBCRealm Problem

hisham ragheb
Ranch Hand

Joined: Apr 14, 2008
Posts: 30
hi,

i have a tomcat exception rise when i change the realm type to JDBCRealm

the exception looks like that:




the <Realm> tag i modified in server.xml looks like that:




i use Java DB and placed derby-client.jar in lib directory of the server

when i comment my <Realm> definition above and uncomment the default realm definition of the server the server start normally and authenticate using the tomcat-user.xml entries as the default realm storage

what could be the problem???






SCJP 1.5 (94%), SCWCD 1.4 (91%), SCBCD 1.5 (95%)
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15947
    
  19

I don't see an obvious problem, but you're likely to get this error when something's missing from the XML in the Realm element or when the general server.xml file is invalid. Basically, the Digester it attempting to construct class objects and load attributes into them and it thinks that a critical item is missing.

You might be able to look at one of the other logfiles and find an additional message. If not, turn up the logging level on Tomcat for org.apache.tomcat.util.digester to the debug level. Actually, I thought Digester was just org.apache.digester, but to be really certain, log debug on org.apache in general.

The digester will cheerfully spit out tons of information, but included in the mix will be an indication of what was being processed when the error was encountered.


Customer surveys are for companies who didn't pay proper attention to begin with.
hisham ragheb
Ranch Hand

Joined: Apr 14, 2008
Posts: 30
Tim Holloway wrote:I don't see an obvious problem, but you're likely to get this error when something's missing from the XML in the Realm element or when the general server.xml file is invalid. Basically, the Digester it attempting to construct class objects and load attributes into them and it thinks that a critical item is missing.

You might be able to look at one of the other logfiles and find an additional message. If not, turn up the logging level on Tomcat for org.apache.tomcat.util.digester to the debug level. Actually, I thought Digester was just org.apache.digester, but to be really certain, log debug on org.apache in general.

The digester will cheerfully spit out tons of information, but included in the mix will be an indication of what was being processed when the error was encountered.


it seems there is no other useful more messages even if i widen the logging scope

but this is the full log message maybe it has somthing i cant notice:

Using CATALINA_BASE: C:\Documents and Settings\User\.netbeans\6.8\apache-tomcat-6.0.20_base
Using CATALINA_HOME: C:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.20
Using CATALINA_TMPDIR: C:\Documents and Settings\User\.netbeans\6.8\apache-tomcat-6.0.20_base\temp
Using JRE_HOME: C:\Program Files\Java\jdk1.6.0_17
Dec 20, 2009 6:27:36 AM org.apache.tomcat.util.digester.Digester startElement
SEVERE: Begin event threw exception
java.lang.NullPointerException
at sun.jkernel.DownloadManager.getBootClassPathEntryForClass(DownloadManager.java:928)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:293)
at java.lang.ClassLoader.loadClass(ClassLoader.java:296)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:205)
at org.apache.tomcat.util.digester.Rule.begin(Rule.java:153)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1358)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1339)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1644)
at org.apache.catalina.startup.Catalina.load(Catalina.java:521)
at org.apache.catalina.startup.Catalina.load(Catalina.java:555)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
Dec 20, 2009 6:27:36 AM org.apache.catalina.startup.Catalina load
WARNING: Catalina.start using conf/server.xml:
java.lang.NullPointerException
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2808)
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2834)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1361)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1339)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1644)
at org.apache.catalina.startup.Catalina.load(Catalina.java:521)
at org.apache.catalina.startup.Catalina.load(Catalina.java:555)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
Caused by: java.lang.NullPointerException
at sun.jkernel.DownloadManager.getBootClassPathEntryForClass(DownloadManager.java:928)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:293)
at java.lang.ClassLoader.loadClass(ClassLoader.java:296)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:205)
at org.apache.tomcat.util.digester.Rule.begin(Rule.java:153)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1358)
... 20 more
Dec 20, 2009 6:27:36 AM org.apache.tomcat.util.digester.Digester startElement
SEVERE: Begin event threw exception
java.lang.NullPointerException
at sun.jkernel.DownloadManager.getBootClassPathEntryForClass(DownloadManager.java:928)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:293)
at java.lang.ClassLoader.loadClass(ClassLoader.java:296)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:205)
at org.apache.tomcat.util.digester.Rule.begin(Rule.java:153)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1358)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1339)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1644)
at org.apache.catalina.startup.Catalina.load(Catalina.java:521)
at org.apache.catalina.startup.Catalina.start(Catalina.java:575)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Dec 20, 2009 6:27:36 AM org.apache.catalina.startup.Catalina load
WARNING: Catalina.start using conf/server.xml:
java.lang.NullPointerException
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2808)
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2834)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1361)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1339)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1644)
at org.apache.catalina.startup.Catalina.load(Catalina.java:521)
at org.apache.catalina.startup.Catalina.start(Catalina.java:575)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.NullPointerException
at sun.jkernel.DownloadManager.getBootClassPathEntryForClass(DownloadManager.java:928)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:293)
at java.lang.ClassLoader.loadClass(ClassLoader.java:296)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:205)
at org.apache.tomcat.util.digester.Rule.begin(Rule.java:153)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1358)
... 20 more
Dec 20, 2009 6:27:36 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(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.NullPointerException
at org.apache.catalina.startup.Catalina.await(Catalina.java:647)
at org.apache.catalina.startup.Catalina.start(Catalina.java:607)
... 6 more


please i need help so much..i tried this once before i even used the ssl but whats happening now is very bizarre..
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15947
    
  19

I think you need to crank up the log level on the Digester another notch. It should be able to display the actual name of the element being parsed. Maybe setting the SAX parser's log level to debug will help.

I've got a feeling that the information should already be there, but I'm just not seeing it. However, the Digester logging can be quite detailed, so when subtlety fails...
hisham ragheb
Ranch Hand

Joined: Apr 14, 2008
Posts: 30
Tim Holloway wrote:I think you need to crank up the log level on the Digester another notch. It should be able to display the actual name of the element being parsed. Maybe setting the SAX parser's log level to debug will help.

I've got a feeling that the information should already be there, but I'm just not seeing it. However, the Digester logging can be quite detailed, so when subtlety fails...


i noticed something i guess

when i removed jdk 1.6 update 17 and installed my older version 1.6 update 14 the server starts normally and things works fine

i tried to install update 17 again and the problem rises.

is it possible its a problem in the java update??

could you try it on your PC and check yourself

i'm waiting your response, its very important to me


regards
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15947
    
  19

Uh-oh.

Well, I can't say. I'm still running 1.6.02. Since it does the job and I'm not aware of any server-side security issues, I haven't felt the need to upgrade.

Do you actually need 1.6.17? Some releases are duds. You might be better off holding off until either 1.6.18 or later fixes it or it turns out to be a digester bug that gets repaired.

Except maybe in Solaris, you shouldn't actually need to uninstall older JDKs before installing newer ones (or vice versa).

I'd cross-check your problem, except that I can't spare the time to download 40+MB and restart my server just now.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JDBCRealm Problem
 
Similar Threads
ear
LifeCycleException & SQLException - connecting to mysql from tomcat with basic auth
No Realm has been configured to authenticate against
Problem with JMX Connector on Glassfish
JDBCRealm and the security-constraint Element in the web.xml File