- This topic has 28 replies, 3 voices, and was last updated 19 years, 2 months ago by
stainbk2.
-
AuthorPosts
-
March 29, 2006 at 5:42 pm #249554
Riyad KallaMemberOk let’s do this.
File > Switch Workspace > C:\tempworkspace, hit OK
After the restart, go config MyEclipse Tomcat connector, hit OK. Now try and start Tomcat. Did it work? Try and run your app (assuming it’s still deployed to Tomcat) did it work?
March 30, 2006 at 4:38 am #249563
Kalle-lumiMemberDone!
When I restart Windows and start Eclipse I get an error:
Workspace is in use please use another oneSo I can not choose the newly created WorkspaceTemp. I can only choose the old workspace
What to do?
March 30, 2006 at 11:24 am #249573
Riyad KallaMemberWhat is going on here… so you typed in a totally new workspace name that has never existed before and Eclipse told you it was in use? If so, try another name that has never existed before like C:\blahblahtesttest123abc-workspace (copy and paste that). If Eclipse tells you it is in use, then there is some install issue going on here, because that doesn’t make any sense (for Eclipse to say that).
March 30, 2006 at 1:25 pm #249590
Kalle-lumiMemberI am creating a package where I have classes such as DbConnector and User. I am placing the package in “proj2/src”. Is that the right location?
March 30, 2006 at 1:47 pm #249593
Riyad KallaMemberYes that looks fine, but you are skipping over my question about the workspaces, what’s going on there?
March 30, 2006 at 2:02 pm #249596
Kalle-lumiMemberoh I think I goofed the first time when I switched workspace. I think I forced Eclipse to quit during the restart that it makes to really switch workspace. I guess it lost the reference by my harsh treatment 😉
I am going crazy about the dependencies not working 🙁
I have a shop_login.jsp with a login form that has an form action to login_action.jsp. There I am calling for User.validate(username, password) but User is not found eventhough I have
<%@ page import=”org.branemark.webshop.*”%> and User has a
package org.branemark.webshop;March 30, 2006 at 4:15 pm #249603
Riyad KallaMemberOk just send me this crazy Project, I am convinced now there is some really easy explanation to all of this. Eport it to a zip and email it to support@genuitec.com ATTN Riyad. If it’s to big, put it up in a web location and PM me a link, I’ll download it and see what is goin on.
March 30, 2006 at 4:49 pm #249605
Kalle-lumiMember<POST ERASED>
March 30, 2006 at 5:25 pm #249606
Riyad KallaMemberOk I got your project.
1) I configured my tomcat connector in your workspace
2) I had to refresh your project because the contents were out of sync with the workbench
3) Then I cleaned the project
4) Then I created an exploded deployment in Tomcat
5) Then I went to test3.jsp and got the output on the screen “Hej” and got this exception in the console because I don’t have MySQL running locally:### Login attempt at Thu Mar 30 16:22:04 GMT-07:00 2006
from 127.0.0.1
null/null
Mar 30, 2006 4:22:04 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.login_005faction_jsp._jspService(org.apache.jsp.login_005faction_jsp:57)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Connecting to database…
Error connecting to databasecom.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: java.net.ConnectException: Connection refused: connectSTACKTRACE:
java.net.SocketException: java.net.ConnectException: Connection refused: connect
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:284)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2555)
at com.mysql.jdbc.Connection.<init>(Connection.java:1485)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at org.apache.jsp.test3_jsp._jspService(org.apache.jsp.test3_jsp:49)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)** END NESTED EXCEPTION **
So the end result is that everything is working as it should. I have the MySQL driver under common/lib (mysql-connector-java-3.1.12-bin.jar) and I setup my Tomcat 5 install with the following settings:
Tomcat Home DIr: C:\Java\apache-tomcat-5.5.15
Tomcat Base Dir: C:\Java\apache-tomcat-5.5.15
Tomcat Temp Dir: C:\Java\apache-tomcat-5.5.15\temp
–> Under JDK I setup and used JDK 1.5.0_06 to launch itI think you may be mis-diagnosing the problem.
March 30, 2006 at 5:41 pm #249608
Kalle-lumiMemberOk. Thanks.
Now we need to go back to the origin question.Why can test3.jsp do the Class.forName(“com.mysql.jdbc.Driver”);
but when an other jsp page calls for DbConnector.java to do the same forName() I get the
java.lang.ClassNotFoundException: com.mysql.jdbc.DriverMarch 31, 2006 at 7:56 am #249615
Kalle-lumiMemberNow I have rebuild everything from scratch: new workspace, new project, everything is new and now it all works =)
Of couse it is a bit disturbing not knowing exactly what was the real problem but as you said it was definetely just a minor settings issue.
Most important is that everything works. You have been wonderful with all your patience. Cheers =)
March 31, 2006 at 10:12 am #249624
Riyad KallaMemberThank goodness everything works now, because I was really having a hard time figuring out what was causing the problem. Thanks for hanging in there and being patient, I know this can be frustrating.
April 18, 2006 at 2:38 pm #250660
stainbk2MemberI have what seems to be the same problem.
I have a web app running on Tomcat 5.5.16. I included the database driver file in Tomcat’s common/lib directory (as the Tomcat documentation recommends). If I start up the application using Tomcat, everything loads just fine. However, if I start Tomcat using MyEclipse, I get a ClassNotFoundException trying to locate the driver. Even if I add the driver file to the MyEclipse path for the Tomcat 5 connector, I get the same results.
I’d like to try and help resolve the issue rather than blowing away my workspace, as I have other projects in the workspace that would be affected.
What can I do to help research/resolve this issue?
Thanks,
– KMS
April 18, 2006 at 3:25 pm #250665
stainbk2MemberOK… more specifically, I was attempting to connect to DB2 v8 (Express Edition). When starting Tomcat from MyEclipse, I would always get a ClassNotFoundException for the DB2 driver when I used the jdbc type 2 driver (COM.ibm.jdbc.app.driver.DB2Driver). However, when I switched to using the type 4 driver (com.ibm.db2.jcc.DB2Driver) and use the type 4 specific url (jdbc:db2://<server name here>:50000/<database name here>), it worked fine.
Of course, this won’t help DB2 users who are still using the type 2 driver…
-
AuthorPosts