This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Problem In EJB COde (Using Netbeans Code) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Problem In EJB COde (Using Netbeans Code)" Watch "Problem In EJB COde (Using Netbeans Code)" New topic
Author

Problem In EJB COde (Using Netbeans Code)

mac mold
Greenhorn

Joined: Oct 17, 2011
Posts: 1
HI
Please help
i m using NEtbeans 6.9 and creating a Database Application (With the help of its in-built Automation)
i connect MySql DB and Finish it by selecting columns n details... then netbeans provides all the automated code

Now when i Run it and Enter a New Row and click Save button , it throws this Error ... Where- Else wen i Jus Update a row and click Save it doesnt throw this Error at all(indeed no error is thrown)
now wen i do this same thing with local-Host DB , no error is thrown wht so ever i do

Technical Details

i m connecting to MySql 5.0 (Its a Online Database) Server at HostBig.com Web Hosting Soultions
using Toplink as my persistence Unit

Error i Receive is :

[TopLink Warning]: 2011.10.17 03:52:54.874--ClientSession(1693359)--Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
javax.persistence.RollbackException: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 7 ms ago.
Error Code: 0

Last packet sent to the server was 7 ms ago.
Error Code: 0
at oracle.toplink.essentials.internal.ejb.cmp3.transaction.base.EntityTransactionImpl.commit(EntityTransactionImpl.java:120)
at oracle.toplink.essentials.internal.ejb.cmp3.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:60)
at qgen.QgenView$SaveTask.doInBackground(QgenView.java:168)
at qgen.QgenView$SaveTask.doInBackground(QgenView.java:161)
at org.jdesktop.swingworker.SwingWorker$1.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at org.jdesktop.swingworker.SwingWorker.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 7 ms ago.
Error Code: 0
at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:311)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicBeginTransaction(DatabaseAccessor.java:179)
at oracle.toplink.essentials.internal.databaseaccess.DatasourceAccessor.beginTransaction(DatasourceAccessor.java:159)
at oracle.toplink.essentials.internal.sessions.AbstractSession.basicBeginTransaction(AbstractSession.java:298)
at oracle.toplink.essentials.threetier.ClientSession.basicBeginTransaction(ClientSession.java:138)
at oracle.toplink.essentials.internal.sessions.AbstractSession.beginTransaction(AbstractSession.java:393)
at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.beginTransaction(UnitOfWorkImpl.java:433)
at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1008)
at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.commitToDatabase(RepeatableWriteUnitOfWork.java:403)
at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1126)
at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:107)
at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:856)
at oracle.toplink.essentials.internal.ejb.cmp3.transaction.base.EntityTransactionImpl.commit(EntityTransactionImpl.java:102)
... 10 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 7 ms ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2985)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2871)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3414)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2536)
at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:4874)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicBeginTransaction(DatabaseAccessor.java:174)
... 21 more
Caused by: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2431)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2882)
... 28 more



[Thumbnail for Untitled.png]

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem In EJB COde (Using Netbeans Code)
 
Similar Threads
Image insertion into database through JPA
null value to database table from JForm
Netbeans 6.5: Populating JTable with MySQL database
Storing images to database through JDBC
JPA - How to reconnect EntityManager