[opencms-dev] Trouble installing on Windows: Problem connecting to MySQL DBMS.

Ken Bowen kbowen at als.com
Thu Feb 24 19:19:28 CET 2005


Trouble installing on Windows: Problem connecting to MySQL DBMS.
Nothing from the archives seems to apply.
Any help/suggestions appreciated...Is there a "manual" installation procedure?

Briefly:
--> An "everything on windows" install;
   [My system is a Dell Latitude running Windows XP SP2 with 1GB ram, lots 
of disk]
--> MySQL running (can telnet to 3306; mysqladmin output info below)
--> Tomcat running (ocsetup running via 
Tomcat:  http://localhost:8080/opencms/ocsetup)
    [Tomcat is running in standalone mode.]
--> JDBC present
    [An example of connnecting via JDBC for a pure Java example app is 
included at end of this msg]
--> BUT ocsetup cannot connect to MySQL.

Details below:

When running the ocsetup installer, I got the following error message
[I entered root for both users, together with the root password for MySQL.
  {NOTE: Also tried adding a user 'admin' to MySQL which has ALL privledges 
ON * , and used that
   in ocsetup, but that failed too.}
----more data following this message from ocsetup]:

Could no connect to database via: jdbc:mysql://localhost:3306/
java.sql.SQLException: Communication link failure: java.io.IOException, 
underlying cause: Unexpected end of input stream

** BEGIN NESTED EXCEPTION **

java.io.IOException
MESSAGE: Unexpected end of input stream

STACKTRACE:

java.io.IOException: Unexpected end of input stream
	at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:1080)
	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:619)
	at com.mysql.jdbc.Connection.createNewIO(Connection.java:1532)
	at com.mysql.jdbc.Connection.<init>(Connection.java:486)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:326)
	at java.sql.DriverManager.getConnection(DriverManager.java:525)
	at java.sql.DriverManager.getConnection(DriverManager.java:171)
	at com.opencms.boot.CmsSetupDb.setConnection(CmsSetupDb.java:30)
	at 
org.apache.jsp.ocsetup.create_005fdatabase_jsp._jspService(org.apache.jsp.ocsetup.create_005fdatabase_jsp:119)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
	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:214)
	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:825)
	at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
	at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
	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 **
-------------------------------------------
java.lang.NullPointerException

-------------------------------------------
============================================================================

More Info:
--------------------------------------------
MySQL:
C:\Documents and Settings\Ken Bowen>mysqladmin -uroot -p version
Enter password: *******
mysqladmin  Ver 8.41 Distrib 4.1.8, for Win95/Win98 on i32
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version          4.1.8-nt
Protocol version        10
Connection              localhost via TCP/IP
TCP port                3306
Uptime:                 31 min 6 sec

Threads: 3  Questions: 14  Slow queries: 0  Opens: 11  Flush tables: 
1  Open tab
les: 0  Queries per second avg: 0.008
--------------------------------------------



============================================================================
Here is the startup information for Tomcat:

Feb 24, 2005 9:54:52 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Feb 24, 2005 9:54:52 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 620 ms
Feb 24, 2005 9:54:52 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Feb 24, 2005 9:54:52 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.7
Feb 24, 2005 9:54:52 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Feb 24, 2005 9:54:53 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive opencms.war
Feb 24, 2005 9:54:53 AM org.apache.catalina.core.ApplicationContext log
INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache
webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule
  Target string: News / Redirect URL: http://www.cnn.com], 
[org.apache.webapp.ba
ancer.rules.RequestParameterRule: Target param name: paramName / Target param v
lue: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balan
er.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
Feb 24, 2005 9:54:53 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Feb 24, 2005 9:54:53 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Feb 24, 2005 9:54:54 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Feb 24, 2005 9:54:54 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Feb 24, 2005 9:54:54 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Feb 24, 2005 9:54:54 AM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Feb 24, 2005 9:54:54 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/20  config=null
Feb 24, 2005 9:54:54 AM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Feb 24, 2005 9:54:54 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2113 ms

============================================================================

Finally, here is a code code fragment and console output from a small sample
Java program illustrating JDBC connection to the MySQL system on this machine:

Code Fragement:
--------------
     public boolean checkForConnection()
         throws SQLException
     {
         boolean openedLocally = false;
         if (_connection == null || _connection.isClosed()){
             try {
                 _connection =  DriverManager.getConnection(_connectionString);
System.out.println("Connected to:  //" + _host + "/" + _database + "  using 
string: \n" + _connectionString);
                 openedLocally = true;
             } catch (SQLException e){
                 displaySQLERrors(e);
             }
         }
         return openedLocally;
     }

Console output:
---------------

Connected to:  //localhost/daily_trading  using string:
jdbc:mysql://localhost/daily_trading?user=root&password=<password as given 
to ocsetup installer>

SELECT * FROM  IBM WHERE 917136000001<=day AND day<=923097600001 ORDER BY day
size=48


Many thanks in advance ................




More information about the opencms-dev mailing list