this issue drives me crazy
recently i configured hibernate to work with infinispan 8.1
and just worked fine in debug mode with eclipse
the problem when tried to deploy my application war on apache tomcat6
i get this exception
Caused by: org.hibernate.cache.CacheException: Unable to start region factory
at org.hibernate.cache.infinispan.InfinispanRegionFactory.start(InfinispanRegionFactory.java:415)
at org.hibernate.internal.CacheImpl.<init>(CacheImpl.java:49)
at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:28)
at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:20)
at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.initiateService(SessionFactoryServiceRegistryImpl.java:46)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:234)
... 86 more
Caused by: org.infinispan.commons.CacheConfigurationException: Unable to instantiate class org.infinispan.remoting.transport.jgroups.JGroupsTransport
at org.infinispan.commons.util.Util.loadClass(Util.java:103)
at org.infinispan.commons.util.Util.getInstance(Util.java:258)
at org.infinispan.configuration.global.TransportConfigurationBuilder.defaultTransport(TransportConfigurationBuilder.java:207)
at org.infinispan.configuration.parsing.Parser72.parseJGroups(Parser72.java:405)
at org.infinispan.configuration.parsing.Parser72.readElement(Parser72.java:93)
at org.infinispan.configuration.parsing.ParserRegistry.parseElement(ParserRegistry.java:151)
at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:131)
at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:118)
at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:105)
at org.hibernate.cache.infinispan.InfinispanRegionFactory.parseWithOverridenClassLoader(InfinispanRegionFactory.java:518)
at org.hibernate.cache.infinispan.InfinispanRegionFactory.access$000(InfinispanRegionFactory.java:81)
at org.hibernate.cache.infinispan.InfinispanRegionFactory$1.doWork(InfinispanRegionFactory.java:484)
at org.hibernate.cache.infinispan.InfinispanRegionFactory$1.doWork(InfinispanRegionFactory.java:470)
at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.workWithClassLoader(ClassLoaderServiceImpl.java:342)
at org.hibernate.cache.infinispan.InfinispanRegionFactory.createCacheManager(InfinispanRegionFactory.java:469)
at org.hibernate.cache.infinispan.InfinispanRegionFactory.start(InfinispanRegionFactory.java:380)
... 91 more
Caused by: java.lang.ClassNotFoundException: org.infinispan.remoting.transport.jgroups.JGroupsTransport
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.infinispan.commons.util.Util.loadClassStrict(Util.java:158)
at org.infinispan.commons.util.Util.loadClass(Util.java:101)
... 106 more
This exception clearly shows that jar is not present on class path. For web project see if that jar is present inside lib folder of your war.
Related
I get this exception after exporting into a .jar file with eclipse. IntelliJ says the same. But my program is working fine in eclipse.
Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Application
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javafx.application.Application
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 13 more
What could be the matter of this?
JDK version: 1.7.0_79
Starting: java -jar myapp.jar
After trying it with java -cp jfxrt.jar -jar myapp.jar it gives me the following error:
java -cp jfxrt.jar -jar memo.jar
Exception in thread "JavaFX Application Thread" Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Layout
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplicationWithArgs$100(LauncherImpl.java:352)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$119(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$117(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$118(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication.lambda$null$450(GtkApplication.java:139)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Layout
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 11 more
java.lang.reflect.InvocationTargetException
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 sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.NullPointerException
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:383)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
... 5 more
The javafx.application.Application class is going to be found in a javafx library; in an IDE such as eclipse you generally configure a project to refer to those libraries it needs for compilation and execution. When you put your code into a jar and run it outside the IDE, you need to provide the library to the runtime a different way.
A standard way to do this is to set a classpath which has references to both the application jar and to any libraries it needs; the DOS command to do this would look something like:
set classpath=c:\myProjects\myApplication\myJar.jar;c:\java\libaries\javafx\jfxrt.jar
and then java would have access to the classes in both those jar files
Oracle JDK includes JavaFX on the classpath from version 1.8 onwards; if you upgrade your JDK to version 8 or later it should run. I do not recommend building production-level JavaFX applications with versions prior to Java 8 anyway.
If you really do want to use Java 7, consider using the built-in JavaFX deployment tools to build the jar, instead of the vanilla "create executable jar" from eclipse. These will properly build a jar file that includes the FX runtime, if needed. The easiest way to do this in Eclipse is to install e(fx)clipse (an Eclipse plugin); there's a tutorial which includes steps to build the jar file.
I am trying to get started with Drools 6x, and in eclipse, I have created a Drools project, which creates the boilerplate code to run a simple drl.
I have the drools runtime installed via Eclipse.
I have drools libraries, drools-core-5.0.1.jar,kie-api-6.0.0.beta4.jar,kie-internal-6.0.0.beta2.jar as External jars in my project.
Yet, when I try to run the following, I get the following error:
java.lang.ExceptionInInitializerError
at com.sample.PetStoreExample.init(PetStoreExample.java:78)
at com.sample.PetStoreExample.main(PetStoreExample.java:67) Caused by: java.lang.RuntimeException: Unable to instance KieServices
at org.kie.api.KieServices$Factory.<clinit>(KieServices.java:137)
... 1 more Caused by: java.lang.ClassNotFoundException:org.drools.compiler.kie.builder.impl.KieServicesImpl at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.kie.api.KieServices$Factory.<clinit>(KieServices.java:165)
... 1 more
If you downloaded the zip of Jars from http://www.drools.org/, you're going to want to include every jar from /binaries in your project. Even the ones that seem like you won't use.
I had this same problem too because I assumed I only needed to use a few Jars, but it turns out they all depend on classes from the other jars in that zip folder.
I had this problem because I had both kie-api and kie-ci as dependencies in my pom file. I removed the kie-ci dependency and I'm not getting this issue any more.
I am using the following code from AWS documentation:
http://docs.aws.amazon.com/AmazonS3/latest/dev/UploadObjSingleOpJava.html
And i have used the following jars :
And i am getting the following error :
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at com.amazonaws.AmazonWebServiceClient.(AmazonWebServiceClient.java:58)
at UploadObject.main(UploadObject.java:17)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 2 more
Any help would be appreciated for the same. I have tried adding the common logging jars but no luck.
Hi there are quite a few third-party library's required for AWS to work. The ones below are the extras packaged with the SDK download. I seem to remember there being one missing though so let me know if this doesn't work and i'll check my dependencys.
All of these can be found in '\aws-java-sdk-1.9.1\third-party'
aspectj-1.6
commons-codec-1.6
commons-logging-1.1.3
freemarker-2.3.1.8
httpcomponents-client-4.3
jackson-annotations-2.3.0
jackson-core-2.3.2
jackson-databind-2.3.2
javax-mail-1.4.6
joda-time-2.2
spring-3.0
While adding custom jar files in the project and executing some java code I am getting this error any idea how to solve this .There is no error in code ,it was running smoothly before this happen.
Exception in thread "main" java.lang.NoClassDefFoundError: org/aspectj/lang/Signature
at com.util.DfExSession.connectToDocbase(DfExSession.java:18)## Heading ##
at com.console.TestConsole.main(TestConsole.java:17)
Caused by: java.lang.ClassNotFoundException: org.aspectj.lang.Signature
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 2 more
Look's like the aspectjrt.jar is missing in your classptah. Download & add it to your classpath.
iam trying to use MySQL Connection Pooling using c3p0.
I want to use c3p0 for a bukkit plugin.
The MANIFEST.MF looks as follow and is placed at Pooling.jar/META-INF/MANIFEST.MF
Manifest-Version: 1.0
class-path: ./Pooling/lib/c3p0.jar ./Pooling/lib/mchange.jar
I've placed the 2 files at
plugins/Pooling/lib/
However, it keeps printing this error:
2013-09-13 16:35:19 [SEVERE] Error occurred while enabling Pooling
v1.0.0 (Is it up to date?) java.lang.NoClassDefFoundError:
com/mchange/v2/c3p0/ComboPooledDataSource at
com.frostforce.Pooling.Database.setup(Database.java:11) at
com.frostforce.Pooling.Main.onEnable(Main.java:16) at
org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217) at
org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:457)
at
org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381)
at
org.bukkit.craftbukkit.v1_6_R2.CraftServer.loadPlugin(CraftServer.java:282)
at
org.bukkit.craftbukkit.v1_6_R2.CraftServer.enablePlugins(CraftServer.java:264)
at
net.minecraft.server.v1_6_R2.MinecraftServer.l(MinecraftServer.java:313)
at
net.minecraft.server.v1_6_R2.MinecraftServer.f(MinecraftServer.java:290)
at
net.minecraft.server.v1_6_R2.MinecraftServer.a(MinecraftServer.java:250)
at
net.minecraft.server.v1_6_R2.DedicatedServer.init(DedicatedServer.java:151)
at
net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java:391)
at
net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:582)
Caused by: java.lang.ClassNotFoundException:
com.mchange.v2.c3p0.ComboPooledDataSource at
java.net.URLClassLoader$1.run(Unknown Source) at
java.net.URLClassLoader$1.run(Unknown Source) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(Unknown Source) at
org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:80)
at
org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53)
at java.lang.ClassLoader.loadClass(Unknown Source) at
java.lang.ClassLoader.loadClass(Unknown Source) ... 13 more
I have no idea at all what Iam doing wrong at the moment.
Thanks in advance!