Connection to MySQL constantly closed
QUESTION: is there something I can adjust within SQL*developer to prevent the constant rapid disconnection from the MySQL Development database?
I have to similar MySQL database on different host machines, one for development and one for production. I am trying to migrate both of them to Oracle using SQL*Developer Migrate tools. The connection to the Production MySQL database behaves fine, but the connection to the Development MySQL database constantly gets closed and I must reconnect.
When I connect to the Development MySQL database, I can initially get connected, but then I get disconnect automatically after less than 5 minutes of inactivity. When I try to use the SQL*Developer Migrate tools, they also fail with a disconnection error. If connected to MySQL production database on different host machine, none of these disconnect errors happen, everything works fine. What could be wrong with my MySQL development environment that is constantly disconnecting me.
Below are the technical details and error message that may help resolve this.
CLIENT:
MAC OS X Lion Version 10.7.4
SQL*Developer version 3.1.07 Build MAIN 07.42
Java(TM) Platform Version 1.6.0_33
Third Party JDBC Driver is mysql-connector-java-5.0.4
SOURCE:
Linux box running MySQL version 5.1.44 (for both Production and Development)
TARGET:
Linux 2.6.18-194.el5 x86_64
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
Here's a sample disconnect error message from SQL*Developer after less than 3 minutes of inactivity.
An error was encountered performing the requested operation:
No operations allowed after connection closed.Connection was implicitly closed due to underlying exception/error:
** BEGIN NESTED EXCEPTION **
com.mysql.jdbc.CommunicationsException
MESSAGE: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: Broken pipe
STACKTRACE:
java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2637)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1554)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3176)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1153)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1266)
at oracle.dbtools.migration.capture.MySQLDatabaseListProvider.getOnlineDatabaseNames(MySQLDatabaseListProvider.java:191)
at oracle.dbtools.migration.capture.MySQLDatabaseListProvider.getAvailableOnlineDatabaseList(MySQLDatabaseListProvider.java:171)
at oracle.dbtools.migration.capture.DatabaseProviderRegistry.getAvailableDBListOnline(DatabaseProviderRegistry.java:27)
at oracle.dbtools.migration.workbench.core.ui.quickmigrate.QMWizard$ContextHelper.getAvailableDBListOnline(QMWizard.java:713)
at oracle.dbtools.migration.workbench.core.ui.quickmigrate.CapturePageMigration.initPageState(CapturePageMigration.java:314)
at oracle.dbtools.migration.workbench.core.ui.quickmigrate.CapturePageMigration.onEntry(CapturePageMigration.java:81)
at oracle.ide.wizard.FSMWizard.gotoPanel(FSMWizard.java:743)
at oracle.ide.wizard.FSMWizard.setSelectedPage(FSMWizard.java:463)
at oracle.bali.ewt.wizard.BaseWizard.selectPage(BaseWizard.java:1964)
at oracle.ide.wizard.FSMWizard.selectPage(FSMWizard.java:447)
at oracle.ide.wizard.FSMWizard.doNext(FSMWizard.java:322)
at oracle.bali.ewt.wizard.BaseWizard$Action$1.run(BaseWizard.java:3944)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:682)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:643)
at java.awt.EventQueue$1.run(EventQueue.java:641)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:652)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:205)
at java.awt.Dialog$1.run(Dialog.java:1044)
at java.awt.Dialog$3.run(Dialog.java:1096)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Dialog.java:1094)
at java.awt.Component.show(Component.java:1584)
at java.awt.Component.setVisible(Component.java:1536)
at java.awt.Window.setVisible(Window.java:841)
at java.awt.Dialog.setVisible(Dialog.java:984)
at oracle.bali.ewt.wizard.WizardDialog.runDialog(WizardDialog.java:382)
at oracle.bali.ewt.wizard.WizardDialog.runDialog(WizardDialog.java:298)
at oracle.ide.dialogs.WizardLauncher.runDialog(WizardLauncher.java:51)
at oracle.dbtools.migration.workbench.core.ui.quickmigrate.QMWizard.launch(QMWizard.java:111)
at oracle.dbtools.migration.workbench.core.QMLauncher.launch(QMLauncher.java:40)
at oracle.dbtools.raptor.controls.sqldialog.ObjectActionController.handleEvent(ObjectActionController.java:192)
at oracle.ide.controller.IdeAction.performAction(IdeAction.java:529)
at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:884)
at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:501)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:389)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809)
at com.apple.laf.AquaMenuItemUI.doClick(AquaMenuItemUI.java:137)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850)
at java.awt.Component.processMouseEvent(Component.java:6375)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6140)
at java.awt.Container.processEvent(Container.java:2083)
at java.awt.Component.dispatchEventImpl(Component.java:4737)
at java.awt.Container.dispatchEventImpl(Container.java:2141)
at java.awt.Component.dispatchEvent(Component.java:4565)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4619)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4280)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4210)
at java.awt.Container.dispatchEventImpl(Container.java:2127)
at java.awt.Window.dispatchEventImpl(Window.java:2482)
at java.awt.Component.dispatchEvent(Component.java:4565)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:684)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:643)
at java.awt.EventQueue$1.run(EventQueue.java:641)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:657)
at java.awt.EventQueue$2.run(EventQueue.java:655)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:654)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
** END NESTED EXCEPTION **
Last packet sent to the server was 0 ms ago.
STACKTRACE:
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: Broken pipe
STACKTRACE:
java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2637)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1554)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3176)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1153)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1266)
at oracle.dbtools.migration.capture.MySQLDatabaseListProvider.getOnlineDatabaseNames(MySQLDatabaseListProvider.java:191)
at oracle.dbtools.migration.capture.MySQLDatabaseListProvider.getAvailableOnlineDatabaseList(MySQLDatabaseListProvider.java:171)
at oracle.dbtools.migration.capture.DatabaseProviderRegistry.getAvailableDBListOnline(DatabaseProviderRegistry.java:27)
at oracle.dbtools.migration.workbench.core.ui.quickmigrate.QMWizard$ContextHelper.getAvailableDBListOnline(QMWizard.java:713)
at oracle.dbtools.migration.workbench.core.ui.quickmigrate.CapturePageMigration.initPageState(CapturePageMigration.java:314)
at oracle.dbtools.migration.workbench.core.ui.quickmigrate.CapturePageMigration.onEntry(CapturePageMigration.java:81)
at oracle.ide.wizard.FSMWizard.gotoPanel(FSMWizard.java:743)
at oracle.ide.wizard.FSMWizard.setSelectedPage(FSMWizard.java:463)
at oracle.bali.ewt.wizard.BaseWizard.selectPage(BaseWizard.java:1964)
at oracle.ide.wizard.FSMWizard.selectPage(FSMWizard.java:447)
at oracle.ide.wizard.FSMWizard.doNext(FSMWizard.java:322)
at oracle.bali.ewt.wizard.BaseWizard$Action$1.run(BaseWizard.java:3944)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:682)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:643)
at java.awt.EventQueue$1.run(EventQueue.java:641)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:652)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:205)
at java.awt.Dialog$1.run(Dialog.java:1044)
at java.awt.Dialog$3.run(Dialog.java:1096)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Dialog.java:1094)
at java.awt.Component.show(Component.java:1584)
at java.awt.Component.setVisible(Component.java:1536)
at java.awt.Window.setVisible(Window.java:841)
at java.awt.Dialog.setVisible(Dialog.java:984)
at oracle.bali.ewt.wizard.WizardDialog.runDialog(WizardDialog.java:382)
at oracle.bali.ewt.wizard.WizardDialog.runDialog(WizardDialog.java:298)
at oracle.ide.dialogs.WizardLauncher.runDialog(WizardLauncher.java:51)
at oracle.dbtools.migration.workbench.core.ui.quickmigrate.QMWizard.launch(QMWizard.java:111)
at oracle.dbtools.migration.workbench.core.QMLauncher.launch(QMLauncher.java:40)
at oracle.dbtools.raptor.controls.sqldialog.ObjectActionController.handleEvent(ObjectActionController.java:192)
at oracle.ide.controller.IdeAction.performAction(IdeAction.java:529)
at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:884)
at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:501)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:389)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809)
at com.apple.laf.AquaMenuItemUI.doClick(AquaMenuItemUI.java:137)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850)
at java.awt.Component.processMouseEvent(Component.java:6375)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6140)
at java.awt.Container.processEvent(Container.java:2083)
at java.awt.Component.dispatchEventImpl(Component.java:4737)
at java.awt.Container.dispatchEventImpl(Container.java:2141)
at java.awt.Component.dispatchEvent(Component.java:4565)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4619)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4280)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4210)
at java.awt.Container.dispatchEventImpl(Container.java:2127)
at java.awt.Window.dispatchEventImpl(Window.java:2482)
at java.awt.Component.dispatchEvent(Component.java:4565)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:684)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:643)
at java.awt.EventQueue$1.run(EventQueue.java:641)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:657)
at java.awt.EventQueue$2.run(EventQueue.java:655)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:654)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
** END NESTED EXCEPTION **
Last packet sent to the server was 0 ms ago.
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2652)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1554)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3176)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1153)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1266)
at oracle.dbtools.migration.capture.MySQLDatabaseListProvider.getOnlineDatabaseNames(MySQLDatabaseListProvider.java:191)
at oracle.dbtools.migration.capture.MySQLDatabaseListProvider.getAvailableOnlineDatabaseList(MySQLDatabaseListProvider.java:171)
at oracle.dbtools.migration.capture.DatabaseProviderRegistry.getAvailableDBListOnline(DatabaseProviderRegistry.java:27)
at oracle.dbtools.migration.workbench.core.ui.quickmigrate.QMWizard$ContextHelper.getAvailableDBListOnline(QMWizard.java:713)
at oracle.dbtools.migration.workbench.core.ui.quickmigrate.CapturePageMigration.initPageState(CapturePageMigration.java:314)
at oracle.dbtools.migration.workbench.core.ui.quickmigrate.CapturePageMigration.onEntry(CapturePageMigration.java:81)
at oracle.ide.wizard.FSMWizard.gotoPanel(FSMWizard.java:743)
at oracle.ide.wizard.FSMWizard.setSelectedPage(FSMWizard.java:463)
at oracle.bali.ewt.wizard.BaseWizard.selectPage(BaseWizard.java:1964)
at oracle.ide.wizard.FSMWizard.selectPage(FSMWizard.java:447)
at oracle.ide.wizard.FSMWizard.doNext(FSMWizard.java:322)
at oracle.bali.ewt.wizard.BaseWizard$Action$1.run(BaseWizard.java:3944)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:682)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:643)
at java.awt.EventQueue$1.run(EventQueue.java:641)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:652)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:205)
at java.awt.Dialog$1.run(Dialog.java:1044)
at java.awt.Dialog$3.run(Dialog.java:1096)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Dialog.java:1094)
at java.awt.Component.show(Component.java:1584)
at java.awt.Component.setVisible(Component.java:1536)
at java.awt.Window.setVisible(Window.java:841)
at java.awt.Dialog.setVisible(Dialog.java:984)
at oracle.bali.ewt.wizard.WizardDialog.runDialog(WizardDialog.java:382)
at oracle.bali.ewt.wizard.WizardDialog.runDialog(WizardDialog.java:298)
at oracle.ide.dialogs.WizardLauncher.runDialog(WizardLauncher.java:51)
at oracle.dbtools.migration.workbench.core.ui.quickmigrate.QMWizard.launch(QMWizard.java:111)
at oracle.dbtools.migration.workbench.core.QMLauncher.launch(QMLauncher.java:40)
at oracle.dbtools.raptor.controls.sqldialog.ObjectActionController.handleEvent(ObjectActionController.java:192)
at oracle.ide.controller.IdeAction.performAction(IdeAction.java:529)
at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:884)
at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:501)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:389)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809)
at com.apple.laf.AquaMenuItemUI.doClick(AquaMenuItemUI.java:137)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850)
at java.awt.Component.processMouseEvent(Component.java:6375)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6140)
at java.awt.Container.processEvent(Container.java:2083)
at java.awt.Component.dispatchEventImpl(Component.java:4737)
at java.awt.Container.dispatchEventImpl(Container.java:2141)
at java.awt.Component.dispatchEvent(Component.java:4565)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4619)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4280)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4210)
at java.awt.Container.dispatchEventImpl(Container.java:2127)
at java.awt.Window.dispatchEventImpl(Window.java:2482)
at java.awt.Component.dispatchEvent(Component.java:4565)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:684)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:643)
at java.awt.EventQueue$1.run(EventQueue.java:641)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:657)
at java.awt.EventQueue$2.run(EventQueue.java:655)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:654)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
** END NESTED EXCEPTION **
Vendor code 0
Unless you give a little more information - what kind of query are you trying to run, where this occurs in your code, what driver you are using and so on, it will be almost impossible to give you a detailed solution to the problem.
Similar Messages
-
Mysql_connect "Lost connection to MySQL..." error 61
A web developer is getting this error on a test web server of ours that is running 10.5.7 Server.
"Warning: mysql_connect() function.mysql-connect: Lost connection to MySQL server at 'reading initial communication packet', system error: 61 in..."
I've seen other postings online for this error suggesting that the line containing 'bind-address 127.0.0.1' be commented out within /etc/my.conf... but this line doesn't exists on my installation.
MySQL and php have been working well for other databases and developers. This is a newly created database.
Has anyone else seen this error and found a fix?
Thanks!This is more than likely a firewall problem on your users end. I just ran into this when moving my servers to a colocation. Everything was fine until i tried to connect to an outside database from the machines behind the new firewall. was set to allow 3306 in, but not out. And would connect without issues to localhost:/var/mysql/mysql.sock .
from the machine trying to connect from try
shell> telnet <servername> 3306
should be able to login. if refused, then port is closed.
------- -
Problem to connect to mysql from servlet using a javabean
Hi,
I'm new here and beginner on java to.
I have problem to connect to MySql database, by a connection javabean.
It's the following: a HTML page calls a servlet and this servlet imports the package connection javabean.
It has no problem when I establish the connection inside the servlet, with all its methods (public and private). But i want to separate the code connection from servlet.
Detail: there is no problem, using the javabean to connect to MS Access database.
I put "mysql-connector-java-3.1.12-bin.jar" file inside WEB-INF/lib application and common/lib directories.
I set the classpath:
SET CLASSPATH=%CATALINA_HOME%\COMMON\LIB\mysql-connector-java-3.1.12-bin.jar;%CLASSPATH%
I think that the servlet cannot create an instance of javabean, because passed by catch exception of the servlet init method.
But I don't know why.
Please Why?
Below there are the fragment of errors, servlet code e javabean code.
Thank you.
Zovao.
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.NullPointerException
at CadServletFileBeanConexArq.doPost(CadServletFileBeanConexArq.java:47)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
Note: The line 47 is calling insertIntoDB javabean method.
========///////////////===============
// Here is the servlet CadServletFileBeanConexArq.java
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.sql.*;
import conJdbc.*;
public class CadServletFileBeanConexArq extends HttpServlet {
public ConexPed connect = null;
private String driver = "com.mysql.jdbc.Driver";
private String URL = "jdbc:mysql://localhost:3306/cadastro";
public void init( ServletConfig config )
throws ServletException
super.init( config );
try
connect = new ConexPed(driver, URL, "monty", "some_pass");
catch ( Exception e )
e.printStackTrace();
connect = null;
public void doPost( HttpServletRequest req,
HttpServletResponse res )
throws ServletException
boolean success = true;
String email, nome, sobrenome, produto, valor;
email = req.getParameter( "Email" );
nome = req.getParameter( "Nome" );
sobrenome = req.getParameter( "Sobrenome" );
produto = req.getParameter( "Produto" );
valor = req.getParameter( "Valor" );
res.setContentType( "text/html" );
if ( email.length() > 0 && nome.length() > 0 && sobrenome.length() > 0 && valor.length() > 0 )
/* inserting data */
success = connect.insertIntoDB(
"'" + email + "','" + nome + "','" + sobrenome + "','" + produto + "'", Double.parseDouble(valor) );
//closing connection
public void destroy()
connect.fecharConexao();
=============///////////////============
Here is the JavaBean.
package conJdbc;
import java.sql.*;
public class ConexPed
public Connection connection;
public Statement statement;
public ConexPed (String driver, String urlServidor, String user, String password)
try
Class.forName(driver);
connection = DriverManager.getConnection(urlServidor,user,password);
catch (ClassNotFoundException ex)
System.out.println("N�o foi poss�vel encontrar a classe do Driver: " + driver);
catch (SQLException ex)
System.out.println("N�o foi poss�vel conectar ao servidor");
try
statement = connection.createStatement();
catch (SQLException ex)
System.out.println("N�o foi poss�vel criar a statement");
*Inserting data to database
public synchronized boolean insertIntoDB( String stringtoinsert, double valor)
try
statement.executeUpdate( "INSERT INTO pedido values (" + stringtoinsert + " , " + valor + ");" );
catch ( Exception e ) {
System.err.println(
"ERROR: Problemas ao adicionar nova entrada" );
e.printStackTrace();
return false;
return true;
* Close statement.
public void fecharStatement()
try
statement.close();
catch (SQLException ex)
ex.printStackTrace();
* close database
public void fecharConexao()
try
connection.close();
catch (SQLException ex)
ex.printStackTrace();
}Hi,
I'm new here and beginner on java to.
I have problem to connect to MySql database, by a connection javabean.
It's the following: a HTML page calls a servlet and this servlet imports the package connection javabean.
It has no problem when I establish the connection inside the servlet, with all its methods (public and private). But i want to separate the code connection from servlet.
Detail: there is no problem, using the javabean to connect to MS Access database.
I put "mysql-connector-java-3.1.12-bin.jar" file inside WEB-INF/lib application and common/lib directories.
I set the classpath:
SET CLASSPATH=%CATALINA_HOME%\COMMON\LIB\mysql-connector-java-3.1.12-bin.jar;%CLASSPATH%
I think that the servlet cannot create an instance of javabean, because passed by catch exception of the servlet init method.
But I don't know why.
Please Why?
Below there are the fragment of errors, servlet code e javabean code.
Thank you.
Zovao.
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.NullPointerException
at CadServletFileBeanConexArq.doPost(CadServletFileBeanConexArq.java:47)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
Note: The line 47 is calling insertIntoDB javabean method.
========///////////////===============
// Here is the servlet CadServletFileBeanConexArq.java
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.sql.*;
import conJdbc.*;
public class CadServletFileBeanConexArq extends HttpServlet {
public ConexPed connect = null;
private String driver = "com.mysql.jdbc.Driver";
private String URL = "jdbc:mysql://localhost:3306/cadastro";
public void init( ServletConfig config )
throws ServletException
super.init( config );
try
connect = new ConexPed(driver, URL, "monty", "some_pass");
catch ( Exception e )
e.printStackTrace();
connect = null;
public void doPost( HttpServletRequest req,
HttpServletResponse res )
throws ServletException
boolean success = true;
String email, nome, sobrenome, produto, valor;
email = req.getParameter( "Email" );
nome = req.getParameter( "Nome" );
sobrenome = req.getParameter( "Sobrenome" );
produto = req.getParameter( "Produto" );
valor = req.getParameter( "Valor" );
res.setContentType( "text/html" );
if ( email.length() > 0 && nome.length() > 0 && sobrenome.length() > 0 && valor.length() > 0 )
/* inserting data */
success = connect.insertIntoDB(
"'" + email + "','" + nome + "','" + sobrenome + "','" + produto + "'", Double.parseDouble(valor) );
//closing connection
public void destroy()
connect.fecharConexao();
=============///////////////============
Here is the JavaBean.
package conJdbc;
import java.sql.*;
public class ConexPed
public Connection connection;
public Statement statement;
public ConexPed (String driver, String urlServidor, String user, String password)
try
Class.forName(driver);
connection = DriverManager.getConnection(urlServidor,user,password);
catch (ClassNotFoundException ex)
System.out.println("N�o foi poss�vel encontrar a classe do Driver: " + driver);
catch (SQLException ex)
System.out.println("N�o foi poss�vel conectar ao servidor");
try
statement = connection.createStatement();
catch (SQLException ex)
System.out.println("N�o foi poss�vel criar a statement");
*Inserting data to database
public synchronized boolean insertIntoDB( String stringtoinsert, double valor)
try
statement.executeUpdate( "INSERT INTO pedido values (" + stringtoinsert + " , " + valor + ");" );
catch ( Exception e ) {
System.err.println(
"ERROR: Problemas ao adicionar nova entrada" );
e.printStackTrace();
return false;
return true;
* Close statement.
public void fecharStatement()
try
statement.close();
catch (SQLException ex)
ex.printStackTrace();
* close database
public void fecharConexao()
try
connection.close();
catch (SQLException ex)
ex.printStackTrace();
} -
HS connection to MySQL fails for large table
Hello,
I have set up an HS to a MySql 3.51 dabatabe using an ODBC DNS. My Oracle box has version 10.2.0.1 running in Windows 2003 R2. MySQL version is 4.1.22 running on a different machine with the same OS.
I completed the connection through a database link, which works fine in SQLPLUS when selecting small MySQL Tables. However, I keep getting an out of memory error when selecting certain large table from the MySQL database. Previously, I had tested the DNS and ran the same SELECT in Access and it doesn't give any error. This is the error thrown by SQLPLUS:
SQL> select * from progressnotes@mysql_rmg where "encounterID" = 224720;
select * from progressnotes@mysql_rmg where "encounterID" = 224720
ERROR at line 1:
ORA-00942: table or view does not exist
[Generic Connectivity Using ODBC][MySQL][ODBC 3.51
Driver][mysqld-4.1.22-community-nt]Lost connection to MySQL server during query
(SQL State: S1T00; SQL Code: 2013)
ORA-02063: preceding 2 lines from MYSQL_RMG
I traced the HS connection and here is the result from the .trc file:
Oracle Corporation --- THURSDAY JUN 12 2008 11:19:51.809
Heterogeneous Agent Release
10.2.0.1.0
(0) [Generic Connectivity Using ODBC] version: 4.6.1.0.0070
(0) connect string is: defTdpName=MYSQL_RMG;SYNTAX=(ORACLE8_HOA, BASED_ON=ORACLE8,
(0) IDENTIFIER_QUOTE_CHAR="",
(0) CASE_SENSITIVE=CASE_SENSITIVE_QUOTE);BINDING=<navobj><binding><datasources><da-
(0) tasource name='MYSQL_RMG' type='ODBC'
(0) connect='MYSQL_RMG'><driverProperties/></datasource></datasources><remoteMachi-
(0) nes/><environment><optimizer noFlattener='true'/><misc year2000Policy='-1'
(0) consumerApi='1' sessionBehavior='4'/><queryProcessor parserDepth='2000'
(0) tokenSize='1000' noInsertParameterization='true'
noThreadedReadAhead='true'
(0) noCommandReuse='true'/></environment></binding></navobj>
(0) ORACLE GENERIC GATEWAY Log File Started at 2008-06-12T11:19:51
(0) hoadtab(26); Entered.
(0) Table 1 - PROGRESSNOTES
(0) [MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt]MySQL client ran out of
(0) memory (SQL State: S1T00; SQL Code: 2008)
(0) (Last message occurred 2 times)
(0)
(0) hoapars(15); Entered.
(0) Sql Text is:
(0) SELECT * FROM "PROGRESSNOTES"
(0) [MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt]Lost connection to MySQL
(0) server during query (SQL State: S1T00; SQL Code: 2013)
(0) (Last message occurred 2 times)
(0)
(0) [A00D] Failed to open table MYSQL_RMG:PROGRESSNOTES
(0)
(0) [MySQL][ODBC 3.51 Driver]MySQL server has gone away (SQL State: S1T00; SQL
(0) Code: 2006)
(0) (Last message occurred 2 times)
(0)
(0) [MySQL][ODBC 3.51 Driver]MySQL server has gone away (SQL State: S1T00; SQL
(0) Code: 2006)
(0) (Last message occurred 2 times)
(0)
(0) [S1000] [9013]General error in nvITrans_Commit - rc = -1. Please refer to the
(0) log file for details.
(0) [MySQL][ODBC 3.51 Driver]MySQL server has gone away (SQL State: S1T00; SQL
(0) Code: 2006)
(0) (Last message occurred 2 times)
(0)
(0) [S1000] [9013]General error in nvITrans_Rollback - rc = -1. Please refer to
(0) the log file for details.
(0) Closing log file at THU JUN 12 11:20:38 2008.
I have read the MySQL documentation and apparently there's a "Don't Cache Result (forward only cursors)" parameter in the ODBC DNS that needs to be checked in order to cache the results in the MySQL server side instead of the Driver side, but checking that parameter doesn't work for the HS connection. Instead, the SQLPLUS session throws the following message when selecting the same large table:
SQL> select * from progressnotes@mysql_rmg where "encounterID" = 224720;
select * from progressnotes@mysql_rmg where "encounterID" = 224720
ERROR at line 1:
ORA-02068: following severe error from MYSQL_RMG
ORA-28511: lost RPC connection to heterogeneous remote agent using
SID=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.0.120)(PORT=1521))(CONNECT_DATA=(SID=MYSQL_RMG)))
Curiously enough, after checking the parameter, the Access connection through the DNS ODBS seems to improve!
Is there an aditional parameter that needs to be set up in the inithsodbc.ora perhaps? These are current HS paramters:
# HS init parameters
HS_FDS_CONNECT_INFO = MYSQL_RMG
HS_FDS_TRACE_LEVEL = ON
My SID_LIST_LISTENER entry is:
(SID_DESC =
(PROGRAM = HSODBC)
(SID_NAME = MYSQL_RMG)
(ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
Finally, here is my TNSNAMES.ORA entry for the HS connection:
MYSQL_RMG =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.120)(PORT = 1521))
(CONNECT_DATA =
(SID = MYSQL_RMG)
(HS = OK)
Your advice will be greatly appeciated,
Thanks,
Luis
Message was edited by:
lmconsiteFirst of all please be aware HSODBC V10 has been desupported and DG4ODBC should be used instead.
The root cause the problem you describe could be related to a timeout of the ODBC driver (especially while taking care of the comment: it happens only for larger tables):
(0) [MySQL][ODBC 3.51 Driver]MySQL server has gone away (SQL State: S1T00; SQL
(0) Code: 2006)
indicates the Driver or the DB abends the connection due to a timeout.
Check out the wait_timeout mysql variable on the server and increase it. -
Trouble connecting to MySQL database with Hibernate
I'm using red hat studio pro. I created an hibernate.cfg.xml file with
the hibernate tools.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_jar">mysql-connector-
java-5.0.6-bin.jar</property>
<property
name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</
property>
<property name="hibernate.connection.password"> </property>
<property name="hibernate.connection.url">jdbc:mysql://
localhost/eshop</property>
<property name="hibernate.connection.username">user</property>
<property
name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</
property>
</session-factory>
</hibernate-configuration>
Reverse Engineering was no problem, it found the database, could read
the tables and create the java classes.
Now I tried to open a simple connection to the database and that
doesn*t work. I always get a "no suitable driver found" error.
Code:
Configuration config = new Configuration()
.setProperty("hibernate.dialect",
"org.hibernate.dialect.MySQLInnoDBDialect")
.setProperty("hibernate.connection.driver_class",
"org.gjt.mm.mysql.Driver")
.setProperty("hibernate.connection.driver_jar", "mysql-connector-
java-5.0.6-bin.jar")
.setProperty("hibernate.connection.password", " ")
.setProperty("hibernate.connection.url", "jdbc:mysql://localhost:
3306/eshop")
.setProperty("hibernate.connection.username", "user")
.addClass(Adressen.class);
config.configure();
SessionFactory sessionFactory = config.buildSessionFactory();
Session session = sessionFactory.openSession();
Transaction tx = null;
try {
tx = session.beginTransaction();
System.out.println("works");
} catch (Exception e) {
if (tx != null) {
tx.rollback();
System.out.println("error - rollback");
} finally {
session.close();
sessionFactory.close();
The errors I'm getting are:
Code:
23:41:05,187 INFO [Environment] Hibernate 3.2.4.sp1
23:41:05,187 INFO [Environment] loaded properties from resource
hibernate.properties: {hibernate.co
nnection.username=user, hibernate.connection.password=****,
hibernate.dialect=org.hibernate.dialect.
MySQLInnoDBDialect, hibernate.connection.url=jdbc:mysql://localhost:
3306/eshop, hibernate.bytecode.u
se_reflection_optimizer=false,
hibernate.connection.driver_class=com.mysql.jdbc.Driver}
23:41:05,187 INFO [Environment] Bytecode provider name : javassist
23:41:05,203 INFO [Environment] using JDK 1.4 java.sql.Timestamp
handling
23:41:05,312 INFO [Configuration] Reading mappings from resource:
hibernateGenerated/Adressen.hbm.x
ml
23:41:05,312 INFO [Configuration] Reading mappings from resource:
hibernateGenerated/Adressen.hbm.x
ml
23:41:05,515 INFO [HbmBinder] Mapping class:
hibernateGenerated.Adressen -> Adressen
23:41:05,531 INFO [Configuration] configuring from resource: /
hibernate.cfg.xml
23:41:05,531 INFO [Configuration] Configuration resource: /
hibernate.cfg.xml
23:41:05,546 INFO [Configuration] Configured SessionFactory: null
23:41:05,656 INFO [DriverManagerConnectionProvider] Using Hibernate
built-in connection pool (not f
or production use!)
23:41:05,656 INFO [DriverManagerConnectionProvider] Hibernate
connection pool size: 20
23:41:05,656 INFO [DriverManagerConnectionProvider] autocommit mode:
false
23:41:05,656 INFO [DriverManagerConnectionProvider] using driver:
org.gjt.mm.mysql.Driver at URL: j
dbc:mysql://localhost/eshop
23:41:05,656 INFO [DriverManagerConnectionProvider] connection
properties: {driver_jar=mysql-connec
tor-java-5.0.6-bin.jar, user=user, password= }
23:41:05,656 WARN [SettingsFactory] Could not obtain connection
metadata
java.sql.SQLException: No suitable driver found for jdbc:mysql://
localhost/eshop
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at
org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionPr
ovider.java:110)
at
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:
84)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:
2009)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:
1292)
at sample.RegisterAciton.writeInDatabase(RegisterAciton.java:147)
at sample.RegisterAciton.execute(RegisterAciton.java:246)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:
484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:
1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:
525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
290
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
206)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:
96)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
235
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
230)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
175)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:
179)
at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:
84)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
104)
at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:
157)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
241)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
844)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:
447)
at java.lang.Thread.run(Unknown Source)
23:41:06,046 INFO [Dialect] Using dialect:
org.hibernate.dialect.MySQLInnoDBDialect
23:41:06,046 INFO [TransactionFactoryFactory] Using default
transaction strategy (direct JDBC trans
actions)
23:41:06,046 INFO [TransactionManagerLookupFactory] No
TransactionManagerLookup configured (in JTA
environment, use of read-write or transactional second-level cache is
not recommended)
23:41:06,046 INFO [SettingsFactory] Automatic flush during
beforeCompletion(): disabled
23:41:06,046 INFO [SettingsFactory] Automatic session close at end of
transaction: disabled
23:41:06,046 INFO [SettingsFactory] Scrollable result sets: disabled
23:41:06,062 INFO [SettingsFactory] JDBC3 getGeneratedKeys():
disabled
23:41:06,062 INFO [SettingsFactory] Connection release mode: auto
23:41:06,062 INFO [SettingsFactory] Maximum outer join fetch depth: 2
23:41:06,062 INFO [SettingsFactory] Default batch fetch size: 1
23:41:06,062 INFO [SettingsFactory] Generate SQL with comments:
disabled
23:41:06,062 INFO [SettingsFactory] Order SQL updates by primary key:
disabled
23:41:06,062 INFO [SettingsFactory] Order SQL inserts for batching:
disabled
23:41:06,062 INFO [SettingsFactory] Query translator:
org.hibernate.hql.ast.ASTQueryTranslatorFacto
ry
23:41:06,062 INFO [ASTQueryTranslatorFactory] Using
ASTQueryTranslatorFactory
23:41:06,062 INFO [SettingsFactory] Query language substitutions: {}
23:41:06,062 INFO [SettingsFactory] JPA-QL strict compliance:
disabled
23:41:06,062 INFO [SettingsFactory] Second-level cache: enabled
23:41:06,062 INFO [SettingsFactory] Query cache: disabled
23:41:06,062 INFO [SettingsFactory] Cache provider:
org.hibernate.cache.NoCacheProvider
23:41:06,062 INFO [SettingsFactory] Optimize cache for minimal puts:
disabled
23:41:06,062 INFO [SettingsFactory] Structured second-level cache
entries: disabled
23:41:06,078 INFO [SettingsFactory] Statistics: disabled
23:41:06,078 INFO [SettingsFactory] Deleted entity synthetic
identifier rollback: disabled
23:41:06,078 INFO [SettingsFactory] Default entity-mode: pojo
23:41:06,078 INFO [SettingsFactory] Named query checking : enabled
23:41:06,125 INFO [SessionFactoryImpl] building session factory
23:41:06,437 INFO [SessionFactoryObjectFactory] Not binding factory
to JNDI, no JNDI name configure
d
23:41:06,515 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState:
08001
23:41:06,515 ERROR [JDBCExceptionReporter] No suitable driver found
for jdbc:mysql://localhost/eshop
23:41:06,515 INFO [SessionFactoryImpl] closing
23:41:06,515 INFO [DriverManagerConnectionProvider] cleaning up
connection pool: jdbc:mysql://local
host/eshop
Can anybody tell me, what I'm doing wrong?ClassNotFoundException means the driver isn't loaded. "No suitable driver" usually tells me that the syntax in the connection URL is incorrect for some reason.
Make sure you have an up to date driver JAR:
http://www.mysql.com/products/connector/j/
The driver class name should be com.mysql.jdbc.Driver
% -
Getting null connection to mysql
following is the code to connect to mysql but am iConnection gets null value (it's not connecting however am able to connect to the database with these values otherwise)????? Help?? First time using JDBC............
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
String tURLString = "jdbc:mysql://localhost/empdb?user=root&password=admin";
boolean tStillTrying = true;
int tNumberOfTries = 0;
while (tStillTrying) {
try {
iConnection = DriverManager.getConnection(tURLString, "", "");
tStillTrying = false;
catch (Exception rException) {
tNumberOfTries++;
tStillTrying = (tNumberOfTries > 20);
if ( iConnection == null )
System.out.println("iConnection is null");
else
System.out.println("got connected to the database");DrClap is correct, of course, but I think your code should look more like this:
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
* A simple connection manager. A pool would be better.
public class ConnectionManager
public static final String DRIVER = "com.mysql.jdbc.Driver";
public static final String URL = "jdbc:mysql://localhost:3306/hibernate-in-action";
public static final String USERNAME = "admin";
public static final String PASSWORD = "";
public static void main(String [] args)
Connection connection = null;
try
connection = ConnectionManager.getConnection();
DatabaseMetaData meta = connection.getMetaData();
System.out.println("product name : " + meta.getDatabaseProductName());
System.out.println("product version: " + meta.getDatabaseProductVersion());
catch (Exception e)
e.printStackTrace();
finally
ConnectionManager.close(connection);
public static Connection getConnection()
return getConnection(DRIVER, URL, USERNAME, PASSWORD);
public static Connection getConnection(String driver,
String url,
String username,
String password)
Connection connection = null;
try
Class.forName(driver);
connection = DriverManager.getConnection(url, username, password);
catch (Exception e)
// Better to log this rather than printing stack trace
e.printStackTrace();
return connection;
public static void close(Connection connection)
try
if (connection != null)
connection.close();
catch (Exception e)
// Better to log this rather than printing stack trace
e.printStackTrace();
}This connected perfectly to MySQL running on my machine.
Be careful about closing your connections when you're done with them (and ResultSet and Statement, too).
% -
Slow database connection with mysql
I am using MySQL Server 5.0 as my backend and java1.5 as my front end for the GUI. The following statements I use to connect to MYSql.
Class.forName("com.mysql.jdbc.Driver").newInstance();
String url = "jdbc:mysql://localhost:3306/mysql";
The database access seems to be very slow.
I have a data file with about 3000 lines. The parser reads the file one line at a time, formats an insert query and calls executeUpdate. The process takes more than 2 minutes.
What is slowing down my process? Please help
ThanksI am using MySQL Server 5.0 as my backend and java1.5
as my front end for the GUI. The following statements
I use to connect to MYSql.
Class.forName("com.mysql.jdbc.Driver").newInstance();
String url = "jdbc:mysql://localhost:3306/mysql";
The database access seems to be very slow.
I have a data file with about 3000 lines. The parser
reads the file one line at a time, formats an insert
query and calls executeUpdate. The process takes more
than 2 minutes.
What is slowing down my process? Please help
ThanksHi,
1. Are you opening and closing the database connection ,During inserting every record from data file?
If so, please avoid opening closing connection for each query execution.
Because , opening and closing the database connection is a time consuming one.
You should open all the required database connections, before you use them or use
Database connection pooling if your application is sucah a big one.
2. Try PreparedStatment instead of Statement. Because Prepared statment query is
compiled and stored into Cache. so if you are executing the same query again and again, the compiled query will be picked up from cache, by replacing with new
parameters
3. Check the logic you used to pick record from datafile and insert into database .
4. Check your RAM size , if you installed database and jvm on same machine.
if so , increase your RAM size.
thanks,
nvseenu -
Connection to db rejected.Cannot connect to MySQL server
here is the excaption
connectToDb:02 - connection to db rejected.Cannot connect to MySQL server on localhost:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.net.BindException)
and her is the class
import java.io.*;
import java.sql.*;
import java.util.*;
public class DBconnect
{ final static private String _url = "jdbc:mysql://localhost:3306/diamonds"; //final static private String _driver = "sun.jdbc.odbc.JdbcOdbcDriver";
//final static private String _url = "jdbc:odbc:diamonds"; //final static private String _driver = "sun.jdbc.odbc.JdbcOdbcDriver";
public Connection _con = null;
//private static Driver driver = null;
private static Properties properties = null;
Statement stmt = null;
public PrintStream out;
**connectToDb **
public void connectToDb() throws IOException
//connect to the server and open the database
try{
Class.forName("org.gjt.mm.mysql.Driver");
//Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//driver = (Driver)Class.forName (_driver).newInstance();
properties = new Properties();
properties.put("user","sa");
properties.put("password","");
catch (ClassNotFoundException e)
System.out.println("class not found:");
e.printStackTrace();
catch (Exception e) {
e.printStackTrace();
throw new IOException("connectToDb:01- JDBC driver not found."+e.getMessage());
synchronized void open()throws Exception
try
if(_con == null)
try
_con = DriverManager.getConnection(_url,properties);
//_con = driver.connect(_url,properties);
catch (SQLException e)
e.printStackTrace();
System.out.println("connectToDb:02 - connection to db rejected."+e.getMessage());
stmt = _con.createStatement();
catch (Exception e)
e.printStackTrace();
System.out.println("connectToDb:02 - connection to db rejected."+e.getMessage());
synchronized void close()
try
if(_con != null)
if(!_con.isClosed())
stmt.close();
_con.close();
_con = null;
catch (Exception e)
System.out.println("es:fail to close connection!!");
}the problem occars when there are a lot of queries that the project is sending to the DB (about 10000) the last half queries fails and send an excaption .
after 2 minutes the system seems like working fine.
I am stack with this problem about a year and cann't resolve it.
any idea????
regards
amnon mwell...new it seems to work fine, but is it ok to
keep connection open for good ???
isn't there any other alternative ???I am bit confused are you pooling the connections?
If so, actually the connections will not always stay open.. they will time out after a while when they are not in use but to specifically answer your question.. how could it possible be a bad thing. If the server/your app was getting bogged down with opening and closing connections then pooling solves this..
Finally as to your question of the alternatives... if the problem was opening and closing connections and reusing them through a pool solved this then I think the answer is no. If you don't like a specific part of the way the pool works it is probably configurable in some way and you could always implement your own pool.. although I wouldn't overly recommend that. The bottom line is that you need to keep your connections open for reuse.. pooling is the simplest way to achieve this.. but no there is no alternative to keeping your connections open if you are having the load problems you described. -
Internet connection is dropping constantly - technical support useless so far
I have Verison for about 30 days and very unhappy with internet connection. speed is perfect but this connection get lost constantly. Once per hour or so. Interrupted games, video feeds, dropped calls with voip, e.t.c. And this is on wired line!
Never had issues with cable.
Talk several times to tech support - they tested, send me new router and I am still having the issue. I also tried my own router together with verizon, did not help much.
I read several post about it and probably spent more time that it worth for me.
I am one of the first verizon Fios customer on my block, because the service became available very recently.
Thinking of canceling Verizon service before 30 days of contract. Othervise it would be kind of joke if verizon charge me early termination fee for bad service.
Does anybody had simular issue and how it was resolved?This use to happen to me, i had to much bandwith traffic going on as i was putting out maximum throughput when i was hosting my home server, and a gaming server (this resulted in me repetitively getting kicked out of ps3 game rooms which i was defined as a host just because my connection was best).
Try seeing whats drawing the most bandwith, or heck remove it altogether, and then use just data, and see if it messes up, then from their you can pinpoint where the real issue is (bad modem/router, bad coax line) or if its one of your other devices (ex: Tv, phone) thats drawing data that is somehow affecting your speeds (or causing the drop outs). If this isn't the case, check your line that comes in, it maybe a direct connection but the possibility is that their is a minor break in the line (although if this were true chances are it wouldnt work AT ALL).
Perhaps theirs something interfearing with the COAX cable though, i'd check how it connects, or just for sake of argument, plugin the modem/router directly into/next to the FiOS unit just to see if that eliminates the issue altogether. Alota trouble shooting can go into this but... i'd suggest moving the router/modem and directly connecting it to the FiOS box where ever its installed. See if it still acts up, if not you have your answer, COAX issue somewhere. -
Connection to MySQL via ODBC not working
Hello all together,
I've got a problem with the ODBC connection to MySQL. The connection via ODBC is established and things like tnsping are working.
When I select some data within the SQL*Plus environment, I get no real result. For example "select table_name from all_tables@mysql;" returns nothing.
My entry in listener.ora:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME=odbc_mysql)
(ORACLE_HOME=D:\oracle\product\11.0.1\db_1)
(PROGRAM=dg4odbc)
My entry in tnsnames.ora:
MYSQL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA = (SID=odbc_mysql))
(HS=OK)
The initodbc_mysql.ora in ORACLE_HOME/hs/admin/:
HS_FDS_CONNECT_INFO = odbc_mysql
HS_AUTOREGISTER = TRUE
HS_DB_NAME = hsodbc
I tried some modifications but I still get no data from mysql database. When I try "select * from customer@mysql;" I get the correct number of records, the correct column names, but the content is always "¬¬¬¬". The odbc driver works, because with MS Access I can fetch the data. I'm using Oracle 11g Release 1 EE and MySQL ODBC 5.1.5.
What could be the reason for this?
Greetings,
Joergcreated in my UTF-8 Mysql DB your table and inserted a record; the select shows:
SQL> select * from "movieclass"@mysql;
idClass
ClassName
123
H e l l o
As you can see the content is there, the "space" between the letters is related to unicode. Each character is interpreted by 2 bytes and SQL*Plus wrongly displays both. Using iSQLPLus or SQLDeveloper does not show the "space" between the letters.
Here the data type mapping:
SQL> desc "movieclass"@mysql;
Name Null? Type
idClass NUMBER(3)
ClassName NOT NULL NVARCHAR2(50)
What's the exact version of DG4ODBC you're using? 11.1.0.7?
According to the listener file you're using DG4ODBC on Windows. There was a high/low byte issue in DG4ODBC for Windows. This issue is fixed in 11.1.0.7 and a certain patch. So I recommend you to get first the 11.1.0.7 patchset (if you don't already have it installed):
6890831 Oracle Database Family: Patchset
11.1.0.7.0 PATCH SET FOR ORACLE DATABASE SERVER 11.1.0.7.0
and then please apply also the latest patch:
8689191 Oracle Database Family: Patch
ORACLE 11G 11.1.0.7 PATCH 16 BUG FOR WINDOWS 32 BIT 11.1.0.7.0
There was a high/low byte issue
Edited by: kgronau on Aug 11, 2009 10:28 AM -
New error with upgrade jboss/tomcat: "Connection handle has been closed and is unusable"
Hi,
This error suddenly appeared when we upgraded from jboss3/tomcat5.0 to jboss4.2/tomcat5.5.
here's the usecase:
1) User clicks on report link
2) Crystal reports web componnent displays screen to fill in report parameters.
3) user enters parameters and clicks submit
4) System throws Exception
The same reports worked fine with jboss 3.2.6/tomcat 5.0. We haven't touched anything in this realm.
Log Excerpt:
09:42:18,842 INFO [datasource] Openning rowset
09:42:18,904 ERROR [reportdefinition] com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: Connection handle has been closed and is unusable
09:42:18,905 ERROR [datasource] Failed to open rowset: the query failed to open rowset
com.crystaldecisions.reports.reportdefinition.datainterface.g: JDBC Error: Connection handle has been closed and is unusable
at com.crystaldecisions.reports.reportdefinition.datainterface.d.a(Unknown Source)
To try to narrow down the problem, I've updated the jdbc configuration to
<track-statements>true</track-statements>
here's a recap:
This Boolean element specifies whether to check for unclosed statements when a connection is returned to the pool. If it is true, a warning message is issued for each unclosed statement. If the log4j category org.jboss.resource.adapter.jdbc.WrappedConnection has trace level enabled, a stack trace of the connection close call is logged as well. This is a debug feature that can be turned off in production.
Interestingly enough, this error appears slightly upstream:
(CachedConnectionManager.java:526) - Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@c76003
java.lang.Throwable: STACKTRACE
at
org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
at com.crystaldecisions.reports.queryengine.driverImpl.k.a(Unknown Source)
at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
at com.crystaldecisions.reports.queryengine.av.new(Unknown Source)
at com.crystaldecisions.reports.queryengine.av.byte(Unknown Source)
at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
at com.crystaldecisions.reports.dataengine.ba.try(Unknown Source)
at com.crystaldecisions.reports.common.av.a(Unknown Source)
at com.crystaldecisions.reports.common.ag.a(Unknown Source)
at com.businessobjects.reports.sdk.b.e.a(Unknown Source)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown
So the question arises:
1) Is the jboss datasource overly/aggressively closing result sets?
2) or is there a coding error in CRXIR2?
thanks,
bill
Full stack trace:
[2008-03-13 17:26:18,905] [INFO ] org.jboss.resource.connectionmanager.CachedConnectionManager (CachedConnectionManager.java:526) - Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@c76003
java.lang.Throwable: STACKTRACE
at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:290)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:417)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
at com.crystaldecisions.reports.queryengine.driverImpl.k.a(Unknown Source)
at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
at com.crystaldecisions.reports.queryengine.av.new(Unknown Source)
at com.crystaldecisions.reports.queryengine.av.byte(Unknown Source)
at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
at com.crystaldecisions.reports.dataengine.ba.try(Unknown Source)
at com.crystaldecisions.reports.common.av.a(Unknown Source)
at com.crystaldecisions.reports.common.ag.a(Unknown Source)
at com.businessobjects.reports.sdk.b.e.a(Unknown Source)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
at com.crystaldecisions.proxy.remoteagent.y.a(Unknown Source)
at com.crystaldecisions.proxy.remoteagent.r.a(Unknown Source)
at com.crystaldecisions.sdk.occa.report.application.cf.a(Unknown Source)
at com.crystaldecisions.sdk.occa.report.application.z.a(Unknown Source)
at com.crystaldecisions.sdk.occa.report.application.ak.if(Unknown Source)
at com.crystaldecisions.sdk.occa.report.application.ad.int(Unknown Source)
at com.crystaldecisions.sdk.occa.report.application.bk.for(Unknown Source)
at com.crystaldecisions.proxy.remoteagent.v.a(Unknown Source)
at com.crystaldecisions.proxy.remoteagent.v.if(Unknown Source)
at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(Unknown Source)
at com.crystaldecisions.sdk.occa.report.application.DatabaseController.setTableLocation(Unknown Source)
at com.crystaldecisions.reports.sdk.DatabaseController.setTableLocation(Unknown Source)
at org.apache.jsp.reports.processreport_jsp.switchTables(processreport_jsp.java:131)
at org.apache.jsp.reports.processreport_jsp.loadReport(processreport_jsp.java:68)
at org.apache.jsp.reports.processreport_jsp._jspService(processreport_jsp.java:227)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.participate.shared.pagecache.client.PageCacheFilter.doFilter(PageCacheFilter.java:760)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.participate.util.servlet.ExpiredPasswordFilter.doFilter(ExpiredPasswordFilter.java:92)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.participate.pe.channels.client.servlet.ChannelUrlFilter.processUrl(ChannelUrlFilter.java:168)
at com.participate.pe.channels.client.servlet.ChannelUrlFilter.doFilter(ChannelUrlFilter.java:100)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.participate.util.servlet.BlockIpAddressFilter.doFilter(BlockIpAddressFilter.java:224)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.outstart.multiapp.filters.KeepOtherSessionsAliveFilter.doFilter(KeepOtherSessionsAliveFilter.java:88)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.participate.util.servlet.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:151)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)<p>
OK. I found the problem along with a workaround.
</p>
<p>
<strong>The problem:</strong>
</p>
<p>
a programming practice clashes with a new jboss 'safety check'.
</p>
<p>
<strong>Programming practice:</strong>
</p>
<p>
crystal reports gets a database connection in one jsp page, then tries to use it on another jsp/servlet
</p>
<p>
<strong>Jboss safety check:</strong>
Jboss/tomcat new comes configured out-of-the-box with a 'cached connection
manager', which
</p>
<p>
"Check[s] for unclosed connections and transaction terminated checks in servlets/jsps."
</p>
<p>
<strong> Summary</strong>
</p>
<p>
In short, if a servlet/jsp ends and it leaves a database connection open, Jboss will automatically close it.
</p>
<p>
</p>
<p>
<strong>Workaround:</strong><br />
Comment out two entries in these two files:
</p>
<p>
1) conf/jboss4/pe/deploy/jboss-web.deployer/server.xml
</p>
<p>
2) conf/jboss4/pe/deploy/jboss-web.deployer/META-INF/jboss-service.xml
</p>
<p>
The two entries:
</p>
<p>
</p>
<p>
1)
</p>
<p>
<Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve"<br />
cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"<br />
transactionManagerObjectName="jboss:service=TransactionManager" /><br />
</p>
<p>
2)
</p>
<p>
<depends>jboss.jca:service=CachedConnectionManager</depends><br />
</p>
<p>
</p>
<p>
<strong>Comments on the workaround</strong>
</p>
<p>
The 'cached connection manager' basically makes sure that the application cleans up after bad programmers. It seems most helpful in development, load testing, or trouble shooting.
</p>
<p>
In production, you can likely comment them out with minimal
impact on the application.
</p> -
Can't connect PHP/MySQL 404 error
Wow, the learning curve is killing me. Yet another challenge. I'm using Dreamweaver CC and this tutorial http://www.adobe.com/devnet/dreamweaver/articles/setup_php.html
I'm at this step:
Open comments.php. You must have a PHP page open in the Document window to create a MySQL connection.
In the Databases panel (choose Window > Databases), click the Plus button on the panel and select MySQL Connection.The MySQL Connection dialog box appears.
Type connTest as the connection name.
For the MySQL Server, type localhost.If you are using the MAMP default ports on a Mac, use localhost:8889.
For the User Name, type phptestuser.
Type the password you chose for the phptestuser account in the Password field.
For the Database, type php_test.Note: You don't need to precede the underscore with a backslash here. It was inserted by phpMyAdmin in the previous section (see Figure 20) only because phpMyAdmin uses a query that permits wildcard characters.
Click Test.Dreamweaver attempts to connect to the database. If the connection fails, do the following:
Double-check the server name, user name, and password.
Check the settings for the folder Dreamweaver uses to process dynamic pages (see Specifying a Testing Server for Dreamweaver).
Verify that the web and MySQL servers are both running.
Temporarily disable any firewall or security program. If the connection works, you need to configure the security program to permit communication between Dreamweaver and MySQL.
Click OK. The new connection appears in the Databases panel.
Expand the connTest connection, and then expand the Tables branch. You'll see the comments table in the database, which you can expand to reveal the details of the table columns (see Figure 23).
As far as I can tell I have followed this tutorial to the letter.
As far as I can tell, XAMPP/php mySQL are all running fine, the files are in the correct place and everything should be working. However when I hit test I get a 404 error. (Same error when I hit the select button.)
The suggested problems on the 404 message are:
1. There is no testing server running on the server machine.
Pretty sure the testing server is running. Is there any way to test this, other than to note that xampp is definitely running right now and that I can log into phpMYadmin no problem?
2. The testing server specified for this site does not map to the http://localhost/php_test/_MMServerScripts/MMHTTPDB.php URL Verify that the URL Prefix maps to the root of the site.
Ummm...I'm pretty sure I put things where I was told to put them in the tutorial, but I'm lost at this point where I should verify what. A clue here? The files are where they are supposed to be, but maybe I entered something wrong? Except...I'm not sure what that could be or where to find it. Whatever IT is.
Everything in local files is looking good.
Thanks for your help!
PS: Extra points to anyone who figures out how to make copy/pasteable error messages! These buggers are the bane of my life!Bgupta, you rock!
I hope you have copied the "mysql.php" and "MMHTTPDB.php" files from "C:\Users\username\AppData\Roaming\Adobe\Dreamweaver CC\locale\Configuration\Connections\Scripts\PHP_MySQL\_mmDBScripts" to "C:\xampp\htdocs\phptest\_mmServerScripts"
This was EXACTLY the problem. I checked the tutorial and I couldn't even find where the tutorial said to do this. (If I missed it, let me know where in the tutorial it was, please.)
Fixed! -
'Connection has already been closed'. Random error connecting with a pool
Hi all,
I've got a problem I cannot solve, and really hope in someone's help...
The fact is: I'm working on a webapp which doesn't made use of frameworks or patterns or similars. I introduced the DAO pattern in order to organize and speed up the work. At the core of the new classes there is the DBDAO, and this is the way it obtains the connection:
protected Connection conn = null; ... protected Connection getConnection() { try { if (conn == null || conn.isClosed()) { Context ctx = new InitialContext(); javax.sql.DataSource ds=null; ds =(javax.sql.DataSource) ctx.lookup( "agespPool" ); conn = ds.getConnection(); conn.setAutoCommit(false); } } catch (Exception ne) ...
Every new class that needs to access the db extends DBDAO and retrieves the conn with this method. In order to make things work without changing all the code, I modified the old class named 'Connessione' and made it extend DBDAO. Here is its method:
public class Connessione extends DBDAO{ ... public static synchronized Connection getConnessione() throws Exception { return new Connessione().getConnection(); }
That's all. Finished with the code.
Now, if someone uses the new classes extending DBDAO, all goes well. But for some old function that still work with Connessione.getConnessione(), connection closes suddenly with no reason.
For example, calling a page with some combo box populated with a db connection, you catch a:
java.sql.SQLException: Connection has already been closed. at weblogic.jdbc.wrapper.PoolConnection.checkConnection(PoolConnection.java:63) at weblogic.jdbc.wrapper.ResultSetMetaData.preInvocationHandler(ResultSetMetaData.java:37) at weblogic.jdbc.wrapper.ResultSetMetaData_oracle_jdbc_driver_OracleResultSetMetaData.getColumnType(Unknown Source) at it.praxis.tim.agesp.pub.sql.PagingList.populate(PagingList.java:98) at it.praxis.tim.agesp.pub.sql.PagingList.executeSQL(PagingList.java:53) at jsp_servlet._jsp._todolist_new._richiesta.__listarichieste._jspService(__listarichieste.java:353) at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
or sometimes:
- 20080417141147: <E> HtmlSelect.createHtmlSelect(4) - Errore! java.sql.SQLException: Result set already closed - 20080417141147: <E> HtmlSelect.createHtmlSelect(7) - Errore! java.sql.SQLException: Connection has already been closed. - 20080417141147: <E> ERRORE: ricercaRichieste : java.sql.SQLException: Statement has already been closed
That is, the conn is closed while used to populate the combo box. I don't understand who closes it.
Moreover, that happens randomly: 1 or 2 times over 4 hits on the page. The other times, all goes well. Most of the other pages, all goes well. So I don't think I have to search for a bug in the code.
Now, I'm working with BEA WL 8.1 sp 5 and Oracle 9.2.0.1.0 .
The error turns out even if I work locally (with Tomcat 5.5.23).
The webapp made use of a custom driver beforehand, and I replaced it with oracle's driver.
I tried to set the Connection Pool with oracle.jdbc.driver.OracleDriver and oracle.jdbc.OracleDriver .
I left the default for the connection pool, and then tried to set (BEA):
Connection Reserve Timeout: -1
Test Created Connections: On
with no changes.
The connection suddenly and randomly closes.
Any help would be appreciated...
Many thanksthe thing that you are instantiating isn't a Connection object, it's a Connessione object. That's returning one that's either been stashed from a previous call, or
acquires one from the data sourcea new Connessione object means a call to getConnection that means a new Connection object. That code is synchronized, it has to be a new object.
It is entirely possible that conn is not null if other actions have taken place in your constructor. Even assuming it is null, we don't know anything about the
connection pool you're trying to use, though it looks like it's probably weblogic's one.The contructor doesn't know of the connection. As for the pool, it is weblogic's one.
And even assuming both of these cases, we have no particular reason to believe that you're calling the getConnessione() method instead of accidentally calling
getConnection() and thus no reason to believe that you're definitely carrying out the actions that you believe you're carrying out.I wrote that the problem comes out in the old code that once worked fine. That code only uses Connessione.getConnessione() .
Conversely we have an error message that says you're closing connections elsewhere. Clearly there's a bug. It's presumably in your assumptions. You're
arguing instead of checking them.If I have a wrapper logging the close() calls, I have to see every call logged. Even if there's a bug (but remember that the code worked fine with a previous custom datasource), why do you think I shouldn't see that close() logged?
I may be wrong, but I already searched in that code. I'm arguing after all the checks.
There is no other thread that can see that connHow do you know? I have that Connessione.getConnessione() in a jsp. It's synchronized. That gives a new connection. I see it passed only to an utility class that queries the db and reads the resultset.
Who do you think can access that connection? -
I can't connect to MySQL database from The JSP Standard Tag Library
Hi All !
I have a problem, please help me anybody !
I don't connect to MySQL database from jsp page using JSTL tag but from servlet all work correctly. I set my path and put �mysql-connector-java-3.1.13-bin.jar� in ENVIRONMENT WinXP(classpath=C:\Java\jdk1.5.0_10\jre\lib\ext\mysql-connector-java-3.1.13-bin.jar) and in War project folder �WEB-INF/lib� and in [TomcatServer]\common\lib.
I have in folder�WEB-INF/lib� following files:
antlr.jar
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-fileupload.jar
commons-logging.jar
commons-validator.jar
jakarta-oro.jar
jsf-api.jar
jsf-impl.jar
jstl.jar
mysql-connector-java-3.1.13-bin.jar
standard.jar
struts.jar
I'm using:
NetBeans 5.5 Build200610171010 (bundled Tomcat 5.5.17)
Ent.Pack 20061020 Visual Wb Pack 061103
OS WinXP SP2
Java 1.5.0_10
MySQL 5.0.18-nt
1:<%@page contentType="text/html"%>
2:<%@page pageEncoding="UTF-8"%>
8: <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
9: <%@taglib uri="http://java.sun.com/jstl/sql" prefix="sql"%>
10:
11: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
12: "http://www.w3.org/TR/html4/loose.dtd">
13:
14: <sql:setDataSource var="ds"
15: driver="com.mysql.jdbc.Driver"
16: url="jdbc:mysql://localhost:3306/test"
17: user="root"
18: password="xxxx"/>
19:
20:
21:<sql:query sql="select name, age from People" var="res"
22: dataSource="${ds}"/>
I have received report on mistake when entered code at the top:
�/index.jsp [21;0] According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions�
I used instead of (dataSource="${ds}")->(dataSource="ds") but this did not work.
After build and run I have received
=========================================START=================================
HTTP Status 500
type Exception report:
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /index.jsp(21,0) According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
root cause
org.apache.jasper.JasperException: /index.jsp(21,0) According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:955)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:710)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Validator.validate(Validator.java:1489)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:166)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
Apache Tomcat/5.5.17
=======================================END================================
Error: "According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions" - but according to documentation such parameter possible.
BUT WHEN JOINING With DATABASE FROM SERVLET ALL WORK FINE.
I read this doc - [http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html], this applicable if I Tomcat Admin, but i'am not Admin
I simply user, i.e. I want to place its database on virtual host (Tomcat+(JSP-JSTL)+MySQL).
There is idea how can resolve this problem
Thank you in advance ;)For all how have similar problem.
Decision instead of these ways
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
it is necessary to indicate these
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -
How can I connect to MySQL external database
Hello.
I have a SAP system running in SQL Server 2003.
I need to connect to external MySQL DB., to operate with this information in ABAP program.
I have done the step necesary... I mean I go to DBCO transaction and configure the connection like this:
DB CONNECTION --> AFIS
DBMS --> MSS
user name --> xxxxxx
DBpass -->xxxxxx / xxxxxx
Conn Info -->MSSQL_SERVER=192.168.1.233 MSSQL_DBNAME=alliance OBJECT_SOURCE=alliance
I do a test program, when I do the statement CONNECT TO, sy-subrc 0 and connection = DEFAULT... I mean, with this form I cannot connect to MySQL Database...
Can you help me to do this?? I think the problem it's the connection string in DBCO... but I'm not sure...,
Would be possible to connect by MySQL ODBC??? I mean , installing the ODBC driver in my SAP server, and using this in ABAP Program??
Thks.
DATA: BEGIN OF wa,
cod_modelo(20),
END OF wa.
DATA: dbs TYPE dbcon-con_name.
DATA: con(20) TYPE c.
DATA : ls_wa LIKE wa.
con = 'AFIS'. "DB Connection in DBCO above
EXEC SQL.
CONNECT TO :con
ENDEXEC.
WRITE sy-subrc. ---> The result it's 4
EXEC SQL.
GET CONNECTION :con
ENDEXEC.
WRITE : con. --> The result it's DEFAULT
EXEC SQL.
SET CONNECTION DEFAULT
ENDEXEC.
write : con. --> The result it's DEFAULT> It's for it, that when I go to DBCO... in DBMS ---... I can select Oracle, MSSQLServer, DB2... for this Databases..., exists the library (lib_dbsl)???
yes, for all those databases exists the database interface library.
> In resume:
> IT'S NOT POSSIBLE CONNECT TO MYSQL!!! ... I cannot believe it!!!...
Well - as far as I remember there were some times ago efforts to port SAP applications to MySQL. That would explain why there's also a file "DDLMYS.TPL" created if you execute R3ldctl during a system copy - amongst DDL files for all other databases. I believe this was at the time MySQL was promoting SAPDB/MaxDB.
MySQL is historically not a database engine for software, that requires transactional integrity; there were extensions to support that (InnoDB or others) and there was no customer demand in getting MySQL as engine for SAP applications. And only develop an interface to be able to connect to an external MySQL engine is not worth the effort.
However, there is hope Some BusinessObjects applications also run with and against MySQL engines, depending on how the strategy to integrate those into the SAP software stack there may (or may not) be an interface for that database in the future.
Markus
Maybe you are looking for
-
Mail: how to send out emails with graphics embedded?
I'm just wondering if the protocol has changed ... I'm wanting to send out multiple emails with a graphic, that will open in diverse Browsers, Apple and PC. Is there a way to do it without having to embed the graphic somewhere up on the web and writ
-
More than 4 places after the decimal for the slope of line equation?
Hello I'm doing some graphing for chemistry class and I'm trying to find where in Numbers I can change the preference for the trendline equation.(y=mx+b) Currently m is only showing up to 0.xxxx . I need it to show at least 7 or 8 places. Or even bet
-
Still no Outlook toolbar, x64, Office 2010?
A while ago I installed Acrobat 9 on Windows 7, 64 bit with Office 2010. One thing that annoyed me was the lack of an Acrobat toolbar within Outlook, and no way to click a PDF button from within Office applications to create a PDF file through Acroba
-
I can't download mavericks to late 2011 macbook pro???
im having trouble downloading os x 10.9.1 - can anyone tell me why please?
-
Why won't my apps open after I updated them ?
A few days ago I updated all my apps that needed updates (about 14). However , 2 of those apps didn't update right away (Flixster and TheScore sports) and an error message was displayed which I stupidly did not read and just pressed ok. After I press