aspose file tools*
The moose likes JBoss/WildFly and the fly likes java.lang.ClassNotFoundException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Reply locked New topic
Author

java.lang.ClassNotFoundException

sarvan kumar
Ranch Hand

Joined: Jul 28, 2010
Posts: 66
Hi,
When I run a application in jboss 4.0 it runs fine but when i run the same application in jboss 5.0.1.GA it shows

java.lang.ClassNotFoundException in log file what is the problem.

It show this error when i enter the username and password and click enter

Can anyone give solution for this problem

Thanks,
K.Saravanan
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10266
    
168

1) Don't use 5.0.1 version of JBoss AS. Use 5.1.0
2) Please post the entire exception stacktrace
3) How is your application packaged?
4) Where is the jar containing the missing class located?


[My Blog] [JavaRanch Journal]
sarvan kumar
Ranch Hand

Joined: Jul 28, 2010
Posts: 66
Hi,
Iam using eclipse 3.5 and jboss 5.0 and adobe flex builder 3 and in the project when build the project i got the following error

"The attribute value type is com.adobe.flexbuilder.project.compiler.internal.ProblemManager and expected is one of java.lang.String, Boolean, Integer" Flex Problem

can anyone give the solution

Thanks
K.Saravanan
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10266
    
168

Sarvan,

Please continue the rest of the IDE related discussion in this thread in IDE forum http://www.coderanch.com/t/516809/vc/Flex-Eclipse-Attribute-type
Aashish Shivhare
Greenhorn

Joined: Nov 12, 2010
Posts: 3
Hi Jaikiran and Sarvan,
I have the same problem.
I am working on the application where I used Eclipse 3.5 and JBoss 4.0 my application works fine.
Then I moved to JBoss 5.0 now it gives me the exception, java.lang.ClassNotFoundException.
Then I found that class for which this exception raised, was present in the deployed war file.

I found the reasons behind this, I found that exception was raised in my code because of two reason,

1)I found that I had used, class.getResource(ClassName) in my code.

2)JBoss 4.x deploy the war and extract it in the temp directory and from there it used all the binary, but in the case of JBoss 5.0, it directly use the binaries from the deployed war.

When I used the JBoss 4.x, getResource gives me path of class name with file protocol and same with JBoss 5.0 gives me vfszip protocol.
This thing differs the JBoss 4.x and 5.0.

To solved first issue, I replaced my code with,
URL tempURL = ClassName.class.getResource(ClassName);
URLConnection objJarURLConnection = tempURL.openConnection();

gives this URLConnection to the XMLHandler for parsing.

To solved second issue, I extract the deployed war with the same name with extension (like TestingJBoss.war) in the same place.

Now, I run the code and it runs successfully.


Thanks,
Aashish Shivhare
sarvan kumar
Ranch Hand

Joined: Jul 28, 2010
Posts: 66
Hi Aashish,

I have apply the changes that you have mentioned but now i got the null pointer exception in log file

18 Dec 2010 11:31:52,002 INFO LoginAction:83 - LoginAction >> UserName 'admin' Password 'admin'
18 Dec 2010 11:31:52,002 INFO BusinessLayer:65 - ManageUser >> LoginBL >> convertDTOToBO starts
18 Dec 2010 11:31:52,002 INFO BusinessLayer:73 - ManageUser >> LoginBL >> convertDTOToBO ends
18 Dec 2010 11:31:52,002 INFO STDOUT:156 - In DAO Layercom.visiontss.accuquote.dao.hb.LoginHBDAO
18 Dec 2010 11:31:52,002 ERROR BusinessLayer:126 - LoginBL Checking User Existnull
18 Dec 2010 11:31:52,002 ERROR STDERR:156 - java.lang.NullPointerException
18 Dec 2010 11:31:52,002 ERROR STDERR:156 - at com.visiontss.accuquote.dao.DataAccessObject.getDAO(DataAccessObject.java:48)
18 Dec 2010 11:31:52,002 ERROR STDERR:156 - at com.visiontss.accuquote.bo.BusinessObject.getDao(BusinessObject.java:36)
18 Dec 2010 11:31:52,002 ERROR STDERR:156 - at com.visiontss.accuquote.bo.BusinessObject.read(BusinessObject.java:47)
18 Dec 2010 11:31:52,002 ERROR STDERR:156 - at com.visiontss.accuquote.bo.Login.isUserExist(Login.java:336)
18 Dec 2010 11:31:52,002 ERROR STDERR:156 - at com.visiontss.accuquote.bl.LoginBL.isUserExist(LoginBL.java:114)
18 Dec 2010 11:31:52,002 ERROR STDERR:156 - at com.visiontss.accuquote.facade.LoginFacadeBean.isUserExist(LoginFacadeBean.java:69)
18 Dec 2010 11:31:52,002 ERROR STDERR:156 - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
18 Dec 2010 11:31:52,002 ERROR STDERR:156 - at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
18 Dec 2010 11:31:52,002 ERROR STDERR:156 - at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
18 Dec 2010 11:31:52,002 ERROR STDERR:156 - at java.lang.reflect.Method.invoke(Unknown Source)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.invocation.Invocation.performCall(Invocation.java:386)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:228)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:156)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:173)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:228)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:211)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.ejb.plugins.security.PreSecurityInterceptor.process(PreSecurityInterceptor.java:97)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.ejb.plugins.security.PreSecurityInterceptor.invoke(PreSecurityInterceptor.java:81)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:650)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.ejb.Container.invoke(Container.java:1029)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at java.lang.reflect.Method.invoke(Unknown Source)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.proxy.ejb.SecurityContextInterceptor.invoke(SecurityContextInterceptor.java:64)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:68)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:101)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at $Proxy134.isUserExist(Unknown Source)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at com.visiontss.accuquote.action.LoginAction.execute(LoginAction.java:90)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
18 Dec 2010 11:31:52,033 ERROR STDERR:156 - at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
18 Dec 2010 11:31:52,049 ERROR STDERR:156 - at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
18 Dec 2010 11:31:52,049 ERROR STDERR:156 - at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
18 Dec 2010 11:31:52,049 ERROR STDERR:156 - at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
18 Dec 2010 11:31:52,049 ERROR STDERR:156 - at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
18 Dec 2010 11:31:52,049 ERROR STDERR:156 - at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
18 Dec 2010 11:31:52,049 ERROR STDERR:156 - at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
18 Dec 2010 11:31:52,049 ERROR STDERR:156 - at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
18 Dec 2010 11:31:52,049 ERROR STDERR:156 - at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
18 Dec 2010 11:31:52,049 ERROR STDERR:156 - at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
18 Dec 2010 11:31:52,049 ERROR STDERR:156 - at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
18 Dec 2010 11:31:52,049 ERROR STDERR:156 - at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
18 Dec 2010 11:31:52,049 ERROR STDERR:156 - at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
18 Dec 2010 11:31:52,049 ERROR STDERR:156 - at java.lang.Thread.run(Unknown Source)

can you give the solution for this

Thanks,
K.Saravanan
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10266
    
168

Sarvan,

I'm closing this thread. You have to stop posting to unrelated threads. Continue here http://www.coderanch.com/t/520835/JBoss/java-lang-NullPointerException
 
wood burning stoves
 
subject: java.lang.ClassNotFoundException