Enviornment- wildfly-9.0.2.Final, EJB 3.0
Following error occurred while trying to connect Test.java class(deployed as module at wildfly-9.0.2.Final#machine-A) to EJB whilch is deployed on jboss at machine-B(291.861.301.732).
17:02:46,666 ERROR [stderr] (default task-1) javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory org.jboss.naming.remote.client.InitialContextFactory from classloader ModuleClassLoader for Module "deployment.test.ear.test.war:main" from Service Module Loader [Root exception is java.lang.ClassNotFoundException: org.jboss.naming.remote.client.InitialContextFactory from [Module "deployment.test.ear.test.war:main" from Service Module Loader]]
17:02:46,667 ERROR [stderr] (default task-1) at org.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:118)
17:02:46,667 ERROR [stderr] (default task-1) at org.jboss.as.naming.InitialContext.init(InitialContext.java:99)
17:02:46,670 ERROR [stderr] (default task-1) at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:154)
17:02:46,670 ERROR [stderr] (default task-1) at org.jboss.as.naming.InitialContext.<init>(InitialContext.java:89)
17:02:46,670 ERROR [stderr] (default task-1) at org.jboss.as.naming.InitialContextFactory.getInitialContext(InitialContextFactory.java:43)
17:02:46,687 ERROR [stderr] (default task-1) Caused by: java.lang.ClassNotFoundException: org.jboss.naming.remote.client.InitialContextFactory from [Module "deployment.test.ear.test.war:main" from Service Module Loader]
17:02:46,688 ERROR [stderr] (default task-1) at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205)
17:02:46,688 ERROR [stderr] (default task-1) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)
17:02:46,688 ERROR [stderr] (default task-1) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)
17:02:46,688 ERROR [stderr] (default task-1) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)
17:02:46,688 ERROR [stderr] (default task-1) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130)
Test.java class is present in testclient.jar & testclient.jar has been deplyed as a module using command
module add --name=testclient --resources=/Downloads/lib/test/client/testclient.jar --dependencies=javax.api
Test.java class
package com.testmodule.pojo;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
public class Test {
public void getDbConnection(){
try{
Properties jndiProps = new Properties();
jndiProps.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.remote.client.InitialContextFactory");
jndiProps.put(Context.PROVIDER_URL,"remote://291.861.301.732:4447");
jndiProps.put(Context.SECURITY_PRINCIPAL, "testuser");
jndiProps.put(Context.SECURITY_CREDENTIALS, "testpassword");
jndiProps.put("jboss.naming.client.ejb.context", true);
Context context = new InitialContext(jndiProps);
}
catch(Exception e){e.printStackTrace();}
}}
why this error has been occurred, For visiblity of 'org.jboss.naming.remote.client.InitialContextFactory' to testclient.jar, should i have to add more dependencies(currently only javax.api) while deploying testclient.jar as a module? or any other issue which is causing error? Class 'org.jboss.naming.remote.client.InitialContextFactory' is also present in $WILDFLY_HOME/bin/client/jboss-client.jar
Note - 291.861.301.732 is the remote system ip, on which ejb is deployed at jboss. ,This ejb is invoking from Test.java(remote client) using JNDI.
There is no jnp in wildfly-9.0.2.Final(which was in JBOSS 5.x), so i replaced property "org.jnp.interfaces.NamingContextFactory" to value org.jboss.naming.remote.client.InitialContextFactory". why still error is occurred?
Following has been added after receving comment 'Try putting jboss-client.jar in the runtime path, as part of WEB-INF/lib maybe' by 'Sampada Wagde'
I am not able to understand, In this scenarion test.jsp (present in test.ear-->test.war-->test.jsp) file is calling function getDbConnection of Test.java file. Test.java file is present in testclient.jar and this testclient.jar has been deployed as a module.
As per your suggestion, when i put 'jboss-client.jar' in test.ear-->test.war-->WEB-INF-->lib, problem was solved, now while accessing
application 'org.jboss.naming.remote.client.InitialContextFactory' ClassNotFound exception was not occurred...But my problem is that there are multiple war's files(Eg..test.war,test1.war,test2.war) and each war file is accessing Test.java file(present in testclient.jar), so i have to put 'jboss-client.jar' file in WEB-INF/lib of each war archive. which will be very complex for me, is there any other approach available? and secondly how this problem is solved by putting 'jboss-client.jar' into WEB-INF/lib direcory as 'org.jboss.naming.remote.client.InitialContextFactory' is present in testclient.jar(Not in test.ear-->test.war).
Following has been added after receving reply 'jboss-client.jar is required by the server at runtime...' by 'Sampada Wagde'
I also tried following steps
1. By putting 'jboss-deployment-structure.xml' in test.ear-->META-INF-->jboss-deployment-structure.xml
<?xml version="1.0"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
<deployment>
<dependencies>
<module name="testclient" export="true" />
<module name="jboss-client" export="true" />
</dependencies>
</deployment>
Deploying module name as
module add --name=jboss-client --resources=/Downloads/wildfly-9.0.2.Final/bin/client/jboss-client.jar
but still the following error occurred.
14:14:34,376 WARN [org.jboss.modules] (default task-1) Failed to define class org.jboss.naming.remote.client.InitialContextFactory in Module "jboss-client:main" from local module loader #707f7052 (finder: local module finder #11028347 (roots: /Downloads/wildfly-9.0.2.Final/modules,/Downloads/wildfly-9.0.2.Final/modules/system/layers/base)): java.lang.LinkageError: Failed to link org/jboss/naming/remote/client/InitialContextFactory (Module "jboss-client:main" from local module loader #707f7052 (finder: local module finder #11028347 (roots: /Downloads/wildfly-9.0.2.Final/modules,/Downloads/wildfly-9.0.2.Final/modules/system/layers/base)))
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:437)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:269)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:77)
at org.jboss.modules.Module.loadModuleClass(Module.java:560)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197)
Caused by: java.lang.NoClassDefFoundError: javax/naming/spi/InitialContextFactory
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:353)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:432)
Caused by: java.lang.ClassNotFoundException: javax.naming.spi.InitialContextFactory from [Module "jboss-client:main" from local module loader #707f7052 (finder: local module finder #11028347 (roots: /Downloads/wildfly-9.0.2.Final/modules,/Downloads/wildfly-9.0.2.Final/modules/system/layers/base))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)
14:14:34,391 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /test/test.jsp: javax.servlet.ServletException: java.lang.LinkageError: Failed to link org/jboss/naming/remote/client/InitialContextFactory (Module "jboss-client:main" from local module loader #707f7052 (finder: local module finder #11028347 (roots: /Downloads/wildfly-9.0.2.Final/modules,/Downloads/wildfly-9.0.2.Final/modules/system/layers/base)))
at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:777)
at org.apache.jsp.test_jsp._jspService(test_jsp.java:85)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:69)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
Caused by: java.lang.LinkageError: Failed to link org/jboss/naming/remote/client/InitialContextFactory (Module "jboss-client:main" from local module loader #707f7052 (finder: local module finder #11028347 (roots: /Downloads/wildfly-9.0.2.Final/modules,/Downloads/wildfly-9.0.2.Final/modules/system/layers/base)))
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:437)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:269)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:77)
at org.jboss.modules.Module.loadModuleClass(Module.java:560)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197)
Caused by: java.lang.NoClassDefFoundError: javax/naming/spi/InitialContextFactory
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:353)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:432)
Caused by: java.lang.ClassNotFoundException: javax.naming.spi.InitialContextFactory from [Module "jboss-client:main" from local module loader #707f7052 (finder: local module finder #11028347 (roots: /Downloads/wildfly-9.0.2.Final/modules,/Downloads/wildfly-9.0.2.Final/modules/system/layers/base))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)
jboss-client.jar is required by the server at runtime. There are several ways of providing jars to a JBoss server -
include jars in MANIFEST.MF (this is generally used for your own application jars)
include jars in WEB-INF/lib - if the jar is specific to the given web project or WAR
include jars in a module class loader and provide it to the web project via jboss-deploymet-structure.xml . This is done when there are multiple WARS and some of them (not all) need the jars.
include jars in a module class loader and provide it to the server via global modules in standalone.xml . This is done when the jars are being referenced by all applications deployed on the server.
For details on modules in JBoss, please refer to this link -
https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7
As to your question on how putting the jboss-client.jar in a WAR instead of testclient.jar is resolving the issue, the answer is the same - this is how class loading works.
You need to make your own module depend on a module that contains not only the jboss-client jar, but also all the dependencies of jboss-client, this might just be other modules or possibly other jars too. The first class it's moaning about being missing is javax/naming/spi/InitialContextFactory so edit the module.xml for the jboss-client module to depend on javax.api
Using Ceylon IDE 1.2.1 and Vert.x 3.2.1:
import io.vertx.ceylon.core {
vertx_=vertx
}
shared void run() {
value vertx = vertx_.vertx();
}
module has
shared import io.vertx.ceylon.web "3.2.1";
Run as Ceylon Java Application, results in:
Exception in thread "main" java.util.ServiceConfigurationError: io.vertx.core.spi.VerticleFactory: Provider io.vertx.lang.ceylon.CeylonVerticleFactory could not be instantiated
at java.util.ServiceLoader.fail(ServiceLoader.java:232)
at java.util.ServiceLoader.access$100(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at io.vertx.core.impl.DeploymentManager.loadVerticleFactories(DeploymentManager.java:56)
at io.vertx.core.impl.DeploymentManager.<init>(DeploymentManager.java:51)
at io.vertx.core.impl.VertxImpl.<init>(VertxImpl.java:139)
at io.vertx.core.impl.VertxImpl.<init>(VertxImpl.java:114)
at io.vertx.core.impl.VertxImpl.<init>(VertxImpl.java:110)
at io.vertx.core.impl.VertxFactoryImpl.vertx(VertxFactoryImpl.java:34)
at io.vertx.core.Vertx.vertx(Vertx.java:79)
at io.vertx.ceylon.core.vertx_.vertx(vertx_.java:51)
(...)
Caused by: java.lang.NoClassDefFoundError: com/redhat/ceylon/compiler/java/runtime/tools/Options
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getConstructor0(Class.java:3075)
at java.lang.Class.newInstance(Class.java:412)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
... 40 more
Caused by: java.lang.ClassNotFoundException: com.redhat.ceylon.compiler.java.runtime.tools.Options from [Module "io.vertx.lang.ceylon:3.2.1" from Ceylon ModuleLoader: RootRepositoryManager: FileContentStore: /Users/axel/.ceylon/cache]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130)
... 45 more
Any ideas? I can't remember anything like this from the 1.2.0 Ceylon IDE release, so I am guessing there's a change there. Vert.x 3.2.0 gives the same error.
That's because Vert.x 3.2 is only compatible with Ceylon 1.2, not Ceylon 1.2.1. There will be a new version in the coming days to fix that.
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.
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)
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>