Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Use of EMF Model code in J2EE(Error "org/eclipse/emf/ecore/EObject" "Caused by: java.lang.ClassNotFoundException: org.eclipse.emf.ecore.EObject" on client side using EMF Model code in J2EE application)
Use of EMF Model code in J2EE [message #1431885] Fri, 26 September 2014 09:28 Go to next message
Romain Pinquié is currently offline Romain PinquiéFriend
Messages: 1
Registered: September 2014
Junior Member
Hi everyone,

I set up a J2EE application by using JSF2.2 and a server GlassFish 4.0, as well as created an EMF data model. When I generate the Model code in my src folder of my J2EE application everything works fine, however, after having run the server I refresh my client page and I got the error "org/eclipse/emf/ecore/EObject" "Caused by: java.lang.ClassNotFoundException: org.eclipse.emf.ecore.EObject".

Do you have any guess what the problem can be?

Thank you in advance.

Romain

P.S. Here is the stack trace:

java.lang.NoClassDefFoundError: org/eclipse/emf/ecore/EObject
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:1183)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1728)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1611)
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2436)
at java.lang.Class.getDeclaredFields(Class.java:1806)
at com.sun.faces.util.Util.classHasAnnotations(Util.java:960)
at com.sun.faces.mgbean.BeanBuilder.loadBeanClass(BeanBuilder.java:451)
at com.sun.faces.mgbean.BeanBuilder.bake(BeanBuilder.java:381)
at com.sun.faces.mgbean.ManagedBeanBuilder.bake(ManagedBeanBuilder.java:90)
at com.sun.faces.mgbean.BeanManager.preProcessBean(BeanManager.java:353)
at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:262)
at com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:244)
at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:116)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:116)
at com.sun.el.parser.AstValue.getBase(AstValue.java:151)
at com.sun.el.parser.AstValue.getValue(AstValue.java:200)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
at javax.faces.component.UIOutput.getValue(UIOutput.java:174)
at javax.faces.component.UIInput.getValue(UIInput.java:291)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:355)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
at javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:894)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:443)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.eclipse.emf.ecore.EObject
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1761)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1611)
... 71 more
Re: Use of EMF Model code in J2EE [message #1432019 is a reply to message #1431885] Fri, 26 September 2014 13:40 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31005
Registered: July 2009
Senior Member
Romain,

You'll need to make sure EMF's runtime jars are available on the
classpath for your application on the server.

On 26/09/2014 1:14 PM, Romain Pinquié wrote:
> Hi everyone,
>
> I set up a J2EE application by using JSF2.2 and a server GlassFish
> 4.0, as well as created an EMF data model. When I generate the Model
> code in my src folder of my J2EE application everything works fine,
> however, after having run the server I refresh my client page and I
> got the error "org/eclipse/emf/ecore/EObject" "Caused by:
> java.lang.ClassNotFoundException: org.eclipse.emf.ecore.EObject".
>
> Do you have any guess what the problem can be?
>
> Thank you in advance.
>
> Romain
>
> P.S. Here is the stack trace:
>
> java.lang.NoClassDefFoundError: org/eclipse/emf/ecore/EObject
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
> at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
> at
> org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:1183)
> at
> org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1728)
> at
> org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1611)
> at java.lang.Class.getDeclaredFields0(Native Method)
> at java.lang.Class.privateGetDeclaredFields(Class.java:2436)
> at java.lang.Class.getDeclaredFields(Class.java:1806)
> at com.sun.faces.util.Util.classHasAnnotations(Util.java:960)
> at
> com.sun.faces.mgbean.BeanBuilder.loadBeanClass(BeanBuilder.java:451)
> at com.sun.faces.mgbean.BeanBuilder.bake(BeanBuilder.java:381)
> at
> com.sun.faces.mgbean.ManagedBeanBuilder.bake(ManagedBeanBuilder.java:90)
> at
> com.sun.faces.mgbean.BeanManager.preProcessBean(BeanManager.java:353)
> at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:262)
> at
> com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:244)
> at
> com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:116)
> at
> com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
> at
> com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
> at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:116)
> at com.sun.el.parser.AstValue.getBase(AstValue.java:151)
> at com.sun.el.parser.AstValue.getValue(AstValue.java:200)
> at
> com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
> at
> com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
> at
> javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
> at
> javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
> at javax.faces.component.UIOutput.getValue(UIOutput.java:174)
> at javax.faces.component.UIInput.getValue(UIInput.java:291)
> at
> com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205)
> at
> com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:355)
> at
> com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164)
> at
> javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924)
> at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
> at javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
> at
> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:894)
> at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856)
> at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
> at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
> at
> com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:443)
> at
> com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
> at
> com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
> at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
> at
> com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
> at
> org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
> at
> org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)
> at
> org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
> at
> org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
> at
> org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
> at
> org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
> at
> org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
> at
> org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
> at
> org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
> at
> org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
> at
> org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
> at
> org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
> at
> org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
> at
> org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
> at
> org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
> at
> org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
> at
> org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
> at
> org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.ClassNotFoundException:
> org.eclipse.emf.ecore.EObject
> at
> org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1761)
> at
> org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1611)
> ... 71 more
Previous Topic:ViewModelFileExtensionsManager singleton
Next Topic:[EMFStore] Swallowing exceptions
Goto Forum:
  


Current Time: Tue Mar 31 14:06:11 GMT 2020

Powered by FUDForum. Page generated in 0.02129 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top