Results 1 to 20 of 33
Thread: HTTP Status 500 - JBoss
- 02-01-2013, 10:06 PM #1
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
HTTP Status 500 - JBoss
Hello!
I created a dynamic web project in eclipse and need it to run with JBoss.
The version of Jboss I am using is JBoss.4.2.3 (I tried later versions but got the same error).
The java code is :
ImageServerServlet.java
the web.xml file is:Java Code:package com.javasrc.webphotogallery.web; // Import the JNDI classes import java.io.*; import javax.naming.*; // Import the Servlet classes import javax.servlet.*; import javax.servlet.http.*; // Import our database classes import java.sql.*; import javax.sql.*; /** * Returns the requested JPG from the database; input parameters are: * * @param imageid The id of the image to return * @param size "full" or "thumbnail", default is "full" */ public class ImageServerServlet extends HttpServlet { /** * Cache a reference to the datasource object that we will use later to obtain * a connection to the database */ private transient DataSource datasource = null; public void init() throws ServletException { try { InitialContext ic = new InitialContext(); this.datasource = ( DataSource )ic.lookup( "java:/WebPhotoGalleryDS" ); } catch( Exception e ) { throw new ServletException( e ); } } public void service( HttpServletRequest req, HttpServletResponse res ) throws ServletException { String imageIdStr = req.getParameter( "imageid" ); if( imageIdStr == null ) { throw new ServletException( "Image Id Required" ); } boolean fullImage = true; String size = req.getParameter( "size" ); if( size != null && size.equalsIgnoreCase( "thumbnail" ) ) { fullImage = false; } Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; try { // Get a datbase connection conn = getDBConnection(); // Build a Prepared Statement if( fullImage ) { ps = conn.prepareStatement( "SELECT image_full FROM Image WHERE image_id = ?" ); } else { ps = conn.prepareStatement( "SELECT image_thumb FROM Image WHERE image_id = ?" ); } ps.setInt( 1, Integer.parseInt( imageIdStr ) ); // Execute the query rs = ps.executeQuery(); if( !rs.next() ) { throw new ServletException( "There is no image defined with id: " + imageIdStr ); } // Get the image Blob from the database Blob blob = rs.getBlob( 1 ); InputStream in = blob.getBinaryStream(); // Output the blob to the HttpServletResponse res.setContentType( "image/jpeg" ); BufferedOutputStream out = new BufferedOutputStream( res.getOutputStream() ); byte by[] = new byte[ 32768 ]; int index = in.read( by, 0, 32768 ); while ( index != -1 ) { out.write( by, 0, index ); index = in.read( by, 0, 32768 ); } out.flush(); } catch( Exception e ) { e.printStackTrace(); throw new ServletException( e ); } finally { try { if( rs != null ) rs.close(); if( ps != null ) ps.close(); if( conn != null ) conn.close(); } catch( SQLException sqlee ){} } } protected Connection getDBConnection() { try { return datasource.getConnection(); } catch( SQLException se ) { se.printStackTrace(); } return null; } }
When i go to http://localhost:8080/webphotogallery/image?imageid=1 i get this error:Java Code:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'> <web-app> <servlet> <servlet-name>ImageServerServlet</servlet-name> <servlet-class>com.javasrc.webphotogallery.web.ImageServerServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>ImageServerServlet</servlet-name> <url-pattern>/image</url-pattern> </servlet-mapping> </web-app>
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Class com.javasrc.webphotogallery.web.ImageServerServlet is not a Servlet
org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:182)
org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:84)
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
org.jboss.web.tomcat.service.jca.CachedConnectionV alve.invoke(CachedConnectionValve.java:157)
org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:262)
org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:844)
org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:446)
java.lang.Thread.run(Thread.java:722)
root cause
java.lang.ClassCastException: com.javasrc.webphotogallery.web.ImageServerServlet cannot be cast to javax.servlet.Servlet
org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:182)
org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:84)
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
org.jboss.web.tomcat.service.jca.CachedConnectionV alve.invoke(CachedConnectionValve.java:157)
org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:262)
org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:844)
org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:446)
java.lang.Thread.run(Thread.java:722)
note The full stack trace of the root cause is available in the JBossWeb/2.0.1.GA logs.
JBossWeb/2.0.1.GA
- 02-01-2013, 11:24 PM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,609
- Rep Power
- 5
Re: HTTP Status 500 - JBoss
While I cannot speculate as to whether this is the reason for the exception, I do recommend reading the API for HttpServlet...in particular the sentence that says "There's almost no reason to override the service method" - any reason why you are overriding the service method rather than the other methods recommended in the API?
Edit: Thread moved from New To Java
- 02-02-2013, 04:49 PM #3
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
Re: HTTP Status 500 - JBoss
After i build correctly the .war file and copied it in the deploy folder of Jboss I get this error ...
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: java.lang.NullPointerException
com.javasrc.webphotogallery.web.ImageServerServlet .service(ImageServerServlet.java:102)
javax.servlet.http.HttpServlet.service(HttpServlet .java:847)
root cause
java.lang.NullPointerException
com.javasrc.webphotogallery.web.ImageServerServlet .service(ImageServerServlet.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet .java:847)
note The full stack trace of the root cause is available in the JBoss Web/3.0.0-CR1 logs.
- 02-02-2013, 08:21 PM #4
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,609
- Rep Power
- 5
Re: HTTP Status 500 - JBoss
Something is null. My advice - read my first post up there, which you have yet to acknowledge. Then, go to the lines of code that the stack trace points to and add some debug lines in your code to determine what could be null.
- 02-02-2013, 08:27 PM #5
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
Re: HTTP Status 500 - JBoss
I tried but i can't resolve it....
- 02-03-2013, 12:55 AM #6
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,609
- Rep Power
- 5
Re: HTTP Status 500 - JBoss
If you did as I suggested in post #4, you would know which variable is null...so which one is it? Or do you want us to guess? OK, I'll bite - your conn variable is null (presuming the line numbers of the stack trace match up to the code you posted). So you should ask yourself, where is it instantiated? Do you handle your exceptions appropriately/check the logs so you know whether one is thrown, and what it actually is?
- 02-03-2013, 08:37 PM #7
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
Re: HTTP Status 500 - JBoss
Ok...I tried to build all my project...which means all my .java , .jsp and .html files that need to create my webphotoalbum ....
The problem i get at this point is related to the db connection...
The error says:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: com.javasrc.webphotogallery.dao.AlbumDAOException: SQL Exception while getting DB connection :
org.jboss.util.NestedSQLException: Unable to get managed connection for WebPhotoGalleryDS; - nested throwable: (javax.resource.ResourceException: Unable to get managed connection for WebPhotoGalleryDS)
com.javasrc.webphotogallery.web.AdminServlet.servi ce(AdminServlet.java:127)
javax.servlet.http.HttpServlet.service(HttpServlet .java:847)
root cause
com.javasrc.webphotogallery.dao.AlbumDAOException: SQL Exception while getting DB connection :
org.jboss.util.NestedSQLException: Unable to get managed connection for WebPhotoGalleryDS; - nested throwable: (javax.resource.ResourceException: Unable to get managed connection for WebPhotoGalleryDS)
com.javasrc.webphotogallery.dao.AlbumDAOImpl.getDB Connection(AlbumDAOImpl.java:265)
com.javasrc.webphotogallery.dao.AlbumDAOImpl.findA ll(AlbumDAOImpl.java:226)
com.javasrc.webphotogallery.web.AdminServlet.servi ce(AdminServlet.java:51)
javax.servlet.http.HttpServlet.service(HttpServlet .java:847)
note The full stack trace of the root cause is available in the JBoss Web/3.0.0-CR1 logs.
I checked the log file and here it is:
2013-02-03 19:58:44,734 INFO [STDOUT] (http-127.0.0.1-8080-2) Admin cmd: root
2013-02-03 19:58:44,734 INFO [STDOUT] (http-127.0.0.1-8080-2) Dumping Request Parameters
2013-02-03 19:58:44,805 INFO [STDOUT] (http-127.0.0.1-8080-2) Admin cmd: listalbums
2013-02-03 19:58:44,805 INFO [STDOUT] (http-127.0.0.1-8080-2) Dumping Request Parameters
2013-02-03 19:58:44,806 INFO [STDOUT] (http-127.0.0.1-8080-2) cmd = [Ljava.lang.String;@654408ed
2013-02-03 19:58:44,807 WARN [org.jboss.resource.connectionmanager.JBossManagedC onnectionPool] (http-127.0.0.1-8080-2) Throwable while attempting to get a new connection: null: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: org.gjt.mm.mysql.Driver; - nested throwable: (java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver))
at org.jboss.resource.adapter.jdbc.local.LocalManaged ConnectionFactory.getLocalManagedConnection(LocalM anagedConnectionFactory.java:261) [:6.0.0.Final]
at org.jboss.resource.adapter.jdbc.local.LocalManaged ConnectionFactory.createManagedConnection(LocalMan agedConnectionFactory.java:215) [:6.0.0.Final]
at org.jboss.resource.connectionmanager.InternalManag edConnectionPool.createConnectionEventListener(Int ernalManagedConnectionPool.java:648) [:6.0.0.Final]
at org.jboss.resource.connectionmanager.InternalManag edConnectionPool.getConnection(InternalManagedConn ectionPool.java:272) [:6.0.0.Final]
at org.jboss.resource.connectionmanager.JBossManagedC onnectionPool$BasePool.getConnection(JBossManagedC onnectionPool.java:690) [:6.0.0.Final]
at org.jboss.resource.connectionmanager.BaseConnectio nManager2.getManagedConnection(BaseConnectionManag er2.java:403) [:6.0.0.Final]
at org.jboss.resource.connectionmanager.TxConnectionM anager.getManagedConnection(TxConnectionManager.ja va:414) [:6.0.0.Final]
at org.jboss.resource.connectionmanager.BaseConnectio nManager2.allocateConnection(BaseConnectionManager 2.java:496) [:6.0.0.Final]
at org.jboss.resource.connectionmanager.BaseConnectio nManager2$ConnectionManagerProxy.allocateConnectio n(BaseConnectionManager2.java:941) [:6.0.0.Final]
at org.jboss.resource.adapter.jdbc.WrapperDataSource. getConnection(WrapperDataSource.java:89) [:6.0.0.Final]
at com.javasrc.webphotogallery.dao.AlbumDAOImpl.getDB Connection(AlbumDAOImpl.java:261) [:]
at com.javasrc.webphotogallery.dao.AlbumDAOImpl.findA ll(AlbumDAOImpl.java:226) [:]
at com.javasrc.webphotogallery.web.AdminServlet.servi ce(AdminServlet.java:51) [:]
at javax.servlet.http.HttpServlet.service(HttpServlet .java:847) [:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:242) [:6.0.0.Final]
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:275) [:6.0.0.Final]
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
at org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:88) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityContextEstab lishmentValve.invoke(SecurityContextEstablishmentV alve.java:100) [:6.0.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127) [:6.0.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102) [:6.0.0.Final]
at org.jboss.web.tomcat.service.jca.CachedConnectionV alve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109) [:6.0.0.Final]
at org.jboss.web.tomcat.service.request.ActiveRequest ResponseCacheValve.invoke(ActiveRequestResponseCac heValve.java:53) [:6.0.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:362) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:877) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:654) [:6.0.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:951) [:6.0.0.Final]
at java.lang.Thread.run(Thread.java:722) [:1.7.0_03]
Caused by: org.jboss.resource.JBossResourceException: Failed to register driver for: org.gjt.mm.mysql.Driver; - nested throwable: (java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver)
at org.jboss.resource.adapter.jdbc.local.LocalManaged ConnectionFactory.getDriver(LocalManagedConnection Factory.java:538) [:6.0.0.Final]
at org.jboss.resource.adapter.jdbc.local.LocalManaged ConnectionFactory.getLocalManagedConnection(LocalM anagedConnectionFactory.java:228) [:6.0.0.Final]
... 32 more
Caused by: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java: 366) [:1.7.0_03]
at java.net.URLClassLoader$1.run(URLClassLoader.java: 355) [:1.7.0_03]
at java.security.AccessController.doPrivileged(Native Method) [:1.7.0_03]
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:354) [:1.7.0_03]
at java.lang.ClassLoader.loadClass(ClassLoader.java:4 23) [:1.7.0_03]
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 56) [:1.7.0_03]
at java.lang.Class.forName0(Native Method) [:1.7.0_03]
at java.lang.Class.forName(Class.java:264) [:1.7.0_03]
at org.jboss.resource.adapter.jdbc.local.LocalManaged ConnectionFactory.getDriver(LocalManagedConnection Factory.java:523) [:6.0.0.Final]
... 33 more
2013-02-03 19:58:44,817 ERROR [STDERR] (http-127.0.0.1-8080-2) com.javasrc.webphotogallery.dao.AlbumDAOException: SQL Exception while getting DB connection :
2013-02-03 19:58:44,818 ERROR [STDERR] (http-127.0.0.1-8080-2) org.jboss.util.NestedSQLException: Unable to get managed connection for WebPhotoGalleryDS; - nested throwable: (javax.resource.ResourceException: Unable to get managed connection for WebPhotoGalleryDS)
2013-02-03 19:58:44,819 ERROR [STDERR] (http-127.0.0.1-8080-2) at com.javasrc.webphotogallery.dao.AlbumDAOImpl.getDB Connection(AlbumDAOImpl.java:265)
2013-02-03 19:58:44,824 ERROR [STDERR] (http-127.0.0.1-8080-2) at com.javasrc.webphotogallery.dao.AlbumDAOImpl.findA ll(AlbumDAOImpl.java:226)
2013-02-03 19:58:44,824 ERROR [STDERR] (http-127.0.0.1-8080-2) at com.javasrc.webphotogallery.web.AdminServlet.servi ce(AdminServlet.java:51)
2013-02-03 19:58:44,825 ERROR [STDERR] (http-127.0.0.1-8080-2) at javax.servlet.http.HttpServlet.service(HttpServlet .java:847)
2013-02-03 19:58:44,825 ERROR [STDERR] (http-127.0.0.1-8080-2) at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:324)
2013-02-03 19:58:44,826 ERROR [STDERR] (http-127.0.0.1-8080-2) at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:242)
2013-02-03 19:58:44,826 ERROR [STDERR] (http-127.0.0.1-8080-2) at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:275)
2013-02-03 19:58:44,827 ERROR [STDERR] (http-127.0.0.1-8080-2) at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
2013-02-03 19:58:44,827 ERROR [STDERR] (http-127.0.0.1-8080-2) at org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:181)
2013-02-03 19:58:44,828 ERROR [STDERR] (http-127.0.0.1-8080-2) at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.event(CatalinaContext.java:285)
2013-02-03 19:58:44,829 ERROR [STDERR] (http-127.0.0.1-8080-2) at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.invoke(CatalinaContext.java:261)
2013-02-03 19:58:44,830 ERROR [STDERR] (http-127.0.0.1-8080-2) at org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:88)
2013-02-03 19:58:44,831 ERROR [STDERR] (http-127.0.0.1-8080-2) at org.jboss.web.tomcat.security.SecurityContextEstab lishmentValve.invoke(SecurityContextEstablishmentV alve.java:100)
2013-02-03 19:58:44,831 ERROR [STDERR] (http-127.0.0.1-8080-2) at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127)
2013-02-03 19:58:44,832 ERROR [STDERR] (http-127.0.0.1-8080-2) at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
2013-02-03 19:58:44,832 ERROR [STDERR] (http-127.0.0.1-8080-2) at org.jboss.web.tomcat.service.jca.CachedConnectionV alve.invoke(CachedConnectionValve.java:158)
2013-02-03 19:58:44,833 ERROR [STDERR] (http-127.0.0.1-8080-2) at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
2013-02-03 19:58:44,834 ERROR [STDERR] (http-127.0.0.1-8080-2) at org.jboss.web.tomcat.service.request.ActiveRequest ResponseCacheValve.invoke(ActiveRequestResponseCac heValve.java:53)
2013-02-03 19:58:44,835 ERROR [STDERR] (http-127.0.0.1-8080-2) at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:362)
2013-02-03 19:58:44,835 ERROR [STDERR] (http-127.0.0.1-8080-2) at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:877)
2013-02-03 19:58:44,836 ERROR [STDERR] (http-127.0.0.1-8080-2) at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:654)
2013-02-03 19:58:44,836 ERROR [STDERR] (http-127.0.0.1-8080-2) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:951)
2013-02-03 19:58:44,836 ERROR [STDERR] (http-127.0.0.1-8080-2) at java.lang.Thread.run(Thread.java:722)
2013-02-03 19:58:44,838 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/webphotogallery].[AdminServlet]] (http-127.0.0.1-8080-2) Servlet.service() for servlet AdminServlet threw exception: com.javasrc.webphotogallery.dao.AlbumDAOException: SQL Exception while getting DB connection :
org.jboss.util.NestedSQLException: Unable to get managed connection for WebPhotoGalleryDS; - nested throwable: (javax.resource.ResourceException: Unable to get managed connection for WebPhotoGalleryDS)
at com.javasrc.webphotogallery.dao.AlbumDAOImpl.getDB Connection(AlbumDAOImpl.java:265) [:]
at com.javasrc.webphotogallery.dao.AlbumDAOImpl.findA ll(AlbumDAOImpl.java:226) [:]
at com.javasrc.webphotogallery.web.AdminServlet.servi ce(AdminServlet.java:51) [:]
at javax.servlet.http.HttpServlet.service(HttpServlet .java:847) [:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:242) [:6.0.0.Final]
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:275) [:6.0.0.Final]
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
at org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:88) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityContextEstab lishmentValve.invoke(SecurityContextEstablishmentV alve.java:100) [:6.0.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127) [:6.0.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102) [:6.0.0.Final]
at org.jboss.web.tomcat.service.jca.CachedConnectionV alve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109) [:6.0.0.Final]
at org.jboss.web.tomcat.service.request.ActiveRequest ResponseCacheValve.invoke(ActiveRequestResponseCac heValve.java:53) [:6.0.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:362) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:877) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:654) [:6.0.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:951) [:6.0.0.Final]
at java.lang.Thread.run(Thread.java:722) [:1.7.0_03]
2013-02-03 19:58:52,544 INFO [STDOUT] (http-127.0.0.1-8080-4) Admin cmd: root
2013-02-03 19:58:52,546 INFO [STDOUT] (http-127.0.0.1-8080-4) Dumping Request Parameters
2013-02-03 19:58:52,615 INFO [STDOUT] (http-127.0.0.1-8080-4) Admin cmd: listalbums
2013-02-03 19:58:52,616 INFO [STDOUT] (http-127.0.0.1-8080-4) Dumping Request Parameters
2013-02-03 19:58:52,616 INFO [STDOUT] (http-127.0.0.1-8080-4) cmd = [Ljava.lang.String;@31954d0
2013-02-03 19:58:52,617 WARN [org.jboss.resource.connectionmanager.JBossManagedC onnectionPool] (http-127.0.0.1-8080-4) Throwable while attempting to get a new connection: null: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: org.gjt.mm.mysql.Driver; - nested throwable: (java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver))
at org.jboss.resource.adapter.jdbc.local.LocalManaged ConnectionFactory.getLocalManagedConnection(LocalM anagedConnectionFactory.java:261) [:6.0.0.Final]
at org.jboss.resource.adapter.jdbc.local.LocalManaged ConnectionFactory.createManagedConnection(LocalMan agedConnectionFactory.java:215) [:6.0.0.Final]
at org.jboss.resource.connectionmanager.InternalManag edConnectionPool.createConnectionEventListener(Int ernalManagedConnectionPool.java:648) [:6.0.0.Final]
at org.jboss.resource.connectionmanager.InternalManag edConnectionPool.getConnection(InternalManagedConn ectionPool.java:272) [:6.0.0.Final]
at org.jboss.resource.connectionmanager.JBossManagedC onnectionPool$BasePool.getConnection(JBossManagedC onnectionPool.java:690) [:6.0.0.Final]
at org.jboss.resource.connectionmanager.BaseConnectio nManager2.getManagedConnection(BaseConnectionManag er2.java:403) [:6.0.0.Final]
at org.jboss.resource.connectionmanager.TxConnectionM anager.getManagedConnection(TxConnectionManager.ja va:414) [:6.0.0.Final]
at org.jboss.resource.connectionmanager.BaseConnectio nManager2.allocateConnection(BaseConnectionManager 2.java:496) [:6.0.0.Final]
at org.jboss.resource.connectionmanager.BaseConnectio nManager2$ConnectionManagerProxy.allocateConnectio n(BaseConnectionManager2.java:941) [:6.0.0.Final]
at org.jboss.resource.adapter.jdbc.WrapperDataSource. getConnection(WrapperDataSource.java:89) [:6.0.0.Final]
at com.javasrc.webphotogallery.dao.AlbumDAOImpl.getDB Connection(AlbumDAOImpl.java:261) [:]
at com.javasrc.webphotogallery.dao.AlbumDAOImpl.findA ll(AlbumDAOImpl.java:226) [:]
at com.javasrc.webphotogallery.web.AdminServlet.servi ce(AdminServlet.java:51) [:]
at javax.servlet.http.HttpServlet.service(HttpServlet .java:847) [:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:242) [:6.0.0.Final]
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:275) [:6.0.0.Final]
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
at org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:88) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityContextEstab lishmentValve.invoke(SecurityContextEstablishmentV alve.java:100) [:6.0.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127) [:6.0.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102) [:6.0.0.Final]
at org.jboss.web.tomcat.service.jca.CachedConnectionV alve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109) [:6.0.0.Final]
at org.jboss.web.tomcat.service.request.ActiveRequest ResponseCacheValve.invoke(ActiveRequestResponseCac heValve.java:53) [:6.0.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:362) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:877) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:654) [:6.0.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:951) [:6.0.0.Final]
at java.lang.Thread.run(Thread.java:722) [:1.7.0_03]
Caused by: org.jboss.resource.JBossResourceException: Failed to register driver for: org.gjt.mm.mysql.Driver; - nested throwable: (java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver)
at org.jboss.resource.adapter.jdbc.local.LocalManaged ConnectionFactory.getDriver(LocalManagedConnection Factory.java:538) [:6.0.0.Final]
at org.jboss.resource.adapter.jdbc.local.LocalManaged ConnectionFactory.getLocalManagedConnection(LocalM anagedConnectionFactory.java:228) [:6.0.0.Final]
... 32 more
Caused by: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java: 366) [:1.7.0_03]
at java.net.URLClassLoader$1.run(URLClassLoader.java: 355) [:1.7.0_03]
at java.security.AccessController.doPrivileged(Native Method) [:1.7.0_03]
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:354) [:1.7.0_03]
at java.lang.ClassLoader.loadClass(ClassLoader.java:4 23) [:1.7.0_03]
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 56) [:1.7.0_03]
at java.lang.Class.forName0(Native Method) [:1.7.0_03]
at java.lang.Class.forName(Class.java:264) [:1.7.0_03]
at org.jboss.resource.adapter.jdbc.local.LocalManaged ConnectionFactory.getDriver(LocalManagedConnection Factory.java:523) [:6.0.0.Final]
... 33 more
2013-02-03 19:58:52,621 ERROR [STDERR] (http-127.0.0.1-8080-4) com.javasrc.webphotogallery.dao.AlbumDAOException: SQL Exception while getting DB connection :
2013-02-03 19:58:52,622 ERROR [STDERR] (http-127.0.0.1-8080-4) org.jboss.util.NestedSQLException: Unable to get managed connection for WebPhotoGalleryDS; - nested throwable: (javax.resource.ResourceException: Unable to get managed connection for WebPhotoGalleryDS)
2013-02-03 19:58:52,622 ERROR [STDERR] (http-127.0.0.1-8080-4) at com.javasrc.webphotogallery.dao.AlbumDAOImpl.getDB Connection(AlbumDAOImpl.java:265)
2013-02-03 19:58:52,623 ERROR [STDERR] (http-127.0.0.1-8080-4) at com.javasrc.webphotogallery.dao.AlbumDAOImpl.findA ll(AlbumDAOImpl.java:226)
2013-02-03 19:58:52,623 ERROR [STDERR] (http-127.0.0.1-8080-4) at com.javasrc.webphotogallery.web.AdminServlet.servi ce(AdminServlet.java:51)
2013-02-03 19:58:52,623 ERROR [STDERR] (http-127.0.0.1-8080-4) at javax.servlet.http.HttpServlet.service(HttpServlet .java:847)
2013-02-03 19:58:52,624 ERROR [STDERR] (http-127.0.0.1-8080-4) at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:324)
2013-02-03 19:58:52,624 ERROR [STDERR] (http-127.0.0.1-8080-4) at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:242)
2013-02-03 19:58:52,624 ERROR [STDERR] (http-127.0.0.1-8080-4) at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:275)
2013-02-03 19:58:52,625 ERROR [STDERR] (http-127.0.0.1-8080-4) at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
2013-02-03 19:58:52,625 ERROR [STDERR] (http-127.0.0.1-8080-4) at org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:181)
2013-02-03 19:58:52,626 ERROR [STDERR] (http-127.0.0.1-8080-4) at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.event(CatalinaContext.java:285)
2013-02-03 19:58:52,626 ERROR [STDERR] (http-127.0.0.1-8080-4) at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.invoke(CatalinaContext.java:261)
2013-02-03 19:58:52,626 ERROR [STDERR] (http-127.0.0.1-8080-4) at org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:88)
2013-02-03 19:58:52,627 ERROR [STDERR] (http-127.0.0.1-8080-4) at org.jboss.web.tomcat.security.SecurityContextEstab lishmentValve.invoke(SecurityContextEstablishmentV alve.java:100)
2013-02-03 19:58:52,627 ERROR [STDERR] (http-127.0.0.1-8080-4) at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127)
2013-02-03 19:58:52,627 ERROR [STDERR] (http-127.0.0.1-8080-4) at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
2013-02-03 19:58:52,628 ERROR [STDERR] (http-127.0.0.1-8080-4) at org.jboss.web.tomcat.service.jca.CachedConnectionV alve.invoke(CachedConnectionValve.java:158)
2013-02-03 19:58:52,628 ERROR [STDERR] (http-127.0.0.1-8080-4) at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
2013-02-03 19:58:52,628 ERROR [STDERR] (http-127.0.0.1-8080-4) at org.jboss.web.tomcat.service.request.ActiveRequest ResponseCacheValve.invoke(ActiveRequestResponseCac heValve.java:53)
2013-02-03 19:58:52,628 ERROR [STDERR] (http-127.0.0.1-8080-4) at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:362)
2013-02-03 19:58:52,630 ERROR [STDERR] (http-127.0.0.1-8080-4) at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:877)
2013-02-03 19:58:52,630 ERROR [STDERR] (http-127.0.0.1-8080-4) at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:654)
2013-02-03 19:58:52,630 ERROR [STDERR] (http-127.0.0.1-8080-4) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:951)
2013-02-03 19:58:52,631 ERROR [STDERR] (http-127.0.0.1-8080-4) at java.lang.Thread.run(Thread.java:722)
2013-02-03 19:58:52,634 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/webphotogallery].[AdminServlet]] (http-127.0.0.1-8080-4) Servlet.service() for servlet AdminServlet threw exception: com.javasrc.webphotogallery.dao.AlbumDAOException: SQL Exception while getting DB connection :
org.jboss.util.NestedSQLException: Unable to get managed connection for WebPhotoGalleryDS; - nested throwable: (javax.resource.ResourceException: Unable to get managed connection for WebPhotoGalleryDS)
at com.javasrc.webphotogallery.dao.AlbumDAOImpl.getDB Connection(AlbumDAOImpl.java:265) [:]
at com.javasrc.webphotogallery.dao.AlbumDAOImpl.findA ll(AlbumDAOImpl.java:226) [:]
at com.javasrc.webphotogallery.web.AdminServlet.servi ce(AdminServlet.java:51) [:]
at javax.servlet.http.HttpServlet.service(HttpServlet .java:847) [:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:242) [:6.0.0.Final]
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:275) [:6.0.0.Final]
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
at org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:88) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityContextEstab lishmentValve.invoke(SecurityContextEstablishmentV alve.java:100) [:6.0.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127) [:6.0.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102) [:6.0.0.Final]
at org.jboss.web.tomcat.service.jca.CachedConnectionV alve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109) [:6.0.0.Final]
at org.jboss.web.tomcat.service.request.ActiveRequest ResponseCacheValve.invoke(ActiveRequestResponseCac heValve.java:53) [:6.0.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:362) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:877) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:654) [:6.0.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:951) [:6.0.0.Final]
at java.lang.Thread.run(Thread.java:722) [:1.7.0_03]
Uffff I'm not managing to get out of all this problems...
I controled my db connection,my web.xml file , my jboss-xml.xml file checked all the variables declared...
I cannot figure out something to help me solve the problem
- 02-04-2013, 10:50 AM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: HTTP Status 500 - JBoss
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
You do not have the jdbc driver jar that contains the above class (it's the MySQL connector) on your runtime classpath.
In this case it is not in the WEB-INF/lib directory of your application.
Actually, since this is a data source thing then I suspect it needs to be in one of the JBoss directories.
You'll need to read the documentation for JBoss as to wheer it needs to go.Please do not ask for code as refusal often offends.
- 02-04-2013, 12:02 PM #9
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
Re: HTTP Status 500 - JBoss
In fact I have the jdbc .jar file included in the lib directory of JBoss but not in the lib directory of WEB-INF ...
I'll try now to include it and see what happens...
Thank you very much Toll
You are always so pragmatist !
- 02-04-2013, 12:08 PM #10
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
Re: HTTP Status 500 - JBoss
The same error ...
- 02-04-2013, 02:00 PM #11
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: HTTP Status 500 - JBoss
OK.
My Oracle one here is in the jboss-as/server/default/lib directory.
The data source xml file is in the jboss-as/server/default/deploy directory (the one with the application wars).Please do not ask for code as refusal often offends.
- 02-04-2013, 02:20 PM #12
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
Re: HTTP Status 500 - JBoss
Yes
My MySQL is in the jboss/server/default/lib directory too
and the data source which for my project is webphotogallery-ds.xml is in the jboss/server/default/deploy directory
- 02-04-2013, 02:23 PM #13
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
Re: HTTP Status 500 - JBoss
I don't think i have neccessery files not included in the right places becouse i have checked carefully all of them and they are in the right places...
At the moment I am trying to verify if there is any problem related to JNDI ...I read in another place that i have to include in my CLASSPATH jbossall-client.jar and jnpserver.jar ...
- 02-04-2013, 04:40 PM #14
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: HTTP Status 500 - JBoss
What CLASSPATH?
Please do not ask for code as refusal often offends.
- 02-04-2013, 04:47 PM #15
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
Re: HTTP Status 500 - JBoss
No i think that was wrong...Anyway i can't resolve my problem ...
I have tried all the things possible to make it work but ...
what makes me doubt are this lines in the log file of my jBoss
[org.jboss.resource.connectionmanager.JBossManagedC onnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: org.gjt.mm.mysql.Driver; - nested throwable: (java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver))
at org.jboss.resource.adapter.jdbc.local.LocalManaged ConnectionFactory.createManagedConnection(LocalMan agedConnectionFactory.java:190)
...
...
...
I don't understand why it is not possible to establish a connection with the db.
- 02-04-2013, 04:51 PM #16
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: HTTP Status 500 - JBoss
It's not able to establish a connection because it cannot find the driver.
What jar file are you using?
Not that I expect that to be the problem...Please do not ask for code as refusal often offends.
- 02-04-2013, 04:56 PM #17
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
Re: HTTP Status 500 - JBoss
I am using mysql-connector-java-5.1.22
- 02-04-2013, 05:07 PM #18
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
Re: HTTP Status 500 - JBoss
jars containing the class org.gjt.mm.mysql.Driver here is a list of all jars containing the class org.gjt.mm.mysql.Driver
I see that mysql-connector-java-5.1.22 is not included here...
Hope this is the real problem
I will do sth to fix it now if this is the reason that prevents the creation of the db connection...
- 02-04-2013, 05:29 PM #19
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
Re: HTTP Status 500 - JBoss
Sorry, but i cannot understand what you're trying to say ...Don't understand the content of the link too
- 02-04-2013, 05:33 PM #20
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Similar Threads
-
HTTP status 405 HTTP method GET is not supported by this URL
By mDennis10 in forum Web FrameworksReplies: 3Last Post: 10-15-2012, 11:53 AM -
HTTP Status 500 -
By gauravmanral in forum Java ServletReplies: 2Last Post: 02-14-2012, 04:50 AM -
http://localhost:8080/helloservice/HelloService?Tester HTTP Status 404 -
By vietnamusa in forum Enterprise JavaBeans (EJB)Replies: 0Last Post: 03-13-2011, 12:02 AM -
HTTP Status 500 -
By gardiann in forum Java ServletReplies: 2Last Post: 12-26-2010, 12:49 PM -
HTTP Status 405 - HTTP method GET is not supported by this URL
By javanewbie in forum Java ServletReplies: 7Last Post: 11-11-2009, 08:29 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks