I've installed standalone Equinox and used it as run configuration in eclipse. Project uses EclipseLink as JPA and it's configured to use derby and mysql providers. These providers are packed into bundles and activated in OSGi container. When i run project from eclipse and activate my bundle, the JPA factory is created normally and project works fine.
But! When i run equinox standalone eclipselink can't load database connector driver. Drivers as is wrote are packed as bundles and activated.
I notice, the Eclipse uses the same configuration which i use to run Equinox standalone and the same set of bundles. And the same bundle internal tree the eclipse used to run.
As i understood java classpath isn't needed in OSGi container - there are bundles used. And they are imported in my plugin's manifest.mf.
What's the problem, i can't understand. Why the application cannot find driver classes?
Ok, i provide complete exception callstack for derby driver. It seems EL functions normal. For mysql driver the problem is the same, but callstack differs a bit. When i run the same program from eclipse it works right.
That's my configuration:
id State Bundle
0 ACTIVE org.eclipse.osgi_3.8.100.v20120912-141032
Fragments=724, 726, 728
694 ACTIVE org.eclipse.equinox.simpleconfigurator_1.0.400.v20120828-033
824
695 ACTIVE com.ibm.icu.base_4.4.2.v20110831
696 ACTIVE com.mysql.jdbc_5.8.0
697 ACTIVE javax.el_2.2.0.v201108011116
698 ACTIVE javax.persistence_2.0.4.v201112161009
699 ACTIVE javax.servlet_3.0.0.v201112011016
700 ACTIVE javax.servlet.jsp_2.2.0.v201112011158
702 ACTIVE org.apache.felix.gogo.command_0.8.0.v201108120515
703 ACTIVE org.apache.felix.gogo.runtime_0.8.0.v201108120515
704 ACTIVE org.apache.felix.gogo.shell_0.8.0.v201110170705
705 ACTIVE org.eclipse.core.commands_3.6.1.v20120521-2329
706 ACTIVE org.eclipse.core.contenttype_3.4.200.v20120523-2004
707 ACTIVE org.eclipse.core.databinding_1.4.1.v20120521-2329
708 ACTIVE org.eclipse.core.databinding.observable_1.4.1.v20120521-2329
709 ACTIVE org.eclipse.core.databinding.property_1.4.100.v20120523-1955
710 ACTIVE org.eclipse.core.expressions_3.4.401.v20120627-124442
711 ACTIVE org.eclipse.core.jobs_3.5.300.v20120622-204750
712 ACTIVE org.eclipse.core.runtime_3.8.0.v20120521-2346
713 ACTIVE org.eclipse.equinox.app_1.3.100.v20120522-1841
714 ACTIVE org.eclipse.equinox.common_3.6.100.v20120522-1841
715 ACTIVE org.eclipse.equinox.console_1.0.0.v20120522-1841
716 ACTIVE org.eclipse.equinox.ds_1.4.0.v20120522-1841
717 ACTIVE org.eclipse.equinox.frameworkadmin_2.0.100.v20120606-175127
718 ACTIVE org.eclipse.equinox.frameworkadmin.equinox_1.0.400.v20120428-0117
719 ACTIVE org.eclipse.equinox.http.jetty_3.0.0.v20120522-1841
720 ACTIVE org.eclipse.equinox.http.registry_1.1.200.v20120912-125810
721 ACTIVE org.eclipse.equinox.http.servlet_1.1.300.v20120912-125810
722 ACTIVE org.eclipse.equinox.preferences_3.5.0.v20120918-182152
723 ACTIVE org.eclipse.equinox.registry_3.5.300.v20120731-134527
724 RESOLVED org.eclipse.equinox.servletbridge.extensionbundle_1.2.100.v20120522-2049
Master=0
725 ACTIVE org.eclipse.equinox.simpleconfigurator.manipulator_2.0.0.v20110808-1657
726 RESOLVED org.eclipse.equinox.transforms.hook_1.0.400.v20120522-2049
Master=0
727 ACTIVE org.eclipse.equinox.util_1.0.400.v20120917-191249
728 RESOLVED org.eclipse.equinox.weaving.hook_1.0.200.v20120524-1707
Master=0
729 ACTIVE org.eclipse.help_3.6.0.v20120521-2344
730 ACTIVE org.eclipse.jetty.continuation_8.1.3.v20120522
731 ACTIVE org.eclipse.jetty.http_8.1.3.v20120522
732 ACTIVE org.eclipse.jetty.io_8.1.3.v20120522
733 ACTIVE org.eclipse.jetty.security_8.1.3.v20120522
734 ACTIVE org.eclipse.jetty.server_8.1.3.v20120522
735 ACTIVE org.eclipse.jetty.servlet_8.1.3.v20120522
736 ACTIVE org.eclipse.jetty.util_8.1.3.v20120522
737 ACTIVE org.eclipse.osgi.services_3.3.100.v20120522-1822
738 ACTIVE org.eclipse.osgi.util_3.2.300.v20120912-140840
739 ACTIVE org.eclipse.persistence.asm_3.3.1.v201206041142
740 ACTIVE org.eclipse.persistence.core_2.4.0.v20120608-r11652
741 ACTIVE org.eclipse.persistence.jpa_2.4.0.v20120608-r11652
742 ACTIVE org.eclipse.persistence.jpa.osgi_2.4.0.v20120608-r11652
743 ACTIVE org.eclipse.rap.jface_2.0.0.20120821-1934
744 ACTIVE org.eclipse.rap.jface.databinding_2.0.0.20120821-1934
745 ACTIVE org.eclipse.rap.rwt_2.0.0.20120821-1934
746 ACTIVE org.eclipse.rap.rwt.osgi_2.0.0.20120821-1934
747 ACTIVE org.eclipse.rap.ui_2.0.0.20120821-1934
748 ACTIVE org.eclipse.rap.ui.workbench_1.5.100.20120821-1934
749 ACTIVE ru.futurelink.testrap_1.0.0.qualifier
750 ACTIVE org.apache.derby_1.0.0
osgi>
That's how i run project:
java -Declipse.ignoreApp=true -Dosgi.noShutdown=true -cp C:/Projects/ru.futurelink.testrap/lib/eclipselink.jar -cp C:/Projects/ru.futurelink.testrap/lib/javax.persistence_1.0.0.jar -cp C:/Projects/ru.futurelink.testrap/lib/derby.jar -cp C:/Projects/ru.futurelink.testrap/lib/mysql-connector-java-5.0.8-bin.jar -jar plugins\org.eclipse.osgi_3.8.100.v20120912-141032.jar -dev file:C:/Equinox/plugins/configuration/dev.properties -os win32 -ws win32 -arch x86_64 -nl ru_RU -console -consoleLog
That's the callstack:
[EL Info]: 2012-09-30 20:59:57.778--ServerSession(333070563)--EclipseLink, version: Eclipse Persistence Services - 2.4.0.v20120608-r11652
[EL Severe]: ejb: 2012-09-30 20:59:58.213--ServerSession(333070563)--java.lang.NullPointerException
2012-09-30 20:59:58.213:WARN:oejs.ServletHandler:ERROR: /examples
java.lang.reflect.UndeclaredThrowableException
at $Proxy0.createEntityManager(Unknown Source)
at ru.futurelink.moneyorganizer.data.MODatabase.<init>(MODatabase.java:13)
at ru.futurelink.moneyorganizer.ApplicationEntryPoint.createUI(ApplicationEntryPoint.java:22)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:177)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:289)
at java.lang.Thread.run(Thread.java:722)
at org.eclipse.rap.rwt.internal.lifecycle.UIThread.run(UIThread.java:102)
Caused by:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.persistence.jpa.osgi.EMFServiceProxyHandler.invoke(EMFServiceProxyHandler.java:77)
at $Proxy0.createEntityManager(Unknown Source)
at ru.futurelink.moneyorganizer.data.MODatabase.<init>(MODatabase.java:13)
at ru.futurelink.moneyorganizer.ApplicationEntryPoint.createUI(ApplicationEntryPoint.java:22)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:177)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:289)
at java.lang.Thread.run(Thread.java:722)
at org.eclipse.rap.rwt.internal.lifecycle.UIThread.run(UIThread.java:102)
Caused by:
javax.persistence.PersistenceException: java.lang.NullPointerException
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:602)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:186)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:278)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:304)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:282)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.persistence.jpa.osgi.EMFServiceProxyHandler.invoke(EMFServiceProxyHandler.java:77)
at $Proxy0.createEntityManager(Unknown Source)
at ru.futurelink.moneyorganizer.data.MODatabase.<init>(MODatabase.java:13)
at ru.futurelink.moneyorganizer.ApplicationEntryPoint.createUI(ApplicationEntryPoint.java:22)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:177)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:289)
at java.lang.Thread.run(Thread.java:722)
at org.eclipse.rap.rwt.internal.lifecycle.UIThread.run(UIThread.java:102)
Caused by:
java.lang.NullPointerException
at org.apache.derby.jdbc.EmbeddedDriver.connect(Unknown Source)
at org.eclipse.persistence.sessions.DefaultConnector.directConnect(DefaultConnector.java:165)
at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:117)
at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:685)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:213)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:542)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:186)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:278)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:304)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:282)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.persistence.jpa.osgi.EMFServiceProxyHandler.invoke(EMFServiceProxyHandler.java:77)
at $Proxy0.createEntityManager(Unknown Source)
at ru.futurelink.moneyorganizer.data.MODatabase.<init>(MODatabase.java:13)
at ru.futurelink.moneyorganizer.ApplicationEntryPoint.createUI(ApplicationEntryPoint.java:22)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:177)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:289)
at java.lang.Thread.run(Thread.java:722)
at org.eclipse.rap.rwt.internal.lifecycle.UIThread.run(UIThread.java:102)
And finally the contents of derby.log file:
Sun Sep 30 20:59:58 GMT+11:00 2012 Thread[UIThread [1ix4et52sn4jvzywdjyip1m3v],5,main] Class org.apache.derby.jdbc.Driver40 java.lang.NoClassDefFoundError: javax/sql/XAConnection, module ignored.
Sun Sep 30 20:59:58 GMT+11:00 2012 Thread[UIThread [1ix4et52sn4jvzywdjyip1m3v],5,main] Class org.apache.derby.jdbc.Driver30 java.lang.NoClassDefFoundError: javax/sql/XAConnection, module ignored.
Sun Sep 30 20:59:58 GMT+11:00 2012 Thread[UIThread [1ix4et52sn4jvzywdjyip1m3v],5,main] Class org.apache.derby.impl.services.jmx.JMXManagementService java.lang.NoClassDefFoundError: javax/management/JMException, module ignored.
Sun Sep 30 20:59:58 GMT+11:00 2012 Thread[UIThread [1ix4et52sn4jvzywdjyip1m3v],5,main] Cleanup action starting
ERROR XBM02: Startup failed due to missing functionality for org.apache.derby.jdbc.InternalDriver. Please ensure your classpath includes the correct Derby software.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.iapi.services.monitor.Monitor.missingImplementation(Unknown Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startServices(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(Unknown Source)
at org.apache.derby.impl.services.monitor.FileMonitor.<init>(Unknown Source)
at org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Unknown Source)
at org.apache.derby.iapi.jdbc.JDBCBoot.boot(Unknown Source)
at org.apache.derby.jdbc.EmbeddedDriver.boot(Unknown Source)
at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
I use that code to create entity factory:
mSystemEntities = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
EntityManager em = mSystemEntities.createEntityManager();
And here's my persistence.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="prov" transaction-type="RESOURCE_LOCAL">
<class>ru.futurelink.moneyorganizer.data.MOUserEntity</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver" />
<property name="javax.persistence.jdbc.url" value="jdbc:derby:/sampledb;create=true" />
<!-- EclipseLink should create the database schema automatically -->
<property name="eclipselink.ddl-generation" value="drop-and-create-tables" />
<property name="eclipselink.ddl-generation.output-mode" value="database" />
</properties>
</persistence-unit>
</persistence>
well u havent supplied code and exception so i guess ur doing the following
If ur using JDBC and creating connection by
connection = DriverManager.getConnection(connectionUrl, username, password);
with sole statement then in osgi generally it throws exception and you wont get any driver and driver is null.
but if u used
Class.forName(driver);
before creating connection osgi able to load the driver at runtime,
Reflexion in OSGi is bit orthodox.
I've found the solution. The Eclipse starts OSGi framework with org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar, but i try to load org.eclipse.osgi_3.8.100.v20120912-141032.jar. I think that framework without launcher doesnt support reflection cause classloader is missing. I'm not shure that the mechanism is of that kind but JPA works now and loads all drivers.
Related
I have Websphere thin client jars in my classpath and a sample spring boot application. I am unable to make remote ejb call because it is throwing corab exception. I am using oracle jdk1.8 to make websphere ejb call
09:50:28.505 com.ibm.rmi.corba.PluginRegistry instantiatePlugins:119 P=428317:O=0:CT ORBRas[default] java.lang.ClassNotFoundException: com.ibm.ws.wlm.client.WLMClient (no security manager: RMI class loader disabled)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:396)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:186)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:637)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:219)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:152)
at com.sun.corba.se.impl.util.JDKBridge.loadClassM(JDKBridge.java:189)
at com.sun.corba.se.impl.util.JDKBridge.loadClass(JDKBridge.java:86)
at com.sun.corba.se.impl.javax.rmi.CORBA.Util.loadClass(Util.java:602)
at javax.rmi.CORBA.Util.loadClass(Util.java:265)
at com.ibm.rmi.corba.PluginRegistry.instantiatePlugins(PluginRegistry.java:116)
at com.ibm.rmi.corba.ORB.instantiatePlugins(ORB.java:1518)
at com.ibm.rmi.corba.ORB.orbParameters(ORB.java:1423)
at com.ibm.rmi.corba.ORB.set_parameters(ORB.java:1349)
at com.ibm.CORBA.iiop.ORB.set_parameters(ORB.java:1697)
at org.omg.CORBA.ORB.init(ORB.java:353)
at com.ibm.ws.orb.GlobalORBFactory.init(GlobalORBFactory.java:92)
at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:169)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:64)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:44)
at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:505)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:466)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:128)
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:765)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:164)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:155)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:179)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:104)
at org.springframework.jndi.JndiLocatorDelegate.lookup(JndiLoc
The above log shows the corba errors generated by ibm jar files.
java.lang.ClassNotFoundException: com.ibm.ws.wlm.client.WLMClient
Looks like this is the class you're missing.
You'll need to add the com.ibm.ws.wlm.jar to your class path.
Noticed the below exception when starting websphere liberty server.
How can this be removed? Appreciate any help.
We have both javaee7 profile and webProfile-6.0 features installed.
The EAR application has one WAR file which uses jee6.0 / "3.0" web.xml
Exception = java.lang.NoClassDefFoundError
Source = com.ibm.ws.injectionengine.InjectionProcessorManager.getAllDeclaredFields
probeid = 249
Stack Dump = java.lang.NoClassDefFoundError: com.ibm.websphere.sdo.mediator.jdbc.ConnectionWrapper
at java.lang.Class.getDeclaredFieldsImpl(Native Method)
at java.lang.Class.getDeclaredFields(Class.java:833)
at com.ibm.ws.injectionengine.InjectionProcessorManager.getAllDeclaredFields(InjectionProcessorManager.java:375)
at com.ibm.ws.injectionengine.InjectionProcessorManager.processAnnotations(InjectionProcessorManager.java:216)
at com.ibm.ws.injectionengine.AbstractInjectionEngine.processInjectionMetaData(AbstractInjectionEngine.java:514)
at com.ibm.ws.injectionengine.osgi.internal.OSGiInjectionEngineImpl.processInjectionMetaData(OSGiInjectionEngineImpl.java:239)
at com.ibm.ws.injectionengine.ReferenceContextImpl.processImpl(ReferenceContextImpl.java:633)
at com.ibm.ws.injectionengine.ReferenceContextImpl.process(ReferenceContextImpl.java:305)
at com.ibm.ws.injectionengine.osgi.internal.OSGiReferenceContextImpl.process(OSGiReferenceContextImpl.java:31)
at com.ibm.ws.webcontainer.osgi.webapp.WebApp.commonInitializationStart(WebApp.java:254)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:1038)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:6562)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApp(DynamicVirtualHost.java:468)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler(DynamicVirtualHost.java:266)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler(DynamicVirtualHost.java:331)
at com.ibm.ws.http.internal.VirtualHostImpl.discriminate(VirtualHostImpl.java:251)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:301)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:471)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:405)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:285)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:256)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:174)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:83)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:504)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:574)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:929)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1018)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1153)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.lang.Thread.run(Thread.java:785)
Caused by: java.lang.ClassNotFoundException: com.ibm.websphere.sdo.mediator.jdbc.ConnectionWrapper
at com.ibm.ws.classloading.internal.AppClassLoader.findClassCommonLibraryClassLoaders(AppClassLoader.java:499)
at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:282)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:846)
at java.lang.ClassLoader.loadClass(ClassLoader.java:825)
at com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLoadClass(AppClassLoader.java:477)
at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:449)
at java.lang.ClassLoader.loadClass(ClassLoader.java:805)
... 30 more
The SDO API (com.ibm.websphere.sdo) is not available in Liberty. Looks like you are trying to run some traditional WAS application on Liberty. You will have to change your application to make it runnable in Liberty.
I'd suggest to install WebSphere Application Migration Toolkit(free Eclipse plugin from Marketplace) and analyze your application.
We were using Memcached for session management in our web application with Tomcat 7 and it worked liked charm. In order for it work, I added following jars to Tomcat's lib folder
spymemcached-2.8.12.jar
couchbase-client-1.1.4.jar
memcached-session-manager-tc7-1.6.5.jar
memcached-session-manager-1.6.5.jar
And made following change to Tomcat's server.xml
<Context path="customersupport" docBase="customerSupportOrderCentral#v2" sessionCookieName="CUSTOMERSUPPORT-JSESSIONID">
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
memcachedNodes="n1:oc-cs-elasticcache.w8eptf.cfg.usw1.cache.amazonaws.com:11211"
sticky="false" requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$" />
</Context>
Now we are in process of upgrading our JDK to 1.8 and Tomcat version to 8. I have been researching online for it and it turned out since tomcat 8 doesn't support getSessionCookieName, I have to update memcache jar files for tomcat 8. so I added new set of jar files at tomcat's lib folder as below.
spymemcached-2.11.1.jar
memcached-session-manager-tc8-1.8.1.jar
memcached-session-manager-1.8.1.jar
couchbase-client-1.4.0.jar
And Kept server.xml same but now Tomcat is throwing following error while starting up.
06-Jan-2016 07:03:48.934 SEVERE [main] org.apache.tomcat.util.digester.Digester.startElement Begin event threw error
java.lang.NoClassDefFoundError: org/apache/catalina/Lifecycle
at java.lang.ClassLoader.findBootstrapClass(Native Method)
at java.lang.ClassLoader.findBootstrapClassOrNull(ClassLoader.java:1012)
at java.lang.ClassLoader.loadClass(ClassLoader.java:413)
at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:116)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1178)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:766)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1344)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2787)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1451)
at org.apache.catalina.startup.Catalina.load(Catalina.java:551)
at org.apache.catalina.startup.Catalina.load(Catalina.java:599)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:310)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:484)
If I dont change server.xml to include memcache manager, its working fine but with memcache session manager its throwing above error. I can really use some help here to resolve this issue.
Thanks
I had the same issue and got stuck for 2 days. The issue on my end was I had the below memcache specific jars in tomcat/lib and in another project specific classpath - tomcat/{project}/conf. The issue got resolved when I removed these jars from tomcat/{project}/conf
spymemcached-2.11.1.jar
memcached-session-manager-tc8-1.8.1.jar
memcached-session-manager-1.8.1.jar
I got phoenix 4.0 running on hbase 0.98/hadoop 2.3.0 and was impressed by the command line tools.
In the second step I followed the description on the webpage to connect to phoenix using its bundled JDBC driver.
When I try to connect I get the Exception message (on Squirrel side)
java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.sql.SQLException: ERROR 103 (08004): Unable to establish connection.
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.awaitConnection(OpenConnectionCommand.java:132)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$100(OpenConnectionCommand.java:45)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$2.run(OpenConnectionCommand.java:115)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: java.sql.SQLException: ERROR 103 (08004): Unable to establish connection.
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:171)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$000(OpenConnectionCommand.java:45)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$1.run(OpenConnectionCommand.java:104)
... 5 more
Caused by: java.sql.SQLException: ERROR 103 (08004): Unable to establish connection.
at org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:309)
at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:133)
at org.apache.phoenix.query.ConnectionQueryServicesImpl.openConnection(ConnectionQueryServicesImpl.java:254)
at org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:1446)
at org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:131)
at org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:112)
at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:133)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:167)
... 7 more
Caused by: java.io.IOException: java.lang.reflect.InvocationTargetException
at org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:416)
at org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:309)
at org.apache.phoenix.query.HConnectionFactory$HConnectionFactoryImpl.createConnection(HConnectionFactory.java:47)
at org.apache.phoenix.query.ConnectionQueryServicesImpl.openConnection(ConnectionQueryServicesImpl.java:252)
... 12 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:414)
... 15 more
Caused by: java.lang.RuntimeException: Socket Factory class not found: java.lang.ClassNotFoundException: Class org.apache.hadoop.net.StandardSocketFactory not found
at org.apache.hadoop.net.NetUtils.getSocketFactoryFromProperty(NetUtils.java:142)
at org.apache.hadoop.net.NetUtils.getDefaultSocketFactory(NetUtils.java:122)
at org.apache.hadoop.hbase.ipc.RpcClient.<init>(RpcClient.java:1293)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.<init>(HConnectionManager.java:664)
... 20 more
I double checked the jar files with classfinder to be sure that the class org.apache.hadoop.net.StandardSocketFactory IS in the classpath.
What can I do to get Squirrel connected with Phoenix?
Update:
I saw in the zookeeper log on the server side that the network communication started:
2014-05-28 06:24:29,411 INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181] server.NIOServerCnxnFactory: Accepted socket connection from /192.168.1.106:58172
2014-05-28 06:24:29,412 INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181] server.ZooKeeperServer: Client attempting to establish new session at /192.168.1.106:58172
2014-05-28 06:24:29,518 INFO [SyncThread:0] server.ZooKeeperServer: Established session 0x146413f6c3a000c with negotiated timeout 90000 for client /192.168.1.106:58172
I solved the problem replacing the downloaded binary version 4.0 of phoenix with the snapshot version 4.1 which I built by myown from the source version cloned via git from
http://git.apache.org/incubator-phoenix.git/
After the successful build I extracted the tarball from the assembly subdirectory and copied the following jars to hbase 0.98's lib dir
phoenix-core-4.1.0-incubating-SNAPSHOT.jar
phoenix-flume-4.1.0-incubating-SNAPSHOT.jar
phoenix-pig-4.1.0-incubating-SNAPSHOT.jar
In Squirrel I used just phoenix-4.1.0-incubating-SNAPSHOT-client.jar as a extra path to get the driver running.
I have an embedded derby db with tables for USERS, ROLES, USERS_ROLES, etc. My requirement is using it for tomcat authentication. Additionaly, i've created an spring webapp in order to administrate the Users, Roles, etc. in a simplier way.
Previously i have defined this datasource in my applicationContext:
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
p:url="jdbc:derby:C:\tools\derbydb"
p:connectionProperties=""
p:username="APP"
p:password="" />
I've changed this aproach to JNDI and now i've defined the db resource in webapp/WEB-INF/context.xml
<Context>
<Resource name="jdbc/adminDB" auth="Container" type="javax.sql.DataSource"
maxActive="20" maxIdle="10" username="APP" password=""
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:C:\tools\derbydb"/>
</Context>
And in my applicationContext.xml:
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/adminDB"/>
</bean>
In eclipse it works ok. I can read the values, edit, log in, etc.
My problem is relative to allow this on tomcat 6. I've read some pages including questions of stackoverflow but i don't find my specific problem. I've deployed another app which use the tomcat security in order to access some data. It is an app developed by a third party. With the old configuration works fine (server.xml):
<Realm className="org.apache.catalina.realm.JDBCRealm" driverName="org.apache.derby.jdbc.EmbeddedDriver" connectionURL="jdbc:derby:C:\tools\derbydb" connectionName="APP" connectionPassword="" userTable="USERS" userNameCol="USERNAME" userCredCol="PASSWORD" userRoleTable="V_USERS_ROLES" roleNameCol="ROLENAME"/>
and i was able to login with the users defined in the database using tomcat. But now, i defined something like this (server.xml) :
<Realm className="org.apache.catalina.realm.DataSourceRealm" dataSourceName="jdbc/adminDB" userTable="USERS" userNameCol="USERNAME" userCredCol="PASSWORD" userRoleTable="V_USERS_ROLES" roleNameCol="ROLENAME"/>
and in the server.xml (GlobalNamingResources)
<Resource name="jdbc/adminDB" auth="Container" type="javax.sql.DataSource"
maxActive="20" maxIdle="10" username="APP" password=""
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:C:\tools\derbydb"/>
When i try to log in i get this error:
SEVERE: Excepci¾n realizando autenticaci¾n
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Failed to s
tart database 'C:\tools\derbydb' with class loader org.apache.catalina.loader.StandardClassLoader#23
49e5ef, see the next exception for details.)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSour
ce.java:1549)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:416)
at org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java:296)
at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java
:181)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:528)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.ja
va:606)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.sql.SQLException: Failed to start database 'C:\tools\derbydb' with class loader org.
apache.catalina.loader.StandardClassLoader#2349e5ef, see the next exception for details.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFact
ory.java:38)
at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactor
y.java:582)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.jav
a:1556)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSour
ce.java:1545)
... 14 more
Caused by: java.sql.SQLException: Failed to start database 'C:\tools\derbydb' with class loader org.
apache.catalina.loader.StandardClassLoader#2349e5ef, see the next exception for details.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown S
ource)
... 28 more
Caused by: java.sql.SQLException: Another instance of Derby may have already booted the database C:\
tools\derbydb.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown S
ource)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
... 25 more
Caused by: ERROR XSDB6: Another instance of Derby may have already booted the database C:\tools\derb
ydb.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.privGetJBMSLockOnDB(Unknown Sour
ce)
at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.getJBMSLockOnDB(Unknown Source)
at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source)
at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown So
urce)
at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown Source)
at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown Source)
... 25 more
It seems like an app of another JVM has locked the derby db. But i don't have anything accessing to the db excepting the tomcat itself. And i've not deployed the admin webapp at the momment. I've only deployed the app which uses the tomcat login. Does anybody know what is happening?
By the way... is this solution correct in order to access the db from the admin webapp? Or do i need to define the resource in the context.xml?
Any helping answer will be voted
Thank you
Each separate application within a single Tomcat application server is considered a separate instance of Derby.
So two different applications in the same Tomcat app server cannot access the same copy of Derby, unless you use the Client-Server configuration of Derby and configure a Derby Network Server.