Injection error of a JPA object in the Managerbean web project

Asked

Viewed 398 times

1

I am having an injection error of a JPA object in Managerbean in the web project.

I have divided into two projects controlled by the Maven. In the first project called Perolamodel contain the settings persistence.xml, the connection classes with the database, the class with the jpa annotations, and the dao class. In the second project called only Perola I have: The Perolamodelx.x.x.jar I get via Maven the managebean and the xhtml.

In the tests of connection and use of the entity class Holiday works 100% in both projects. But when I use it in the management it gives the injection error.

I already deleted the entire Maven repository to see if it was some dependency conflict I’ve put everything into one web project but the error persists.

Link to file with all data

javax.el.Elexception: /pages/cross.xhtml: An error occurred while performing the inje?? resource in the holiday managed bean. at com.sun.faces.facelets.Compiler.TextInstruction.write(Textinstruction.java:90) at com.sun.faces.facelets.Compiler.UIInstructions.encodeBegin(Uiinstructions.java:82) at org.primefaces.renderkit.CoreRenderer.renderChild(Corerenderer.java:82) at org.primefaces.renderkit.CoreRenderer.renderChildren(Corerenderer.java:72) at org.primefaces.Component.outputlabel.Outputlabelrenderer.encodeEnd(Outputlabelrenderer.java:113) at javax.faces.Component.UIComponentBase.encodeEnd(Uicomponentbase.java:920) at javax.faces.Component.UIComponent.encodeAll(Uicomponent.java:1863) at javax.faces.render.Renderer.encodeChildren(Renderer.java:176) javax.faces.Component.UIComponentBase.encodeChildren(Uicomponentbase.java:890) 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:458) at com.sun.faces.application.view.MultiViewHandler.renderView(Multiviewhandler.java:134) at javax.faces.application.ViewHandlerWrapper.renderView(Viewhandlerwrapper.java:337) with.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:659) at org.apache.Catalina.core.Standardwrapper.service(Standardwrapper.java:1682) at org.apache.Catalina.core.Applicationfilterchain.internalDoFilter(Applicationfilterchain.java:344) at org.apache.Catalina.core.Applicationfilterchain.doFilter(Applicationfilterchain.java:214) at br.com.transportesalvorada.controller.Mb.filtro.Filtrologin.doFilter(Filtrologin.java:30) at org.apache.Catalina.core.Applicationfilterchain.internalDoFilter(Applicationfilterchain.java:256) at org.apache.Catalina.core.Applicationfilterchain.doFilter(Applicationfilterchain.java:214) at org.apache.Catalina.core.Standardwrappervalve.invoke(Standardwrappervalve.java:316) 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:416) at org.apache.Catalina.connector.Coyoteadapter.service(Coyoteadapter.java:283) at com.sun.Enterprise.v3.services.impl.Containermapper$Httphandlercallable.call(Containermapper.java:459) at com.sun.Enterprise.v3.services.impl.ContainerMapper.service(Containermapper.java:167) at org.glassfish.Grizzly.http.server.HttpHandler.runService(Httphandler.java:206) at org.glassfish.Grizzly.http.server.HttpHandler.doHandle(Httphandler.java:180) at org.glassfish.Grizzly.http.server.HttpServerFilter.handleRead(Httpserverfilter.java:235) at org.glassfish.Grizzly.filterchain.Executorresolver$9.execute(Executoresolver.java:119) at org.glassfish.Grizzly.filterchain.Defaultfilterchain.executeFilter(Defaultfilterchain.java:283) at org.glassfish.Grizzly.filterchain.Defaultfilterchain.executeChainPart(Defaultfilterchain.java:200) at org.glassfish.Grizzly.filterchain.Defaultfilterchain.execute(Defaultfilterchain.java:132) at org.glassfish.Grizzly.filterchain.Defaultfilterchain.process(Defaultfilterchain.java:111) at org.glassfish.Grizzly.ProcessorExecutor.execute(Processorexecutor.java:77) at org.glassfish.Grizzly.nio.transport.TCPNIOTransport.fireIOEvent(Tcpniotransport.java:536) at org.glassfish.Grizzly.strategies.Abstractiostrategy.fireIOEvent(Abstractiostrategy.java:112) at org.glassfish.Grizzly.strategies.Workerthreadiostrategy.run0(Workerthreadiostrategy.java:117) at org.glassfish.Grizzly.strategies.Workerthreadiostrategy.access$100(Workerthreadiostrategy.java:56) at org.glassfish.Grizzly.strategies.Workerthreadiostrategy$Workerthreadrunnable.run(Workerthreadiostrategy.java:137) at org.glassfish.Grizzly.threadpool.Abstractthreadpool$Worker.doWork(Abstractthreadpool.java:591) at org.glassfish.Grizzly.threadpool.Abstractthreadpool$Worker.run(Abstractthreadpool.java:571) at java.lang.Thread.run(Thread.java:745) Caused by: com.sun.faces.mgbean.Managedbeancreationexception: An error occurred while performing the inje?? resource in the holiday managed bean

  • I was comparing an old project that works and noticed the following: If I use Hibernate 5.1.0 give the error in question. If I use Hibernate 4.3.8 it works normally. This resolves immediately. But I do not know if it is something that has changed in Hibernate 5.1.0 or is bug.

1 answer

1


See if all references for this bean are correct.

Always remembering that they are Case Sensitive.

It seems to me that it does not "find" the bean and consequently cannot do the Injection by reference.

  • I was comparing an old project that works and noticed the following: If I use Hibernate 5.1.0 give the error in question. If I use Hibernate 4.3.8 it works normally. This resolves immediately. But I do not know if it is something that has changed in Hibernate 5.1.0 or is bug.

  • I was using the Hibernate library erra The correct one was this. <dependency> <groupid>org.Hibernate</groupid> <artifactId>Hibernate-entitymanager</artifactId> <version>5.1.0.Final</version> <Scope>Compile</Scope> </dependency>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.