Exception when running JPA QL

Hi,

I am trying to run a JPA QL in the JPA console in IDEA X. I opened the Persistence pane and selected my PU and opened the console for it. Then I typed in my query and ran it. I got the following stack trace. Seems to be looking for a Netbeans class?!

In my environment the PU has a non-jta-data-source which points to a resource configured in Glassfishv2.1. My project is using the Toplink bundled with GF. The query I ran looks like this SELECT OBJECT(res) FROM SearchRequest req, IN(req.searchResults) res WHERE req.searchId=:searchRequestId ORDER BY res.matchValue DESC

Thoughts? Thanks,

-Noah

java.lang.ClassNotFoundException: org.netbeans.modules.schema2beans.BaseBean
 at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
 at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
 at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
 at com.sun.enterprise.connectors.ConnectorAdminServicesFactory.getService(ConnectorAdminServicesFactory.java:66)
 at com.sun.enterprise.connectors.ConnectorRuntime.<init>(ConnectorRuntime.java:108)
 at com.sun.enterprise.connectors.ConnectorRuntime.<clinit>(ConnectorRuntime.java:89)
 at com.sun.enterprise.naming.factory.ConnectorObjectFactory.<init>(ConnectorObjectFactory.java:66)
 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 java.lang.Class.newInstance0(Class.java:355)
 at java.lang.Class.newInstance(Class.java:308)
 at javax.naming.spi.NamingManager.getObjectFactoryFromReference(NamingManager.java:146)
 at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:302)
 at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:403)
 at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:445)
 at javax.naming.InitialContext.lookup(InitialContext.java:396)
 at oracle.toplink.essentials.jndi.JNDIConnector.connect(JNDIConnector.java:129)
 at oracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:184)
 at oracle.toplink.essentials.internal.databaseaccess.DatasourceAccessor.connect(DatasourceAccessor.java:233)
 at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.connect(DatabaseAccessor.java:242)
 at oracle.toplink.essentials.internal.databaseaccess.DatasourceAccessor.connect(DatasourceAccessor.java:309)
 at oracle.toplink.essentials.threetier.ConnectionPool.buildConnection(ConnectionPool.java:117)
 at oracle.toplink.essentials.threetier.ExternalConnectionPool.startUp(ExternalConnectionPool.java:135)
 at oracle.toplink.essentials.threetier.ServerSession.connect(ServerSession.java:451)
 at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.login(DatabaseSessionImpl.java:616)
 at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:282)
 at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:229)
 at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:93)
 at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:126)
 at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:120)
 at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:91)

1 comment
Comment actions Permalink

Found the solution. I needed to add \Sun\SDK\lib\appserv-admin.jar to my provided Glassfish library configuration. That resolved the netbeans dependency, then another popped up which caused me to need to add \Sun\SDK\lib\install\applications\jmsra\jmqjmsra.jar. Once those two were added to the provided GF library included in my project the JPA console worked with this persistence unit.

-Noah

0

Please sign in to leave a comment.