Results 21 to 33 of 33
Thread: HTTP Status 500 - JBoss
- 02-04-2013, 05:39 PM #21
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
- 02-04-2013, 05:42 PM #22
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
Re: HTTP Status 500 - JBoss
Sorry for the ignorance of the question but where i'm supposed to find this??
I'm sorry but all the problems this project brought to me have totally disoriented me
- 02-04-2013, 06:05 PM #23
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
Re: HTTP Status 500 - JBoss
The MySQL Connector-J documentation.
Have a look at the examples page.Please do not ask for code as refusal often offends.
- 02-05-2013, 11:01 AM #24
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
Re: HTTP Status 500 - JBoss
I did some other things trying to find the solution but the error remains the same ...
- 02-05-2013, 11:22 AM #25
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
Re: HTTP Status 500 - JBoss
What things?
Did you read those docs?
Did you change the driver you are trying to reference in your data source?Please do not ask for code as refusal often offends.
- 02-05-2013, 09:33 PM #26
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
Re: HTTP Status 500 - JBoss
Yes i changed the driver and the log files now specifies that :
com.javasrc.webphotogallery.dao.AlbumDAOException: SQL Exception while getting DB connection :
2013-02-05 21:31:01,409 ERROR [STDERR] (http-127.0.0.1-8080-3) org.jboss.util.NestedSQLException: You are trying to use a connection factory that has been shut down: ManagedConnectionFactory is null.; - nested throwable: (javax.resource.ResourceException: You are trying to use a connection factory that has been shut down: ManagedConnectionFactory is null.)
- 02-06-2013, 09:24 AM #27
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
Re: HTTP Status 500 - JBoss
I suspect it's time to dig out the JBoss docs.
Please do not ask for code as refusal often offends.
- 02-06-2013, 10:00 AM #28
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
Re: HTTP Status 500 - JBoss
Uffff I read yeasterday all about the version of JBoss i am using.
I found that org.gjt.mm.mysql.Driver is an old driver - class and it was suggested to update it to com.mysql.jdbc.Driver as soon as possible...
I don't know exactly how this update should be made but when i changed the driver class specification in my webphotogallery-ds.xml from org.gjt.mm.mysql.Driver to com.mysql.jdbc.Driver the log file says the thing i mentioned before :
com.javasrc.webphotogallery.dao.AlbumDAOException: SQL Exception while getting DB connection :
2013-02-05 21:31:01,409 ERROR [STDERR] (http-127.0.0.1-8080-3) org.jboss.util.NestedSQLException: You are trying to use a connection factory that has been shut down: ManagedConnectionFactory is null.; - nested throwable: (javax.resource.ResourceException: You are trying to use a connection factory that has been shut down: ManagedConnectionFactory is null.)
- 02-06-2013, 10:04 AM #29
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
Re: HTTP Status 500 - JBoss
The thing that i don't understand most is the fact that the connection betwee jBoss and mysql is working when i put images in the db through the class LoadImage ...
- 02-06-2013, 10:10 AM #30
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
Re: HTTP Status 500 - JBoss
So changing the Driver fixed the problem with no class found.
Something else is causing the null factory.
That could well be your code, though.
If one part works, and another part doesn't, then compare the two bits of code.Please do not ask for code as refusal often offends.
- 02-08-2013, 11:26 AM #31
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
Re: HTTP Status 500 - JBoss
Okkk ... yesterday I finelly solved all my problems...I didn't change the driver class "org.gjt.mm.mysql.Driver" , but I changed the way of getting the db connection in my code!
When I got the error I was specifying the db connection as:
and i had created this method:Java Code:.... .... Connection conn = null; PreparedStatement ps = null; try { conn = this.getDBConnection(); ... ...
To resolve the problem I removed this lines of code and replaced them with:Java Code:protected Connection getDBConnection() throws AlbumDAOException { try { return datasource.getConnection(); } catch( SQLException se ) { throw new AlbumDAOException( "SQL Exception while getting " + "DB connection : \n" + se); } }
This didn't solve my problem at all, so I tried to do sth else ...Java Code:.... .... Connection conn = null; PreparedStatement ps = null; try { try { Class.forName("org.gjt.mm.mysql.Driver"); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } String url = "jdbc:mysql://localhost:3306/webphotogallery"; String username = "root"; String password = ""; conn = DriverManager.getConnection( url, username, password ); .... ....
I also included the Java connector (JDBC .jar file ) in the lib directory of WEB-INF and voilaaa , finally I had the possibility to view for the first time my web photo gallery .
I also got another error when trying to upload an image from my pc to one album of my web photo gallery .
I resolved this problem this way:
1) At first I opened Eclipse and for the ImageUploadServlet.java :
-rightclick>>Build path>>Configure Build path>>Libraries>>Add External JARs
at this point I added commons-fileupload-1.2.2.jar
2)I downloaded commons-io and encluded it in the CLASSPATH of my system environment variables and in the lib directory of WEB-INF
This resolved the problem of uploading images
Thank you all
b.dhimitri
- 02-08-2013, 01:34 PM #32
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
Re: HTTP Status 500 - JBoss
Do not set the CLASSPATH in your environment.
That is out and out the wrong way of doing things.
If it's in the WEB-INF/lib then it's accessible by your application.
If it's needed by JBoss then it needs to be higher up in one of the JBoss libs (you'd need to read the docs).
Finally, you really should figure out how to use a DataSource and it's underlying connection pool.
The way you are doing it at the moment is not scaleable.Please do not ask for code as refusal often offends.
- 02-08-2013, 03:56 PM #33
Member
- Join Date
- Jan 2013
- Posts
- 30
- Rep Power
- 0
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