Class not found with Struts2 and Netbeans - netbeans

I'm using Netbeans 7.1, and i try to include Struts2.3.14.3 in my J2EE project.
I tried to :
put the .jars in the WEB-INF/lib path
link the .jars in the libraries "folder" of the project in Netbeans
create a librarie including the .jars and link it to the project
But none of these solutions work, when i deploy the application on my Glassfish server it keeps rising these kind of error :
Grave: Dispatcher initialization failed
Unable to load configuration. - bean - jar:file:/C:/xxx/dist/gfdeploy/xxx/lib/struts2-convention-plugin-2.3.14.3.jar!/struts-plugin.xml:32:155
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:473)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:264)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4685)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5377)
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2000)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1651)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:294)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:462)
at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:375)
at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:219)
at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:253)
at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:145)
at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:136)
at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:69)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
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 com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: Unable to load bean: type:org.apache.struts2.convention.ActionConfigBuilder class:org.apache.struts2.convention.PackageBasedActionConfigBuilder - bean - jar:file:/C:/xxx/dist/gfdeploy/xxx/lib/struts2-convention-plugin-2.3.14.3.jar!/struts-plugin.xml:32:155
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:245)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:226)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
... 40 more
Caused by: java.lang.NoClassDefFoundError: org/apache/struts2/StrutsException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404)
at java.lang.Class.getDeclaredConstructors(Class.java:1853)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:235)
... 43 more
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.StrutsException
at com.sun.enterprise.loader.ASURLClassLoader.findClassData(ASURLClassLoader.java:787)
at com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader.java:696)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 47 more
I have verified manually, and org.apache.struts2.StrutsException is present in the strut2-core.jar.
Here the jars i use:
asm-3.3
asm-common-3.3
asm-tree-3.3
commons-fileupload-1.2.2
commons-io-2.0.1
commons-lang-2.4
commons-lang3-3.1
freemarket-2.3.19
javassist-3.11.0.GA
ongl-3.0.6
struts2-conventin-plugin-2.3.14.3
xwork-core-2.3.14.3
struts2-bootstrap-plugin-1.6.1
struts2-core-2.3.14.3

You need a structure like this:
YourEar.ear
lib
library1.jar
library2.jar
libraryN.jar
META-INF
YourWar.war
jsp
jsp1.jsp
jsp2.jsp
jspN.jsp
META-INF
WEB-INF
lib
libraryA.jar
libraryB.jar
libraryX.jar
classes
your.package.your.classes.etc...
struts.xml
web.xml
Struts libraries goes inside war, not ear (libraryA, B, X...)
Open the generated ear/war and check thet everything is on its right place.

Related

EAP 7.X ClassNotFoundException during migration

I am migrating an application to EAP 7.x, My project structure is
-Ear
-War
-Ejb Jar
I am getting ClassNotFoundException, those classes are in the jar. The below is the stack trace. All exception showing in the classes that are in the ejb jar.
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class com.ttt.xxx.ejb.sessionbeans.messagebroker.MessageHandlerSessionBeanCHI with ClassLoader ModuleClassLoader for Module "deployment.xxx-dev-3.3.0-SNAPSHOT.ear.ejbModule-3.3.0-SNAPSHOT.jar" from Service Module Loader
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:78)
at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:57)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:106)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:91)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:76)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:143)
... 8 more
Caused by: java.lang.NoClassDefFoundError: com/ttt/xxx/ejb/sessionbeans/messagebroker/MessageHandlerSessionBeanCHI$xmlException
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Unknown Source)
at java.lang.Class.getDeclaredFields(Unknown Source)
at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:72)
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)
... 13 more
Caused by: java.lang.ClassNotFoundException: com.ttt.xxx.ejb.sessionbeans.messagebroker.MessageHandlerSessionBeanCHI$xmlException from [Module "deployment.xxx-dev-3.3.0-SNAPSHOT.ear.ejbModule-3.3.0-SNAPSHOT.jar" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:255)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
... 18 more
The jar packing with ear is.
META-INF/
META-INF/MANIFEST.MF
aopalliance-1.0.jar
axiom-api-1.2.12.jar
axiom-impl-1.2.12.jar
axis2-adb-1.6.1.jar
axis2-adb-codegen-1.6.1.jar
axis2-codegen-1.6.1.jar
axis2-kernel-1.6.1.jar
axis2-transport-http-1.6.1.jar
axis2-transport-local-1.6.1.jar
commons-beanutils-1.7.0.jar
commons-cli-1.2.jar
commons-codec-1.3.jar
commons-collections-3.1.jar
commons-fileupload-1.2.jar
commons-httpclient-3.1.jar
commons-lang-2.3.jar
commons-logging-1.1.1.jar
commons-pool-1.5.5.jar
displaytag-1.2.jar
displaytag-export-poi-1.2.jar
displaytag-portlet-1.2.jar
ejbModule-3.3.0-SNAPSHOT.jar
geronimo-activation_1.1_spec-1.0.2.jar
geronimo-javamail_1.4_spec-1.6.jar
geronimo-jta_1.1_spec-1.1.jar
geronimo-stax-api_1.0_spec-1.0.1.jar
geronimo-ws-metadata_2.0_spec-1.1.2.jar
httpcore-4.0.jar
itext-1.3.jar
jaxen-1.1.1.jar
jcl104-over-slf4j-1.4.2.jar
jsr311-api-1.0.jar
jstl-1.1.2.jar
log4j.xml
META-INF/application.xml
META-INF/jboss-app.xml
META-INF/jboss-deployment-struture.xml
xxx-dev-3.3.0-SNAPSHOT.war
neethi-3.0.1.jar
poi-3.2-FINAL.jar
slf4j-api-1.4.2.jar
slf4j-log4j12-1.4.2.jar
spring-asm-3.0.0.RELEASE.jar
spring-beans-3.0.0.RELEASE.jar
spring-context-3.0.0.RELEASE.jar
spring-core-3.0.0.RELEASE.jar
spring-expression-3.0.0.RELEASE.jar
spring-web-3.0.0.RELEASE.jar
spring-webmvc-3.0.0.RELEASE.jar
standard-1.1.2.jar
woden-api-1.0M9.jar
woden-impl-commons-1.0M9.jar
woden-impl-dom-1.0M9.jar
wsdl4j-1.6.2.jar
wstx-asl-3.2.9.jar
XmlSchema-1.4.7.jar
META-INF/maven/
xMETA-INF/maven/com.ttt.xxx/ear/
META-INF/maven/com.ttt.xxx/ear/pom.xml
META-INF/maven/com.ttt.xxx/ear/pom.properties
Please help to solve, I am suspecting issue is coming due to wrong class loading. But i am not able to fix it.

Jboss EAP 7.1 ServiceModuleLoader returning null

I'm using Jboss EAP 7.1 and when i try to dumpAllModuleInformation from ServiceModuleLoader, i'm getting null pointer exception, however i could see results for LocalModuleLoader. Attaching the Stack Trace below.
Basically i'm trying to see all loaded resources for my war file. I'm really not sure what's the reason for null pointer exception. All other operations like dumpModuleInformation, getDependencies, getModuleDescription, getModulesPathInfo, refreshResourceLoaders, relink and unLoadModule throwing IllegalArguementException: Module specification is null. Only queryLoadedModuleNames is returning my war filenames. Application is running fine without any issues. Jconsole is also throwing the same exception. I need to find a way to see all loaded jars for my war file. Standalone server is hosted with multiple war files, so planning to write a JMX program to get loaded dependencies for all of my wars/ears. Can you guys help me on this
javax.management.RuntimeMBeanException: java.lang.NullPointerException
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrow(DefaultMBeanServerInterceptor.java:839)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrowMaybeMBeanException(DefaultMBeanServerInterceptor.java:852)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:821)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.invoke(PluggableMBeanServerImpl.java:1503)
at org.jboss.as.jmx.PluggableMBeanServerImpl.invoke(PluggableMBeanServerImpl.java:724)
at org.jboss.as.jmx.BlockingNotificationMBeanServer.invoke(BlockingNotificationMBeanServer.java:168)
at org.jboss.remotingjmx.protocol.v2.ServerProxy$InvokeHandler.handle(ServerProxy.java:950)
at org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1$1.run(ServerCommon.java:153)
at org.jboss.as.jmx.ServerInterceptorFactory$Interceptor$1.run(ServerInterceptorFactory.java:75)
at org.jboss.as.jmx.ServerInterceptorFactory$Interceptor$1.run(ServerInterceptorFactory.java:70)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:92)
at org.jboss.as.jmx.ServerInterceptorFactory$Interceptor.handleEvent(ServerInterceptorFactory.java:70)
at org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1.run(ServerCommon.java:149)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at org.jboss.modules.ModuleLoader$MXBeanImpl.doGetResourceLoaders(ModuleLoader.java:857)
at org.jboss.modules.ModuleLoader$MXBeanImpl.getModuleDescription(ModuleLoader.java:866)
at org.jboss.modules.ModuleLoader$MXBeanImpl.doDumpModuleInformation(ModuleLoader.java:737)
at org.jboss.modules.ModuleLoader$MXBeanImpl.dumpAllModuleInformation(ModuleLoader.java:725)
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.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source

Error When Trying Sample In Accessing MongoDB Data with GORM

I was following the tutorial for Accessing MongoDB Data with GORM but I am having a problem with the sample Groovy code. I copied the sample Groovy code into a file called app.groovy. When I run the code from the spring boot cli the code works fine. If I compile the code into a jar by running
spring jar my-app.jar *.groovy
and then running
java -jar my-app.jar
I get an IllegalStateException
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:606)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
at java.lang.Thread.run(Thread.java:744)
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:606)
at org.springframework.boot.cli.jar.PackagedSpringApplicationLauncher.run(PackagedSpringApplicationLauncher.java:41)
at org.springframework.boot.cli.jar.PackagedSpringApplicationLauncher.main(PackagedSpringApplicationLauncher.java:61)
... 6 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cityController': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Method on class [City] was used outside of a Grails application. If running in the context of a test using the mocking API or bootstrap Grails correctly.
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:407)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:120)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:648)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:311)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:909)
... 12 more
Caused by: java.lang.IllegalStateException: Method on class [City] was used outside of a Grails application. If running in the context of a test using the mocking API or bootstrap Grails correctly.
at City.currentGormStaticApi(app.groovy)
at City.withTransaction(app.groovy)
at City$withTransaction.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at CityController.populateCities(app.groovy:30)
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:606)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:349)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:300)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)
... 27 more
Anyone have any idea how I fix this or what I am doing wrong?
Probably a bug: https://github.com/spring-projects/spring-boot/issues/686. Maybe a classloader thing, I'm not sure, but we'll look at it and update here when it's fixed. You should be able to use the Gradle or Maven build to create an executable JAR in the meantime.
Update: we might be able to fix this in Spring Boot and/or GORM, but in the meantime if you just declare a package in your app.groovy (e.g. package app) it should work.

JavaFx App on 64 bit Win 7 platform

I wrote a JavaFx app (JavaFx windows based form) on my desktop running
Win 7 32 Bit
Netbeans 7.3 Beta
jdk-7u9-windows-i586
and it runs successfully.
I recently got a laptop running
Win 7 64 Bit
Netbeans 7.3 Beta
jdk-7u9-windows-x64
I just copied the code over and switch the Java Platform.... currently its set to the default "Default JavaFx Platform".
If i run the app I get the following error dialog
JavaFx launcher error - Exception while running Application
Anyone know what I need to change here...
Full stack trace when running application
ant -f "C:\\DEV\\Projects\\Java Apps\\BaseAppPlatform" jfxsa-run
init:
Deleting: C:\DEV\Projects\Java Apps\BaseAppPlatform\build\built-jar.properties
deps-jar:
Updating property file: C:\DEV\Projects\Java Apps\BaseAppPlatform\build\built-jar.properties
compile:
Detected JavaFX Ant API version 1.2
Launching <fx:jar> task from C:\Program Files\Java\jdk1.7.0_09\lib\ant-javafx.jar
Signing JAR: C:\DEV\Projects\Java Apps\BaseAppPlatform\dist\BaseAppPlatform.jar to C:\DEV\Projects\Java Apps\BaseAppPlatform\dist\BaseAppPlatform.jar as nb-jfx
Warning:
The signer certificate will expire within six months.
Enter Passphrase for keystore: Enter key password for nb-jfx:
Launching <fx:deploy> task from C:\Program Files\Java\jdk1.7.0_09\lib\ant-javafx.jar
jfx-deployment-script:
jfx-deployment:
jar:
Copying 12 files to C:\DEV\Projects\Java Apps\BaseAppPlatform\dist\run858846669
jfx-project-run:
Executing com.javafx.main.Main from C:\DEV\Projects\Java Apps\BaseAppPlatform\dist\run858846669\BaseAppPlatform.jar using platform C:\Program Files\Java\jdk1.7.0_09/bin/java
java.lang.ClassNotFoundException: co.za.chrispie.LoginController
file:/C:/DEV/Projects/Java%20Apps/BaseAppPlatform/dist/run858846669/BaseAppPlatform.jar!/BaseAppPlatform/Login.fxml:9
at javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:728)
at javafx.fxml.FXMLLoader$InstanceDeclarationElement.processAttribute(FXMLLoader.java:777)
at javafx.fxml.FXMLLoader$Element.processStartElement(FXMLLoader.java:182)
at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:565)
at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2314)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2131)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2028)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2742)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2721)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2707)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2694)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2683)
at BaseAppPlatform.BaseAppPlatform.start(BaseAppPlatform.java:21)
at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:206)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:73)
at java.lang.Thread.run(Thread.java:722)
Exception in Application start method
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 com.javafx.main.Main.launchApp(Main.java:642)
at com.javafx.main.Main.main(Main.java:805)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:403)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
at java.lang.Thread.run(Thread.java:722)
Caused by: javafx.fxml.LoadException: java.lang.ClassNotFoundException: co.za.chrispie.LoginController
at javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:728)
at javafx.fxml.FXMLLoader$InstanceDeclarationElement.processAttribute(FXMLLoader.java:777)
at javafx.fxml.FXMLLoader$Element.processStartElement(FXMLLoader.java:182)
at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:565)
at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2314)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2131)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2028)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2742)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2721)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2707)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2694)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2683)
at BaseAppPlatform.BaseAppPlatform.start(BaseAppPlatform.java:21)
at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:206)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:73)
... 1 more
Caused by: java.lang.ClassNotFoundException: co.za.chrispie.LoginController
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:726)
... 19 more
Judging by java.lang.ClassNotFoundException: co.za.chrispie.LoginController you missed few code or dependent library while copying.
Find java or jar file responsible for class co.za.chrispie.LoginController and make sure:
it exists on your laptop
it's in the correct location package-wise
it's included into your new project (sources folder)

How do I make a JBoss Quartz job see classes in my JAR file?

I'm using JBoss 4.2.3.GA and deploying a JAR application, which uses Hibernate 4.1.5.SP1. In my JAR, I have a Quartz job, configured like so ...
#MessageDriven(activationConfig = {#ActivationConfigProperty(propertyName = "cronTrigger", propertyValue = "0 40 12 * * ?")})
#ResourceAdapter("quartz-ra.rar")
#Depends({
"jboss.ejb:service=EJBTimerService"})
public class UpdateOrgsJob implements Job {
I think JBoss loads Quartz in a separate classloader than where my JAR classes get referenced, because, I get the error "java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException" even though it is in my JAR file. How do I make my JAR classes visible to Quartz?
Below is the complete stack trace ...
javax.ejb.EJBTransactionRolledbackException: java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException^M
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)^M
at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)^M
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)^M
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)^M
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)^M
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)^M
at org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:249)^M
at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.delivery(MessageInflowLocalProxy.java:268)^M
at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:138)^M
at $Proxy90.execute(Unknown Source)^M
at org.jboss.resource.adapter.quartz.inflow.QuartzJob.execute(QuartzJob.java:57)^M
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)^M
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)^M
Caused by: java.lang.RuntimeException: java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException^M
at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:174)^M
at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)^M
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)^M
at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)^M
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)^M
at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)^M
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)^M
at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)^M
... 11 more^M
Caused by: java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException^M
at java.lang.Class.getDeclaredConstructors0(Native Method)^M
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)^M
at java.lang.Class.getConstructor0(Class.java:2699)^M
at java.lang.Class.newInstance0(Class.java:326)^M
at java.lang.Class.newInstance(Class.java:308)^M
at org.hibernate.cfg.SettingsFactory.createCacheProvider(SettingsFactory.java:375)^M
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:245)^M
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)^M
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)^M
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:713)^M
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121)^M
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)^M
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)^M
at org.mainco.subco.orgsclient.service.AbstractTransactionService.startOperation(AbstractTransactionService.java:27)^M
at org.mainco.subco.orgsclient.service.OrganizationServiceImpl.saveOrganization(OrganizationServiceImpl.java:87)^M
at org.mainco.subco.orgsclient.service.OrganizationServiceImpl.getEODBOrganizations(OrganizationServiceImpl.java:221)^M
at org.mainco.subco.orgsclient.service.OrganizationServiceImpl.saveOrgsFromWebService(OrganizationServiceImpl.java:183)^M
at org.mainco.subco.orgsclient.quartz.UpdateOrgsJob.execute(UpdateOrgsJob.java:55)^M
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)^M
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)^M
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)^M
at java.lang.reflect.Method.invoke(Method.java:597)^M
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)^M
at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)^M
... 18 more^M
Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: net.sf.ehcache.CacheException^M
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)^M
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)^M
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)^M
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)^M
... 42 more^M
you can put your ehcache jar file in ${jboss.server}/lib, Or you can also try the 2 methods mentioned in the Jboss wiki
1. Delay Quartz service startup
2. set <attribute name="UseJBossWebLoader">true</attribute>