Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: glassfish ClassNotFoundException java.lang.ClassNotFoundException: ...

  1. #1
    Junior Member
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default glassfish ClassNotFoundException java.lang.ClassNotFoundException: ...

    hi,

    my eclipse is:
    -------------------------------------------------------
    Eclipse Java EE IDE for Web Developers.

    Version: Indigo Service Release 2
    Build id: 20120216-1857

    --------------------------------------------------------
    Glassfish 3.1.2
    mysql-connector-java-5.1.18-bin.jar
    --------------------------------------------------------

    I wrote my own DAL.
    I exported it as a jar file and added another java project.
    Everything is ok and it works perfect. It can connect to mysql and gets data.

    Now, I tried to write a simple dynamic web project (jsf) and published to glassfish.
    When I called the start page, it gives me an error like tihs:

    ClassNotFoundException java.lang.ClassNotFoundException: DAL.SqlClient.SqlKullTipProvider

    I'm using this code for getting instance of classes.
    _instance = (KullTipProvider)Class.forName("DAL.SqlClient.SqlKullTipProvider", true, ClassLoader.getSystemClassLoader()).newInstance();

    Thanx...

    server log is:

    [#|2012-06-17T16:24:32.289+0300|SEVERE|glassfish3.1.2|javax.e nterprise.system.std.com.sun.enterprise.server.log ging|_ThreadID=70;_ThreadName=Thread-2;|java.lang.ClassNotFoundException: DAL.SqlClient.SqlKullGrupProvider
    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.j ava:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:4 23)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 56)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at DAL.Provider.KullGrupProvider.Instance(KullGrupPro vider.java:17)
    at DAL.LibraryProvider.KullGrup(LibraryProvider.java: 8)
    at BLL.Kull.KullGrup.GetKullGrupAll(KullGrup.java:62)
    at LoginBean.getName(LoginBean.java:21)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at javax.el.BeanELResolver.getValue(BeanELResolver.ja va:363)
    at com.sun.faces.el.DemuxCompositeELResolver._getValu e(DemuxCompositeELResolver.java:176)
    at com.sun.faces.el.DemuxCompositeELResolver.getValue (DemuxCompositeELResolver.java:203)
    at com.sun.el.parser.AstValue.getValue(AstValue.java: 138)
    at com.sun.el.parser.AstValue.getValue(AstValue.java: 183)
    at com.sun.el.parser.AstDeferredExpression.getValue(A stDeferredExpression.java:63)
    at com.sun.el.parser.AstCompositeExpression.getValue( AstCompositeExpression.java:68)
    at com.sun.el.ValueExpressionImpl.getValue(ValueExpre ssionImpl.java:224)
    at com.sun.faces.facelets.el.TagValueExpression.getVa lue(TagValueExpression.java:109)
    at javax.faces.component.ComponentStateHelper.eval(Co mponentStateHelper.java:194)
    at javax.faces.component.ComponentStateHelper.eval(Co mponentStateHelper.java:182)
    at javax.faces.component.UIOutput.getValue(UIOutput.j ava:169)
    at com.sun.faces.renderkit.html_basic.HtmlBasicInputR enderer.getValue(HtmlBasicInputRenderer.java:205)
    at com.sun.faces.renderkit.html_basic.HtmlBasicRender er.getCurrentValue(HtmlBasicRenderer.java:355)
    at com.sun.faces.renderkit.html_basic.LabelRenderer.e ncodeBegin(LabelRenderer.java:121)
    at javax.faces.component.UIComponentBase.encodeBegin( UIComponentBase.java:820)
    at javax.faces.component.UIComponent.encodeAll(UIComp onent.java:1755)
    at javax.faces.component.UIComponent.encodeAll(UIComp onent.java:1760)
    at com.sun.faces.application.view.FaceletViewHandling Strategy.renderView(FaceletViewHandlingStrategy.ja va:402)
    at com.sun.faces.application.view.MultiViewHandler.re nderView(MultiViewHandler.java:131)
    at com.sun.faces.lifecycle.RenderResponsePhase.execut e(RenderResponsePhase.java:121)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:1 01)
    at com.sun.faces.lifecycle.LifecycleImpl.render(Lifec ycleImpl.java:139)
    at javax.faces.webapp.FacesServlet.service(FacesServl et.java:594)
    at org.apache.catalina.core.StandardWrapper.service(S tandardWrapper.java:1542)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:281)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardPipeline.doInvoke (StandardPipeline.java:655)
    at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:595)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:161)
    at org.apache.catalina.connector.CoyoteAdapter.doServ ice(CoyoteAdapter.java:331)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:231)
    at com.sun.enterprise.v3.services.impl.ContainerMappe r$AdapterCallable.call(ContainerMapper.java:317)
    at com.sun.enterprise.v3.services.impl.ContainerMappe r.service(ContainerMapper.java:195)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(P rocessorTask.java:849)
    at com.sun.grizzly.http.ProcessorTask.doProcess(Proce ssorTask.java:746)
    at com.sun.grizzly.http.ProcessorTask.process(Process orTask.java:1045)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute (DefaultProtocolFilter.java:228)
    at com.sun.grizzly.DefaultProtocolChain.executeProtoc olFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(Defau ltProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(Defau ltProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(Htt pProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(Pr otocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(Selec tionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:7 1)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doW ork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run (AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:722)
    |#]
    Last edited by enginco; June 17th, 2012 at 08:40 AM.


  2. #2
    Junior Member
    Join Date
    May 2012
    Location
    Bali, ID
    Posts
    6
    My Mood
    Happy
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default Re: glassfish ClassNotFoundException java.lang.ClassNotFoundException: ...

    Have you included your DAL classes in your web application archive (war) under the WEB-INF/classes or if it was packed as jar file under the WEB-INF/lib?

  3. The Following User Says Thank You to wsaryada For This Useful Post:

    enginco (June 18th, 2012)

  4. #3
    Junior Member
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: glassfish ClassNotFoundException java.lang.ClassNotFoundException: ...

    hehe, it worked thanx

Similar Threads

  1. Replies: 3
    Last Post: March 7th, 2012, 05:54 AM
  2. java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    By i4ba1 in forum JDBC & Databases
    Replies: 2
    Last Post: August 23rd, 2011, 12:41 PM
  3. Replies: 15
    Last Post: June 22nd, 2011, 07:47 PM
  4. [SOLVED] ClassNotFoundException - Please Help
    By igniteflow in forum Exceptions
    Replies: 11
    Last Post: October 3rd, 2010, 10:50 PM
  5. ClassNotFoundException ???
    By wolfgar in forum JDBC & Databases
    Replies: 2
    Last Post: November 20th, 2009, 01:35 PM