Quantcast
Channel: MySQL Forums - Connector/J, JDBC and Java
Viewing all 884 articles
Browse latest View live

Open Office as MySQL client (no replies)

$
0
0
In the past, some Open Office database users, when they wanted to go beyond using the embedded engine, tried connecting to MySQL servers with the JDBC connector.

Open Office now has it's own, native, MySQL connector... it is a normal "extension".

For help with getting MySQL (server) and Open Office "Base" (dreadful name!) (client) "playing nicely" together, see....

http://sheepdogguides.com/srv/s0MySqlDoInst.htm

connector/MXJ hangs with Hudson builds (no replies)

$
0
0
Hello, I'm hoping that someone reading this post has successfully run JUnit tests with the embedded mysqld (connector/MXJ) on Hudson. Currently connector/MXJ tests run great locally - Linux / Windows but they hang when executed on our Hudson build server. Any help in one of two areas would be greatly appreciated:
1. the problem listed above
2. A reasonable alternative for in-memory mysql unit testing. I've also tried H2, but have run into issues where native mysql syntax and functions is not supported. For instance H2 doesn't understand the "using" syntax for joining tables

Thanks very much for any information you can throw my way!

java webstart mysql-connector-java calls -bin library (no replies)

$
0
0
I have a java webstart project using mysql-connector-java-5.1.24.jar . When installing I can see in the traffic to the server that webstart gets the mysql-connector-java-5.1.24.jar.
But when the application uses the driver, when getting the connection to the DB, suddenly webstart is calling the server for another library, mysql-connector-java-5.1.24-bin.jar (-bin is added) which of course is not available and thus returns a 404 answer.
When I change the version to 5.1.13, the same happens , mysql-connector-java-5.1.13-bin.jar is called, the version changes also.
And it is called several times, depending on the java version. java6 +- 20 times, java7 +- 30 times.
And apparently the extra library is not needed because my application works as expected. It's just very annoying that it generates so much errors and takes all that unnecessarily network traffic.
I get this on jboss 4.0.5 and tomcat 7.
An idea anybody ? Where should I file this?

JDBC Jar Error in DtSQL (1 reply)

$
0
0
I installed MySQL server on Windows Box and use a db tool (DtSQL)
in Linux or Mac OS trying to connect the MySQL in
Windows. Both receives error and I checked the
error message, it looks the failure does nothing with DtSQL,
it should be something wrong with the MySQL JDBC
jar file.


Question: Can the MySQL JDBC jar file connect cross
platform ? or it depends on some native code
in the OS ?

I check some other JDBC jar files,
like DB2, it does work.

Thanks.

Problem upgrading to mysql-connector-java-5.0.8 (2 replies)

$
0
0
Hello All,
I have a web server talking to a MySQL server.
The configuration is as following:
Web server:
REDHAT 8
Java - j2sdk1.4.2_05
mysql-connector-java-3.0.7-stable-bin.jar
MySQL server:
mySQL 4

Both servers were working fine.

I then upgraded the mysql-connector to mysql-connector-java-5.0.8-bin.jar

I have exceptions returned from my web page:
exception

org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

java.lang.NullPointerException
org.apache.jsp.Main_005fMap_jsp._jspService(Main_005fMap_jsp.java:287)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Hope someone will give suggestions on what is wrong.
Tks

Connecting to mysql database in Netbeans (3 replies)

$
0
0
Hi,

I don't know how to connect to a mysql database in Netbeans. I tried to download the mysql-admin file to set the 'Path/URL to admin tool' in Admin properties (MySQL Server properties). But I don't know where to download it. When I try to connect without this file I get the following message:

Unable to connect to the MySQL server:

org.netbeans.api.db.explorer.DatabaseException: org.netbeans.api.db.explorer.DatabaseException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server..

The server may not be running or your MySQL connection properties may not be set correctly. Do you want to edit your MySQL connection properties?

I hope that someone knows where to get this file and how I can connect to the mysql database.

Thanks in advance,

ODBC 64bit driver bug? (1 reply)

$
0
0
ODBC Driver 64 bit have a bug, when i run it as a Java web application on a windows 7 64 bit PC to execute "SELECT * FROM Cares". there are a error "[Microsoft][ODBC Driver Manager] Invalid string or buffer length" .

but if I use debug model to execut it will successful to get the data back.

then i have try change to a 32 bit windows7 to execute is SQL, i also can get the data back.

can you please let me know how fix this problem , because this program must running in a 64 bit service.

Many Thanks in Advance,

jdbc "Communications link failure" / Logging myql (1 reply)

$
0
0
Hi,

We are facing a problem. At night we are running several proccesses on a Mysql (Server 5.1.61) and we are getting the exception from jdbc

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 7.200.068 milliseconds ago. The last packet sent successfully to the server was 8.333.893 milliseconds ago.
...
with nested Exception:

Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:114)
at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:161)
at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:189)
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2499)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3008)


Our wait_timeout is set to 8h which should not be exceeded by the proccesses, because they are stopping after ca 2h.
max_connections is set to 800 which also should not be exceeded.
Is there a logging where i can have a look into, what has happened?

Regards
Stefan

Error rebooting my Database Service (1 reply)

$
0
0
Hi everybody,

I have the next error in my apache tomcat server. I has read that is very common, but the solutions suggested hasn't worked for me:

2013-05-08 10:12:35,558 ERROR [org.hibernate.transaction.JDBCTransaction] - JDBC begin failed
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was XXX milliseconds ago. The last packet sent successfully to the server was XXX milliseconds ago.

It happens when my database is reboot but no the Tomcat Server. And the error only happens once. The next call works fine.

Despite of my JDBC url has the autoReconnect=true parameter. The host is reachable too and all the DNS were resolved correctly.



Thanks

useCompression=true and potential Memory leak due to connection tracking via CompressionInputStreamMemoryLeak (8 replies)

$
0
0
Hi there,

We came across an issue on one of our systems towards the end of last week, where the application was growing in memory use. Upon analysing the hprof of a couple of replica systems, it was noticed that there seemed to be a consistency across the hprof's with that of a growing number of JDBC4Connection objects in memory. For a proportion of those JDBC4Connections, the "forceClosedReason" was filled out; and as a result the JDBC4Connection shouldn't really be strong referenced anymore.

The only class that seemed to have strong reference to the JDBC4Connection was that of the static map "connectionPhantomRefs" in NonRegisteringDriver and the associated ConnectionPhantomReference.

The date the issue of increasing memory usage (akin to a Memory Leak) also co-incided with our upgrade to 5.1.23 of Connector/J.

----

I've spend some time trying to understand where the issue is occurring, and I beleive I have managed to replicate the issue in a sample piece of code; removing the application code from the equation.

From what seems to be occurring is that when "useCompression=true" is enabled, the NonRegisteringDriver.trackConnection(this) is holding onto the Connection; even though the application no longer has a strong reference to the Connection. With "useCompression=false", the Connections are not held onto and the Leak does not occur.

From what it looks like is that the CompressionInputStream is keeping the JDBC4Connection object alive, for which the ConnectionPhantomReference is monitoring for pre-gc clean up. The CompressionInputSteam itself has a reference to the JDBC4Connection, and the ConnectionPhantomReference has a strong reference to the CompressionInputStream via the NetworkResource object:



ConnectionPhantomReference ---> NetworkResources

NetworkResources ---> io (MysqlIO) ----> CompressedInputStream

CompressedInputStream ---> JDBC4Connection




I think this might be solvable via the use of a WeakReference in CompressedInputStream, but I don't know if this use of a WeakReference may cause regression elsewhere.

I've attempted to document the investigation into the issue here:

https://github.com/tootedom/CompressionInputStreamMemoryLeak

With the sample code to replicate it. I hope the write up/investigation makes sense, and that I've not over looked something, but apologies if I have indeed gone down the wrong track on this.

Is anyone else witnessing this slow growth in the number of connections in the heap? Or is this issue already known about?


Thanks in advance for any assistance. Please let me know if I've mis-represented anything, or if anything requires clarifying.


cheers
/dom

Connecting a MySQL database (no replies)

$
0
0
Hi,

Sorry for the dumb newbie question. I hope it's an easy answer.

I'm working with a developer overseas on a website that uses a database and he just sent me the root folder to run in the tomcat server, so I can run the site on localhost. He uses a datanucleus parameters file to set the path and login info to the database.

I have MySQL server running and also tomcat. But for some reason the web app won't connect to the database.

Any ideas of things I should check?

Thanks!

Problems with SELECT INTO OUTFILE with EclipseLink JPA Provider (no replies)

$
0
0
We have developed an application that is deployed into weblogic application server.
This application executes one SELECT INTO OUTFILE statement using one defined JDBC resource. Database access uses JPA with EclipseLink provider with next configuration:

<persistence-unit name="HandleData" transaction-type="JTA">
<jta-data-source>jdbc/HandleData</jta-data-source>
<properties>
<property name="javax.persistence.ddl-generation" value="update" />
<property name="eclipselink.logging.level" value="INFO"/>
<property name="eclipselink.cache.shared.default" value="false"/>
</properties>
</persistence-unit



And we are obtaining the following exception while trying to execute the mentioned query in the logs:

[#|2013-05-22T15:32:27.107+0200|FINEST|ece|com.ericsson.jee.ngin.asc.dao.impl.AscAccessDataBean|_ThreadID=79;_ThreadName=[ACTIVE] ExecuteThread: '43' for queue: 'weblogic.kernel.Default (self-tuning)';ClassName=com.ericsson.jee.ngin.asc.dao.impl.AscAccessDataBean;MethodName=generateSnapshotOneTable;_RequestID=<unavailable>|Attribute AscEricssonSubscribers Query: SELECT 'Msisdn','CarrierCode','AscProfileId','AscBarringProfileId','AdminBlocking' UNION SELECT * FROM asc_subscribers INTO OUTFILE '/home/asc/db_snapshots/AscEricssonSubscribers_20130522_153227.txt' FIELDS TERMINATED BY ':';|#]

[#|2013-05-22T15:32:27.109+0200|SEVERE|ece|com.ericsson.jee.ngin.asc.dao.impl.AscAccessDataBean|_ThreadID=79;_ThreadName=[ACTIVE] ExecuteThread: '43' for queue: 'weblogic.kernel.Default (self-tuning)';ClassName=com.ericsson.jee.ngin.asc.dao.impl.AscAccessDataBean;MethodName=generateSnapshotOneTable;_RequestID=<unavailable>|org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:333)
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:687)
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:530)
org.eclipse.persistence.internal.sessions.AbstractSession.executeCall(AbstractSession.java:914)
org.eclipse.persistence.internal.sessions.IsolatedClientSession.executeCall(IsolatedClientSession.java:131)
org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:206)
org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:192)
org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:263)
org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelect(DatasourceCallQueryMechanism.java:245)
org.eclipse.persistence.queries.DataReadQuery.executeNonCursor(DataReadQuery.java:188)


Is additional configuration needed in persistence.xml file?

Thanks a lot for your support

Best Regards,
Jorge

jdbc replication driver and slave alignement (1 reply)

$
0
0
Hi, I am using the connection pool with the com.mysql.jdbc.ReplicationDriver driver .
We have many slave and the ReplicationDriver is very usefull for to have a load balance but I would to ask if the connector is also able to detect alignement problem of the slave and remove from the pool the slave non aligned.
thanks
Simone

Regarding "Communications link failure" in MYSQL -5.5.21 and Jboss 5.1.2 (5 replies)

$
0
0
Hello Folks,

Could you please help me on the below issue?

Event: While doing AP → DB process, there is a process which run SQL for long time, when passing 3600 seconds(60 minutes) then the session was disconnected and an error occurred in Jboss side then after that it became the status which the process was not running normally unless rebooting the instance of Jboss. No issues if it is processing within 3600 seconds.

Error in Jboss Log:

***************************************************************

2013-01-28 16:13:29,301 WARN [org.apache.commons.validator.ValidatorResources] (ajp-XXXXXX%2F137.153.101.96-8009-7) Form 'XXX030021Form' not found for locale 'ja_JP'
2013-01-28 16:15:11,783 WARN [org.jboss.resource.connectionmanager.TxConnectionManager] (ajp-XXXXXX%2F137.153.101.96-8009-3) Connection error occured: org.jboss.resource.connecti
onmanager.TxConnectionManager$TxConnectionEventListener@710feed9[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@141c8ac5 handles=1 lastUse=1359353701119 permit=true track
ByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@5dda95d3 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@39a27fc8 xaResource=org.jboss
.resource.connectionmanager.TxConnectionManager$LocalXAResource@5b734107 txSync=null]
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 3,610,253 milliseconds ago. The last packet sent successfully to the server was 3,610,252 milliseconds ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3102)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2991)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3532)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2624)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2127)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2293)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:342)
at XXXX.XXX.common.db.XXXNamedPreparedStatement.executeQuery(XXXNamedPreparedStatement.java:252)
at XXXX.XXX.common.db.XXXDbOperator.executeQuery(XXXDbOperator.java:317)
at XXXX.XXX.XXX01info.dao.impl.XXX010010DaoImpl.search(XXX010010DaoImpl.java:826)
at XXXX.XXX.XXX01info.logic.XXX010010Logic.search(XXX010010Logic.java:224)
at XXXX.XXX.XXX01info.action.XXX010010Action.action(XXX010010Action.java:70)
at XXXX.XXX.common.action.XXXAction.execute(XXXAction.java:365)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
at XXXX.XXX.common.processor.XXXStrutsRequestProcessor.process(XXXStrutsRequestProcessor.java:120)
at XXXX.XXX.common.servlet.XXXActionServlet.process(XXXActionServlet.java:146)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at XXXX.XXX.common.filter.XXXEncodingFilter.doFilter(XXXEncodingFilter.java:60)
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:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.internalProcess(ActiveRequestResponseCacheValve.java:74)
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:47)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:436)
at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:385)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
at java.lang.Thread.run(Thread.java:679)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:185)
at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:114)
at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:161)
at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:189)
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2549)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3002)
... 45 more
2013-01-28 16:15:11,785 WARN [XXXX.XXX.common.db.XXXNamedPreparedStatement] (ajp-XXXXXX%2F137.153.101.96-8009-3) [ip:43.29.15.247] (SQL??)<<SQL:XXX010010DaoImpl.s
earch>> [ErrorCode:0] [SQLState:08S01] [Message:Communications link failure

The last packet successfully received from the server was 3,610,253 milliseconds ago. The last packet sent successfully to the server was 3,610,252 milliseconds ago.]
2013-01-28 16:15:11,787 WARN [XXXX.XXX.common.servlet.XXXActionServlet] (ajp-XXXXXX%2F137.153.101.96-8009-3) [ip:43.29.15.247] [elapsed time:3,610,312ms] [pid:XXX01
0010] [aid:search] [uri:/arcstar/XXX010010.*] [ip:43.29.15.247]
2013-01-28 16:15:13,630 ERROR [XXXX.XXX.common.servlet.XXXLoginServlet] (ajp-XXXXXX%2F137.153.101.96-8009-3) [ip:43.29.72.226] ?????????:Connection is not a
ssociated with a managed connection.org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6@433707e2
java.sql.SQLException: Connection is not associated with a managed connection.org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6@433707e2
at org.jboss.resource.adapter.jdbc.WrappedConnection.lock(WrappedConnection.java:97)
at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:254)
at XXXX.XXX.common.db.XXXNamedPreparedStatement.<init>(XXXNamedPreparedStatement.java:197)
at XXXX.XXX.common.db.XXXNamedPreparedStatement.<init>(XXXNamedPreparedStatement.java:128)
at XXXX.XXX.common.db.XXXDbOperator.executeQuery(XXXDbOperator.java:311)
at XXXX.XXX.common.db.XXXDbOperator.getBeanList(XXXDbOperator.java:757)
at XXXX.XXX.common.util.XXXPrivilegeUtil.getSpecialAuthorityGrps(XXXPrivilegeUtil.java:96)
at XXXX.XXX.common.util.XXXResourceUtility.getSpecialAuthority(XXXResourceUtility.java:318)
at XXXX.XXX.common.util.XXXRolesUtil.setSpecialAuthority(XXXRolesUtil.java:2043)
at XXXX.XXX.common.util.XXXAwsUtil.setUserInfo(XXXAwsUtil.java:234)
at XXXX.XXX.common.servlet.XXXLoginServlet.doXXXPost(XXXLoginServlet.java:183)
at XXXX.XXX.common.servlet.XXXLoginServlet.doPost(XXXLoginServlet.java:82)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
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:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.internalProcess(ActiveRequestResponseCacheValve.java:74)
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:47)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:436)
at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:385)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
at java.lang.Thread.run(Thread.java:679)

***************************************************************

We are using the below ,

MySQL 5.5.21
Jboss 5.1.2
OpenJDK 1.6.0_22
Redhat Linux 5.7

I am thinking that the root cause is the connection error that is occurring at the mysql driver level and there is an external change that is causing the communication link failure and this is not originating from the application server. It is manifesting at the driver level. Please confirm?

Could you please let me know the following,

1) Countermeasure to avoid the session disconnection at 3600 seconds?
2) Cause for not performing normally if it takes 3600 seconds ?
3) How to solve this issue ?

Please let me know if you need more information.

Thanks in advance for you suggestions and solutions.

connect to MYSQL with servlet (2 replies)

$
0
0
Hello.

Okay I have been struggeling with a problem the past two days, and I Cant figure why, so I am pretty much stock. I talked to some people, and they dont know what is wrong either. I want to connect my servlet to a MYSQL database, and I am using MAMP.
This is my code:


import java.sql.Connection;
import java.sql.DriverManager;

public class TestConnection {
public static void main(String[] args) {
try {
Class.forName("com.mysql.jdbc.Driver");
System.out.println("Loaded driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost/db", "root", "root");
System.out.println("Connected to MySQL");
con.close();
}
catch (Exception ex) {
ex.printStackTrace();
}
}
}

Screenshot of my eclipse: http://postimg.org/image/fevv519l9/
Ind the left side I have my mysql connector.

My database is called db, and in my database i made two tables: username, and password. Sceenshot is here: http://postimg.org/image/nrlzijhy7/

So when I run this servlet I get a 404 error. The screenshot of that is here:
http://postimg.org/image/u8u03pe79/

In my servlet I also tried to put this in the con, but with the same result:
Connection con = DriverManager.getConnection("jdbc:mysql://localhost/db1", "root", "root");

and

Connection con = DriverManager.getConnection("jdbc:mysql://127.0.0.1/db1", "root", "root");

The reason I use servlets is because it is an university assigment, where we have to use servlet. I really hope someone can help, because it is driving me crazy :-/ So does anyone out there have a suggestion to what I have to do, to connect to MYSQL database with this servlet?

Best Regards
Mads

TINYINT column returning BigInteger instead of Integer (4 replies)

$
0
0
Currently we have a strange issue happening in our Production.
Our Technology stack is Spring, Hibernate and MySQL as back end.

When our DBA added an index on one of the table column, all the TINYINTs in our DB started to break, its because earlier their Java data type was coming as Integer but now they are coming as BigInteger.

Unable to find the root cause. Not sure whether its MySQL issue or connector issue or our code issue.

Any Help would be greatly appreciated.

Thanks

PreparedStatement with Hexadecimal Literals (no replies)

$
0
0
Hi,

I am trying to insert a Hexadecimal Literal into a varchar column. My overall system logic relies on PreparedStatements, and if I try, setString(1, hexString); my string is wrapped into quotes (note that hexString is a String that stores the hex value):
insert into t1 (col1) values ('X''4D7953514C''');

The goal for the PS is to look like this:
insert into t1 (col1) values (X'4D7953514C');

I have tried setObject() without success, it somehow detects that my variable is a string and wraps it into quotes.

Is it possible to do that with PreparedStatments or do I have to fall back to build the sql query first with a StringBuilder.

Time out from connections (no replies)

$
0
0
I have a java swing application that relies heavily on data to do it's many calculations. For a certain action, there are times that the application will need to send consecutive queries to perform an operation. Initially when the application was written, we were running MySQL 5.0 and the application worked well. We then upgraded to MySQL 5.5 and are having issues where the connection is timing out periodically, it does not happen all the time. Sometimes it occurs after so many queries are sent and other times, it can happen when a user tries to login. I have hit a wall and cannot find any solution or any other issues similar to it. If anyone could please point me in the right direction, it would be greatly appreciated. Thanks in advance.

JDBC-SWING-MYSQL Examples (no replies)

jdbc(loadbalance) completely fills connection pool (3 replies)

$
0
0
Hello. Currently I'm trying to implement load balancing with jdbc driver, so I'm writing connection string like jdbc:mysql:loadbalance://... But I'm encountering such problem: after some navigation through application I get exception "jdbc loadbalance SQLNestedException: Cannot get a connection, pool exhausted" (we are using dbcp (maxIdle), hibernate and we're having max_connections=600 in the both mysql nodes). In that time I ask mysql "SHOW PROCESSLIST" and it shows me about 500 connections. Without loadbalance (therefore for only one mysql node) it returns me alltime about 3-4 opened connections...
I have no idea what's wrong... we're using mysql-connector 5.0.8..
Has somebody any idea? Maybe should I provide more information? Any help or comment would be appreciated...

PS. I'd like to say that I downloaded the last mysql-connectior (5.1.25) and this problem was solved. But I still want to know: is there any solution for this bug for connector 5.0.8? - if no, is there any note about this bug that this was fixed in newer versions? Is there any risk when I will migrate from 5.0.8 to 5.1.25? Thanks!
Viewing all 884 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>