3

I have a SOAP based webservice being implemented in Netbeans.I have some issues on the server side and its giving me Error 500, the internal error, since I can't debug it automatically its telling me to check out logs but my catalina.out is full of this code:

     Aug 20, 2011 11:01:32 PM org.apache.catalina.realm.CombinedRealm startInternal
        SEVERE: Failed to start "org.apache.catalina.realm.UserDatabaseRealm/1.0" realm
        org.apache.catalina.LifecycleException: No UserDatabase component found under key UserDatabase
            at org.apache.catalina.realm.UserDatabaseRealm.startInternal(UserDatabaseRealm.java:264)
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
            at org.apache.catalina.realm.CombinedRealm.startInternal(CombinedRealm.java:201)
            at org.apache.catalina.realm.LockOutRealm.startInternal(LockOutRealm.java:120)
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
            at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1026)
            at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
            at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
            at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
            at org.apache.catalina.startup.Catalina.start(Catalina.java:620)
            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:303)
            at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)
        Aug 20, 2011 11:01:32 PM org.apache.catalina.startup.HostConfig deployWAR
        INFO: Deploying web application archive soap.war
        Aug 20, 2011 11:01:33 PM org.apache.catalina.startup.HostConfig deployDirectory
        INFO: Deploying web application directory manager
        Aug 20, 2011 11:01:34 PM org.apache.catalina.startup.HostConfig deployDirectory
        INFO: Deploying web application directory examples
        Aug 20, 2011 11:01:35 PM org.apache.catalina.startup.HostConfig deployDirectory
        INFO: Deploying web application directory ROOT
        Aug 20, 2011 11:01:35 PM org.apache.catalina.startup.HostConfig deployDirectory
        INFO: Deploying web application directory host-manager
        Aug 20, 2011 11:01:36 PM org.apache.catalina.startup.HostConfig deployDirectory
        INFO: Deploying web application directory docs
        Aug 20, 2011 11:01:37 PM org.apache.catalina.startup.HostConfig deployDirectory
        INFO: Deploying web application directory axis
        - Unable to find config file.  Creating new servlet engine config file: /WEB-INF/server-config.wsdd
        Aug 20, 2011 11:01:39 PM org.apache.coyote.AbstractProtocolHandler start
        INFO: Starting ProtocolHandler ["http-bio-8080"]
        Aug 20, 2011 11:01:39 PM org.apache.coyote.AbstractProtocolHandler start
        INFO: Starting ProtocolHandler ["ajp-bio-8009"]
        Aug 20, 2011 11:01:39 PM org.apache.catalina.startup.Catalina start
        INFO: Server startup in 7851 ms

basically its full of the same code and only shows up when i startup or shutdown my Tomcat nothing useful which could lead me to as to why its giving me Error 500. Could somebody please tell me what could possibly be causing

      org.apache.catalina.realm.CombinedRealm startInterna

Thanks alot in advance.

This is the part of server.xml which i changed to give it values according to my DB its password etc.

                 <GlobalNamingResources>
        <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
        -->
        <Resource name="NeuroJDBC" auth="Container"
              type="javax.sql.Datasource"
            driverClassName="com.mysql.jdbc.Driver"
            password="alpbra"
            maxIdle="2"
            maxWait="5000"
            removeAbandoned="true"
            removedTimeout="60"
            username="root"
            url="jdbc:mysql://localhost:3306/NeuroDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
      </GlobalNamingResources>
rosa
  • 55
  • 2
  • 6

2 Answers2

1

In my case Tomcat was failing to restart and thrown same message. But problem was in POM.xml I mentioned JAVA version as 1.8 and code was compiled on JDK 1.8. But in server JDK installed was 1.7. Changing version and creating war file compiled on JDK1.7 fixed my problem. Hope this may help someone

<properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.7</java.version>
</properties>
Mahesh S
  • 41
  • 2
0

see this link http://tomcat.apache.org/tomcat-5.5-doc/config/realm.html (or realm docs for your tomcat version if you're not using tomcat 5). From the stacktrace it seems you have a configuration problem around realm.

Error in stacktrace: No UserDatabase component found under key UserDatabase

In your $CATALINA_HOME/conf/server.xml can you try changing

<Resource name="NeuroJDBC" auth="Container"

to

<Resource name="UserDatabase" auth="Container"
eon
  • 1,908
  • 2
  • 21
  • 33
  • Its pretty strange because, i have no DB connection issues! Everything is working perfectly, i need Catalina.out so i can see what is going wrong when the Server side of the webservice gives me Error 500. I configured server.xml according to an online guide, Should i post its contents? Thanks for the link and the reply. – rosa Aug 20 '11 at 22:58
  • yes post it, especially anything you editted. As an aside you could also try using a fresh install of tomcat again and see what happens – eon Aug 20 '11 at 23:03
  • I just edited the original question, adding the part of server.xml i changed. – rosa Aug 20 '11 at 23:09
  • I just changed it, gives me the usual error in catalina.out but the webservice works without any issues.isnt catalina.out supposed to be giving outputs on the status of the webservice? I can't reinstall tomcat since it "might" mess up my configurations which i have put alot in making work. – rosa Aug 21 '11 at 01:14
  • was the webservice working before? also did you restart tomcat after making the change? – eon Aug 21 '11 at 01:22
  • Yes after the changes i restarted tomcat, as i said i have never confronted any issue such as DB connectivity or errors while performing queries on the DB. I needed catalina.out to debug the server side of my webservice.Apparently the error has something to do with authentication, i'll post here if i get lucky with figuring out the issue. Thanks for the help! seriously you guys are fantastic. – rosa Aug 21 '11 at 01:29
  • if you're interesting in debugging your webservice you can connect your IDE to the server, if you're running eclipse follow these steps to set up your debugger https://confluence.sakaiproject.org/display/BOOT/Debugging+Tomcat+Remotely+Using+Eclipse – eon Aug 21 '11 at 01:34
  • Im using Java Netbeans, the client side of the webservice can be debugged automatically but you never know what is going on in the server side, any error occurs and you have read each line carefully. – rosa Aug 21 '11 at 01:48
  • are you using System.out in your code or a logging library like log4j? using log4j you could write to your own log file – eon Aug 21 '11 at 02:31
  • @rosa let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/2702/discussion-between-eon-and-rosa) – eon Aug 21 '11 at 02:32