Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Thrown exceptions are useless
Thrown exceptions are useless [message #390046] Mon, 13 July 2009 12:50 Go to next message
Philipp Kursawe is currently offline Philipp KursaweFriend
Messages: 135
Registered: July 2009
Senior Member
Hello,

is there a reason why EL hides the real exception and just prints
[EL Severe]: Local Exception Stack:
Exception [EclipseLink-4002] (Eclipse Persistence Services -
1.1.0.r3634): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: No suitable driver
Error Code: 0
at
org.eclipse.persistence.exceptions.DatabaseException.sqlExce ption(DatabaseException.java:313)
at
org.eclipse.persistence.exceptions.DatabaseException.sqlExce ption(DatabaseException.java:308)
at
org.eclipse.persistence.sessions.DefaultConnector.connect(De faultConnector.java:136)
at
org.eclipse.persistence.sessions.DatasourceLogin.connectToDa tasource(DatasourceLogin.java:162)
at
org.eclipse.persistence.internal.databaseaccess.DatasourceAc cessor.connectInternal(DatasourceAccessor.java:324)
at
org.eclipse.persistence.internal.databaseaccess.DatabaseAcce ssor.connectInternal(DatabaseAccessor.java:265)
at
org.eclipse.persistence.internal.databaseaccess.DatasourceAc cessor.connect(DatasourceAccessor.java:407)
at
org.eclipse.persistence.sessions.server.ConnectionPool.build Connection(ConnectionPool.java:130)
at
org.eclipse.persistence.sessions.server.ConnectionPool.acqui reConnection(ConnectionPool.java:71)
at
org.eclipse.persistence.sessions.server.ServerSession.alloca teReadConnection(ServerSession.java:486)
at
org.eclipse.persistence.sessions.server.ServerSession.execut eCall(ServerSession.java:532)
at
org.eclipse.persistence.internal.sessions.IsolatedClientSess ion.executeCall(IsolatedClientSession.java:134)
at
org.eclipse.persistence.internal.queries.DatasourceCallQuery Mechanism.executeCall(DatasourceCallQueryMechanism.java:205)
at
org.eclipse.persistence.internal.queries.DatasourceCallQuery Mechanism.executeCall(DatasourceCallQueryMechanism.java:191)
at
org.eclipse.persistence.internal.queries.DatasourceCallQuery Mechanism.executeSelectCall(DatasourceCallQueryMechanism.jav a:262)
at
org.eclipse.persistence.internal.queries.DatasourceCallQuery Mechanism.selectAllRows(DatasourceCallQueryMechanism.java:59 9)
at
org.eclipse.persistence.internal.queries.ExpressionQueryMech anism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2 512)
at
org.eclipse.persistence.internal.queries.ExpressionQueryMech anism.selectAllRows(ExpressionQueryMechanism.java:2470)
at
org.eclipse.persistence.queries.ReadAllQuery.executeObjectLe velReadQuery(ReadAllQuery.java:480)
at
org.eclipse.persistence.queries.ObjectLevelReadQuery.execute DatabaseQuery(ObjectLevelReadQuery.java:930)
at
org.eclipse.persistence.queries.DatabaseQuery.execute(Databa seQuery.java:664)
at
org.eclipse.persistence.queries.ObjectLevelReadQuery.execute (ObjectLevelReadQuery.java:891)
at
org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAll Query.java:457)
at
org.eclipse.persistence.queries.ObjectLevelReadQuery.execute InUnitOfWork(ObjectLevelReadQuery.java:954)
at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.int ernalExecuteQuery(UnitOfWorkImpl.java:2697)
at
org.eclipse.persistence.internal.sessions.AbstractSession.ex ecuteQuery(AbstractSession.java:1181)
at
org.eclipse.persistence.internal.sessions.AbstractSession.ex ecuteQuery(AbstractSession.java:1165)
at
org.eclipse.persistence.internal.sessions.AbstractSession.ex ecuteQuery(AbstractSession.java:1139)
at
org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeRea dQuery(EJBQueryImpl.java:389)
at
org.eclipse.persistence.internal.jpa.EJBQueryImpl.getResultL ist(EJBQueryImpl.java:568)
at
de.topsystem.tks.demo.legacy.warehouse.core.internal.PickerS erviceImpl.findAll(PickerServiceImpl.java:69)
at
de.topsystem.tks.warehouse.users.picker.ui.internal.PickerLi stProvider.doGetList(PickerListProvider.java:42)
at
de.topsystem.common.ui.glazedlists.viewers.AbstractEventList Provider.getList(AbstractEventListProvider.java:67)
at
de.topsystem.common.ui.part.DynamicTableViewPart$3.run(Dynam icTableViewPart.java:491)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:545)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at
org.eclipse.persistence.sessions.DefaultConnector.connect(De faultConnector.java:97)
... 32 more


....when the cause of the failure would be much more interesting to see?

Thanks,
Phil
Re: Thrown exceptions are useless [message #390282 is a reply to message #390046] Mon, 13 July 2009 14:30 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Not sure what you mean, the cause is in your stack,

Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:545)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at
org.eclipse.persistence.sessions.DefaultConnector.connect(De faultConnector.java:97)
... 32 more

This is the exception being thrown by java.sql.DriverManager, it means
that you have no registered JDBC driver for the URL you are using. Did
you set the driver-class?

---
James
http://www.nabble.com/EclipseLink---Users-f26658.html


James : Wiki : Book : Blog : Twitter
Re: Thrown exceptions are useless [message #390283 is a reply to message #390282] Mon, 13 July 2009 14:42 Go to previous message
Philipp Kursawe is currently offline Philipp KursaweFriend
Messages: 135
Registered: July 2009
Senior Member
James wrote:
> Not sure what you mean, the cause is in your stack,
>
> Caused by: java.sql.SQLException: No suitable driver
> at java.sql.DriverManager.getConnection(DriverManager.java:545)
> at java.sql.DriverManager.getConnection(DriverManager.java:140)
> at
> org.eclipse.persistence.sessions.DefaultConnector.connect(De faultConnector.java:97)
>
> .. 32 more
>
> This is the exception being thrown by java.sql.DriverManager, it means
> that you have no registered JDBC driver for the URL you are using. Did
> you set the driver-class?

The real exception is an E/A Error reported BY THE DRIVER (Orcale). The
driver is loaded and running (inside OSGi). The connection could not be
established because of a network error. Can you see that anywhere in the
stacktrace? Thats why I complained about the exception wrapping that
does not expose, but swallow the real exception (hidden inside the
SQLException). EL should extract the cause from SQLException and then
wrap it if that is even a good idea. I think SQLException is already a
wrapper exception, just throw it up.
Previous Topic:Primary Key and one-to-may relatuioship
Next Topic:Problem with Foreign Composite Key sharing a field with a Primary Composite Key?
Goto Forum:
  


Current Time: Sun Dec 21 13:40:34 GMT 2014

Powered by FUDForum. Page generated in 0.01772 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software