Logging.LogFactory error in google web application engine project developmenter - java

I am using the google web application engine and develop a project. I meet with a problem of runtime error like that :
Apr 28, 2011 10:28:36 AM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: Error starting handlers
java.lang.NoClassDefFoundError: org.apache.commons.logging.LogFactory is a restricted class. Please see the Google App Engine developer's guide for more details.
at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:51)
at org.springframework.web.context.ContextLoader.<clinit>(ContextLoader.java:146)
at org.springframework.web.context.ContextLoaderListener.createContextLoader(ContextLoaderListener.java:53)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:44)
at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:185)
at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:147)
at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:219)
at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:164)
at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
at com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServerMain.java:113)
at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:89)
Apr 28, 2011 10:28:36 AM com.google.apphosting.utils.jetty.JettyLogger debug
How can I get the solution for this?
Here is my logging.properties...
A default java.util.logging configuration.
(All App Engine logging is through java.util.logging by default).
#
To use this configuration, copy it into your application's WEB-INF
folder and add the following to your appengine-web.xml:
#
Set the default logging level for all loggers to WARNING
.level = ALL
handlers = java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level=ALL
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
Set the default logging level for ORM, specifically, to WARNING
DataNucleus.JDO.level=WARNING
DataNucleus.Persistence.level=WARNING
DataNucleus.Cache.level=WARNING
DataNucleus.MetaData.level=WARNING
DataNucleus.General.level=WARNING
DataNucleus.Utility.level=WARNING
DataNucleus.Transaction.level=WARNING
DataNucleus.Datastore.level=WARNING
DataNucleus.ClassLoading.level=WARNING
DataNucleus.Plugin.level=WARNING
DataNucleus.ValueGeneration.level=WARNING
DataNucleus.Enhancer.level=WARNING
DataNucleus.SchemaTool.level=WARNING
java.sql.level=INFO

It is possible you're missing commons-logging-xxx.jar in your build path

Related

weblogic 12.1.3 ,deployement exception,cannot inherit from final class

I have a ATG application on version 10.2,I am trying to deploy the appplication on weblogic 12.1.3 and facing this exception while server startup
Here is the logs snippet:
<Dec 22, 2017 3:51:04 PM IST> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application "vsi_store".
weblogic.management.DeploymentException: java.lang.VerifyError: Cannot inherit from final class at weblogic.application.internal.BaseDeployment.throwAppException(BaseDeployment.java:123) at weblog
ic.application.internal.BaseDeployment.activate(BaseDeployment.java:260)
at
weblogic.application.internal.EarDeployment.activate(EarDeployment.java:61)
at
weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:16)
at
weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
Truncated. see log file for complete stacktrace
Caused By: java.lang.VerifyError: Cannot inherit from final class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
2)
at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericCla
ssLoader.java:412)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
ClassLoader.java:366)
This issue was happening because of inbuild guava classes in 12.1.3 version of weblogic.They were interfaring with my application guava classes
I solved it by using version 12.1.2.
or you can solve it in 12.1.3 by changing entries of weblogic-application.xml as below:
<wls:prefer-application-packages>
<wls:package-name>com.fasterxml.jackson.*</wls:package-name>
<wls:package-name>com.github.fge.*</wls:package-name>
<wls:package-name>org.joda.*</wls:package-name>
<wls:package-name>com.google.common.*</wls:package-name>
<wls:package-name>com.sun.jersey.*</wls:package-name>
<wls:package-name>org.glassfish.jersey.*</wls:package-name>
<wls:package-name>org.glassfish.hk2.*</wls:package-name>
<wls:package-name>org.jvnet.hk2.*</wls:package-name>
<wls:package-name>jersey.repackaged.org.objectweb.asm.*</wls:package-name>
<wls:package-name>com.sun.research.ws.wadl.*</wls:package-name>
<wls:package-name>com.sun.ws.rs.ext.*</wls:package-name>
<wls:package-name>org.codehaus.jackson.*</wls:package-name>
<wls:package-name>com.fasterxml.jackson.*</wls:package-name>
<wls:package-name>org.codehaus.jettison.*</wls:package-name>
<wls:package-name>javax.ws.rs.*</wls:package-name>
<wls:package-name>org.objectweb.asm.*</wls:package-name>
<wls:package-name>antlr.*</wls:package-name>
</wls:prefer-application-packages>
</wls:weblogic-application>

java.io.FileNotFoundException: jackrabbit-standalone.jar

I want to use Apache Jackrabbit as a file storage tool in my web-project. I don`t have experience in using Jackrabbit. I started with downloading jackrabbit-standalone-2.10.1.jar,and then try to run the standalone server with:
java -jar jackrabbit-standalone-2.10.1.jar --port 8099
I have the next message:
Welcome to Apache Jackrabbit!
-------------------------------
Using repository directory jackrabbit
Writing log messages to jackrabbit/log
Starting the server...
Apache Jackrabbit is now running at http://localhost:8099/
But, when I move to localhost:8099 in browser, I have:
HTTP ERROR: 503
Problem accessing /. Reason:
SERVICE_UNAVAILABLE
I checked jackrabbit.log and it is empty, but jetty.log contains:
2015-12-23 02:52:25.862 INFO [main] Slf4jLog.java:67 Logging to Logger[org.mortbay.log] via org.mortbay.log.Slf4jLog
2015-12-23 02:52:25.873 INFO [main] Slf4jLog.java:67 jetty-6.1.x
2015-12-23 02:52:25.924 WARN [main] Slf4jLog.java:76 Web application not found jackrabbit-standalone.jar
2015-12-23 02:52:25.931 WARN [main] Slf4jLog.java:89 Failed startup of context org.mortbay.jetty.webapp.WebAppContext#3f2a3a5{/,jackrabbit-standalone.jar}
java.io.FileNotFoundException: jackrabbit-standalone.jar
at org.mortbay.jetty.webapp.WebAppContext.resolveWebApp(WebAppContext.java:965) ~[jackrabbit-standalone-2.10.1.jar:na]
at org.mortbay.jetty.webapp.WebAppContext.getWebInf(WebAppContext.java:800) ~[jackrabbit-standalone-2.10.1.jar:na]
at org.mortbay.jetty.webapp.WebInfConfiguration.configureClassLoader(WebInfConfiguration.java:62) ~[jackrabbit-standalone-2.10.1.jar:na]
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:457) ~[jackrabbit-standalone-2.10.1.jar:na]
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) [jackrabbit-standalone-2.10.1.jar:na]
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) [jackrabbit-standalone-2.10.1.jar:na]
at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115) [jackrabbit-standalone-2.10.1.jar:na]
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) [jackrabbit-standalone-2.10.1.jar:na]
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) [jackrabbit-standalone-2.10.1.jar:na]
at org.mortbay.jetty.Server.doStart(Server.java:224) [jackrabbit-standalone-2.10.1.jar:na]
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) [jackrabbit-standalone-2.10.1.jar:na]
at org.apache.jackrabbit.standalone.Main.run(Main.java:173) [jackrabbit-standalone-2.10.1.jar:na]
at org.apache.jackrabbit.standalone.Main.main(Main.java:60) [jackrabbit-standalone-2.10.1.jar:na]
I use Ubuntu 14.04, it works properly on Windows 7.
Thanks in advance for help.

GAE - ClassNotFoundException after deployment to Appspot server

I've got the Google's example Guestbook project created using Maven's archetype com.google.appengine.archetypes:guestbook-archetype. When I run it locally using mvn appengine:devserver it works alright, the problems start when I try to deploy it on Google's Appspot. I get the following message:
Error: Server Error
The server encountered an error and could not complete your request.
If the problem persists, please report your problem and mention this error message and the query that caused it.
In the logs I can see this:
2013-05-01 05:38:28.356 / 500 3166ms 0kb Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31
2001:6d8:10:a014:5176:bdbe:c152:53c0 - - [01/May/2013:05:38:28 -0700] "GET / HTTP/1.1" 500 0 - "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31" "aghinzop.appspot.com" ms=3167 cpu_ms=2100 loading_request=1 app_engine_release=1.7.7 instance=00c61b117cdf51947e909cbfaf52e1739a7f4c
W 2013-05-01 05:38:28.325
EXCEPTION
java.lang.ClassNotFoundException: ioserv.ioserv.SignGuestbookServlet
at com.google.appengine.runtime.Request.process-53e8711216f37199(Request.java)
at java.lang.ClassLoader.loadClass(ClassLoader.java:359)
at org.mortbay.util.Loader.loadClass(Loader.java:91)
at org.mortbay.util.Loader.loadClass(Loader.java:71)
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:480)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:487)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:774)
at com.google.tracing.TraceContext$DoInTraceContext.runInContext(TraceContext.java:751)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:342)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:334)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:484)
at java.lang.Thread.run(Thread.java:722)
E 2013-05-01 05:38:28.326
javax.servlet.ServletContext log: unavailable
javax.servlet.UnavailableException: ioserv.ioserv.SignGuestbookServlet
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:79)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:219)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:194)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:134)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:438)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:480)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:487)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:774)
at com.google.tracing.TraceContext$DoInTraceContext.runInContext(TraceContext.java:751)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:342)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:334)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:484)
at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
at java.lang.Thread.run(Thread.java:722)
W 2013-05-01 05:38:28.338
Failed startup of context com.google.apphosting.utils.jetty.RuntimeAppEngineWebAppContext#11c3e97{/,/base/data/home/apps/s~aghinzop/1.367061823227494749}
java.lang.NullPointerException
at java.lang.Class.isAssignableFrom(Native Method)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:219)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:194)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:134)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:438)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:480)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:487)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:774)
at com.google.tracing.TraceContext$DoInTraceContext.runInContext(TraceContext.java:751)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:342)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:334)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:484)
at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
at java.lang.Thread.run(Thread.java:722)
C 2013-05-01 05:38:28.342
Uncaught exception from servlet
javax.servlet.UnavailableException: Initialization failed.
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:228)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:194)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:134)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:438)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:480)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:487)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:774)
at com.google.tracing.TraceContext$DoInTraceContext.runInContext(TraceContext.java:751)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:342)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:334)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:484)
at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
at java.lang.Thread.run(Thread.java:722)
I 2013-05-01 05:38:28.355
This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application.
Here are the basic settings I have in Eclipse and the deployment log (I use App Engine Eclipse Plugin).
I'm not sure what "disabled because this is a Maven project" means here. Could you explain? And should I check this box?
The App Engine SDK selected here is the one provided by the Eclipse Plugin.
Here are the libs provided by plugin. There are also some Maven libs added by the archetype.
And here are the libs in WEB-INF/lib. I can see that there are very few of them and I realize that something may be missing. The problem is when I try to copy libs into this folder I get Cannot paste the clipboard contents into the selected elements. How can I do this? In a normal Dynamic Web Project (using this facet) it's as easy as Properties>Deployment Assembly>Add but here I have no clue how to do this.
I'd really appreciate your help! Thank you!
I'm not sure what "disabled because this is a Maven project" means here. Could you explain? And should I check this box?
There are two ways to manage your application (specifically web folder), one letting maven do it, and other letting google eclipse plugin do it. Since your application is built by maven, default assumption is your web app management is done by maven itself, so google eclipse plugin has disabled it by default.
unless you are not removing maven, it should be as it is.
Coming to error, my guess is, though you are building and testing through maven, you might be trying to deploy through eclipse, please try mvn appengine:update and it should work.
hope it helps.

How to use MySQL persistence manager with Jackrabbit standalone

I've been successfully using Apache Jackrabbit 2.4.3 and now 2.6.0 (standalone server in both cases) using the default configuration, so the repository is stored on the filesystem.
How can I make it connect to a MySQL back end instead? I don't need to worry about migration, just set it up as a fresh install.
After trying the steps below, Jackrabbit fails to start correctly or populate the DATASTORE table in the database, and I find this error in the logs:
ERROR [main] RepositoryImpl.java:366 failed to start Repository: Cannot instantiate persistence manager org.apache.jackrabbit.core.persistence.pool.MySqlPersistenceManager
javax.jcr.RepositoryException: Cannot instantiate persistence manager org.apache.jackrabbit.core.persistence.pool.MySqlPersistenceManager
[... oodles of backtrace cut ...]
[edit: here's the full backtrace]
2013-03-04 10:59:27.526 WARN [main] Slf4jLog.java:89 unavailable
javax.jcr.RepositoryException: Cannot instantiate persistence manager org.apache.jackrabbit.core.persistence.pool.MySqlPersistenceManager
at org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1353) ~[jackrabbit-standalone-2.6.0.jar:na]
at org.apache.jackrabbit.core.RepositoryImpl.createVersionManager(RepositoryImpl.java:486) ~[jackrabbit-standalone-2.6.0.jar:na]
at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:311) ~[jackrabbit-standalone-2.6.0.jar:na]
at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:589) ~[jackrabbit-standalone-2.6.0.jar:na]
at org.apache.jackrabbit.core.RepositoryContext.create(RepositoryContext.java:149) ~[jackrabbit-standalone-2.6.0.jar:na]
at org.apache.jackrabbit.servlet.jackrabbit.JackrabbitRepositoryServlet.init(JackrabbitRepositoryServlet.java:109) ~[jackrabbit-standalone-2.6.0.jar:na]
at javax.servlet.GenericServlet.init(GenericServlet.java:241) ~[jackrabbit-standalone-2.6.0.jar:na]
at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440) [jackrabbit-standalone-2.6.0.jar:na]
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263) [jackrabbit-standalone-2.6.0.jar:na]
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) [jackrabbit-standalone-2.6.0.jar:na]
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685) [jackrabbit-standalone-2.6.0.jar:na]
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) [jackrabbit-standalone-2.6.0.jar:na]
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250) [jackrabbit-standalone-2.6.0.jar:na]
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517) [jackrabbit-standalone-2.6.0.jar:na]
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467) [jackrabbit-standalone-2.6.0.jar:na]
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) [jackrabbit-standalone-2.6.0.jar:na]
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) [jackrabbit-standalone-2.6.0.jar:na]
at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115) [jackrabbit-standalone-2.6.0.jar:na]
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) [jackrabbit-standalone-2.6.0.jar:na]
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) [jackrabbit-standalone-2.6.0.jar:na]
at org.mortbay.jetty.Server.doStart(Server.java:224) [jackrabbit-standalone-2.6.0.jar:na]
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) [jackrabbit-standalone-2.6.0.jar:na]
at org.apache.jackrabbit.standalone.Main.run(Main.java:173) [jackrabbit-standalone-2.6.0.jar:na]
at org.apache.jackrabbit.standalone.Main.main(Main.java:60) [jackrabbit-standalone-2.6.0.jar:na]
Caused by: javax.jcr.RepositoryException: Could not load JDBC driver class org.gjt.mm.mysql.Driver
at org.apache.jackrabbit.core.util.db.ConnectionFactory.getDriverClass(ConnectionFactory.java:265) ~[jackrabbit-standalone-2.6.0.jar:na]
at org.apache.jackrabbit.core.util.db.ConnectionFactory.createDataSource(ConnectionFactory.java:233) ~[jackrabbit-standalone-2.6.0.jar:na]
at org.apache.jackrabbit.core.util.db.ConnectionFactory.getDataSource(ConnectionFactory.java:169) ~[jackrabbit-standalone-2.6.0.jar:na]
at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.getDataSource(BundleDbPersistenceManager.java:569) ~[jackrabbit-standalone-2.6.0.jar:na]
at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.init(BundleDbPersistenceManager.java:537) ~[jackrabbit-standalone-2.6.0.jar:na]
at org.apache.jackrabbit.core.persistence.pool.MySqlPersistenceManager.init(MySqlPersistenceManager.java:51) ~[jackrabbit-standalone-2.6.0.jar:na]
at org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1349) ~[jackrabbit-standalone-2.6.0.jar:na]
... 23 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:217) ~[na:1.6.0_27]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.6.0_27]
at java.net.URLClassLoader.findClass(URLClassLoader.java:205) ~[na:1.6.0_27]
at java.lang.ClassLoader.loadClass(ClassLoader.java:321) ~[na:1.6.0_27]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) ~[na:1.6.0_27]
at java.lang.ClassLoader.loadClass(ClassLoader.java:266) ~[na:1.6.0_27]
at java.lang.Class.forName0(Native Method) ~[na:1.6.0_27]
at java.lang.Class.forName(Class.java:188) ~[na:1.6.0_27]
at org.apache.jackrabbit.core.util.db.ConnectionFactory.getDriverClass(ConnectionFactory.java:260) ~[jackrabbit-standalone-2.6.0.jar:na]
... 29 common frames omitted
What I've done so far:
I've created the Jackrabbit database/user, which I can connect to no problem:
mysql -D jackrabbit -u jackrabbit -h localhost -pjackrabbit
I started with a clean slate (empty /var/jackrabbit directory), except the configuration file comes from here: https://raw.github.com/wiki/jackalope/jackalope/files/repository.xml
Here's the startup script I'm using: https://github.com/sixty-nine/Jackrabbit-startup-script
And here's the java process that runs:
java -XX:MaxPermSize=128m -Xmx512M -Xms128M -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=1111 -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.password.file=/opt/jackrabbit/startup/jmx.user -Dcom.sun.management.jmxremote.access.file=/opt/jackrabbit/startup/jmx.role -jar /opt/jackrabbit/jackrabbit-standalone-2.6.0.jar -h 127.0.0.1 -p 8080
I don't think I get far enough for it to matter, but I'm using MySQL 5.5.28-1.
I'm having the above problem with both 2.4.3 and 2.6.0.
Also:
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.5) (6b24-1.11.5-1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
Plus I subsequently installed the MySQL JDBC library on Debian:
apt-get install libmysql-java
The MySqlPersistenceManager tries to load the driver class org.gjt.mm.mysql.Driver, which is very old. Try using a more recent driver class, the class com.mysql.jdbc.Driver instead. To do that, you would need to configure the persistence manager in the repository.xml and all workspace.xml files as follows:
<PersistenceManager ...>
...
<param name="driver" value="com.mysql.jdbc.Driver"/>
</PersistenceManager>
In order to load the MySQL driver with Apache Jackrabbit-standalone. You will need to update the jackrabbit-stabndalone-x.x.x.jar in MANIFEST.MF.
Simply add a Class-Path statement to the bottom of the file such as:
Class-Path: lib/mysql-connector-java-5.1.25-bin.jar
I had the same problem as you and this was the only way I could get the MySQL driver class recognized.
Answering my own question, although it doesn't directly answer it:
Instead of trying to use the jackrabbit-standalone version, I've successfully got it running under Tomcat by following the instructions here:
https://github.com/jackalope/jackalope/wiki/Running-jackrabbit-in-tomcat-with-mysql
This gives me what I need; a working Jackrabbit instance that connects to a MySQL data store. Although this doesn't help anyone who comes across this and specifically needs to use Jackrabbit standalone, I would say that setting it up under Tomcat proved much easier for me, so is worth considering.
Please do the following activities.
Un-jar the standalone server jar (in my case it is : jackrabbit-standalone-2.8.3). You will see many folders. among them you will find two folder. 1.com 2. org.
Un-jar mysql-connector-java-5.1.30-bin. again you will find above mentioned two folders. go inside both the folders and copy the git(org) and mysql(com)
Paste inside the step 1's folder respectively. and restart the standalone server.
Regards,
Nitesh

Atomikos + Jetty in a Maven build environment - Classloader issue?

I am working on a project with multiple JDBC data sources and JTA. I use Maven as a build tool, and I'd like to use the Jetty plugin (6.1.20) to run the application during development.
I am trying to configure Jetty to use Atomikos as the transaction manager. I'm following the Atomikos documentation from Jetty, but the Jetty startup fails with what looks like a class loader issue.
Here are the relevant bits of my configuration.
runtime scope dependencies in my pom.xml:
<dependency>
<groupId>com.atomikos</groupId>
<artifactId>transactions-jta</artifactId>
<version>3.5.7</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.atomikos</groupId>
<artifactId>transactions-jdbc</artifactId>
<version>3.5.7</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
<scope>runtime</scope>
</dependency>
My jetty-env.xml located in /WEB-INF (autodiscovered by Jetty):
<New id="userTxImpl" class="com.atomikos.icatch.jta.UserTransactionImp" />
<New id="tx" class="org.mortbay.jetty.plus.naming.Transaction">
<Arg>
<Ref id="userTxImpl" />
</Arg>
</New>
The instantiation of tx at the end is the bit that fails, if I leave it out, Jetty starts up fine (but does not expose UserTransaction via JNDI, of course).
The Stacktrace:
2009-09-02 18:42:18.910::WARN: Config error at <New id="tx" class="org.mortbay.jetty.plus.naming.Transaction"><Arg>
<Ref id="userTxImpl"/>
</Arg></New>
2009-09-02 18:42:18.910::WARN: Failed startup of context org.mortbay.jetty.plugin.Jetty6PluginWebAppContext#12515db{/administrator,C:\workspace\administrator\src\main\webapp}
java.lang.IllegalStateException: No Constructor: <New id="tx" class="org.mortbay.jetty.plus.naming.Transaction"><Arg>
<Ref id="userTxImpl"/>
</Arg></New> on org.mortbay.jetty.plugin.Jetty6PluginWebAppContext#12515db{/administrator,C:\workspace\administrator\src\main\webapp}
at org.mortbay.xml.XmlConfiguration.newObj(XmlConfiguration.java:631)
at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:256)
at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:190)
at org.mortbay.jetty.plus.webapp.EnvConfiguration.configureWebApp(EnvConfiguration.java:130)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1247)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:124)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.java:132)
at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:441)
at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:383)
at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRunMojo.java:210)
at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:184)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:579)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:498)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForProject(DefaultLifecycleExecutor.java:265)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:191)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:149)
at org.apache.maven.DefaultMaven.execute_aroundBody0(DefaultMaven.java:223)
at org.apache.maven.DefaultMaven.execute_aroundBody1$advice(DefaultMaven.java:304)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:1)
at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody2(MavenEmbedder.java:904)
at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody3$advice(MavenEmbedder.java:304)
at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:1)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:408)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:351)
at org.codehaus.classworlds.Launcher.main(Launcher.java:31)
This looks like a classloader issue, as org.mortbay.jetty.plus.naming.Transaction has got a Constructor taking a javax.transaction.UserTransaction, and com.atomikos.icatch.jta.UserTransactionImp implements javax.transaction.UserTransaction, yet Jetty complains it does not have a proper constructor to use.
I'm obviously missing something here, but what is it?
Thanks!
You may have multiple copies of the UserTransaction class kicking around in your deployment. If these are loaded from different classloaders, then you can end up with this sort of error.
Check Jetty's libraries for UserTransaction, and then check your application's libraries. You should only have one copy.
I believe that you should not be specifying the JTA jar as a 'runtime' requirement, but rather as a 'provided' requirement. Similar to servlet-api and JMS, the individual implementers provide their own copies of the API and providing the Sun jar can muck them up.
I realize this is already answered, but I wanna put up my experience to save others the grief I just went through.
I had a similar problem, but it was caused by a conflict in versions of geronimo-jta spec. Specifically the one depended on by atomikos wasn't getting along with the one used by jetty. I had to exclude the one from atomikos, e.g.:
com.atomikos
transactions-essentials-all
3.5.9
org.apache.geronimo.specs
geronimo-jta_1.0.1B_spec
Like Taylor, I just blew a couple hours on this exact same issue. I use Hibernate as a JPA provider and it had a Maven depdency on its own JTA User Tranaction. Once I excluded this dependency I got past the issue.

Categories

Resources