NullPointerException creating EntityManager from EntityManagerFactory [closed]createEntityManager throws java.lang.NullPointerException at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatusJPA EntityManager: Why use persist() over merge()?Error : Can' t connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variableorg.springframework.expression.spel.SpelEvaluationException: EL1004E:(pos 15):Method call: Method getId() cannot be found on java.util.ArrayList typeDoes Spring actually start a new transaction with REQUIRES_NEW?Application Migration from Windows 2003 Server to CentOSMarkLogic PojoQueryBuilder is not working with jboss EAPSpringframework.dao.InvalidDataAccessResourceUsageException hibernate.SQLGrammarException MySQLSyntaxErrorExceptionSAML-Key with alias mykey doesn't have a private keyspring mvc bootsrap modal uisng spring tag library getById() and validation annotation basedRemoving urlEncodingAttributes values breaks the page (hybris)

Why do so many pure math PhD students drop out or leave academia, compared to applied mathematics PhDs?

Do I need a 50/60Hz notch filter for battery powered devices?

Why should I cook the flour first when making bechamel sauce?

Why did Steve Rogers choose this character in Endgame?

Can a Resident Assistant Be Told to Ignore a Lawful Order?

How fast does a character need to move to be effectively invisible?

How to use function $_GET in Magento 2?

How could an animal "smell" carbon monoxide?

Was all the fuel expended in each stage of a Saturn V launch?

What details should I consider before agreeing for part of my salary to be 'retained' by employer?

Fantasy Story About A Boy And Girl That Enter A Fantasy World Pre-1994

How to ask my office to remove the pride decorations without appearing anti-LGBTQ?

Can a pizza stone be fixed after soap has been used to clean it?

What made Windows ME so crash-prone?

(Piano) is the purpose of sheet music to be played along to? Or a guide for learning and reference during playing?

Get back to US from Canada without passport

What exactly is a Hadouken?

Why do candidates not quit if they no longer have a realistic chance to win in the 2020 US presidents election

Why are road bikes (not time trial bikes) used in many triathlons?

If I stood next to a piece of metal heated to a million degrees, but in a perfect vacuum, would I feel hot?

Interviewing with an unmentioned 9 months of sick leave taken during a job

Identification of an AC transformer

Why is Katakana not pronounced Katagana?

What "fuel more powerful than anything the West (had) in stock" put Laika in orbit aboard Sputnik 2?



NullPointerException creating EntityManager from EntityManagerFactory [closed]


createEntityManager throws java.lang.NullPointerException at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatusJPA EntityManager: Why use persist() over merge()?Error : Can' t connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variableorg.springframework.expression.spel.SpelEvaluationException: EL1004E:(pos 15):Method call: Method getId() cannot be found on java.util.ArrayList typeDoes Spring actually start a new transaction with REQUIRES_NEW?Application Migration from Windows 2003 Server to CentOSMarkLogic PojoQueryBuilder is not working with jboss EAPSpringframework.dao.InvalidDataAccessResourceUsageException hibernate.SQLGrammarException MySQLSyntaxErrorExceptionSAML-Key with alias mykey doesn't have a private keyspring mvc bootsrap modal uisng spring tag library getById() and validation annotation basedRemoving urlEncodingAttributes values breaks the page (hybris)






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have created a EntityManagerFactory successfully, using the persistence unit added in my persistence.xml, but the console log shows an exception when creating the EntityManager this way:



EntityManagerFactory emf;
EntityManager em;
...
emf = Persistence.createEntityManagerFactory("unidadPersistencia");
em = emf.createEntityManager(); //the error is in this line.


The app recognizes the connection and the correct table. but I am not able to create the EntityManager.



Entity:



@Entity
@Table(name = "CVINSTELEMATICA")
public class SolicitudTelematica extends AbstractEntity{

private static final long serialVersionUID = 1L;

@Id
@NotNull
@Column(name = "ID")
private long idTelematica;

@Column(name = "NUMEROMENORES", columnDefinition = "smallint")
private int numeroMenores;

@Column(name = "NIFTUTOR", columnDefinition = "nvarchar")
private String nifTutor;


Persistence.xml:



<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="unidadPersistencia" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>es.xunta.amtega.vp301b.entity.SolicitudTelematica</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<property name="javax.persistence.jdbc.url" value="DB_URL"/>
<property name="javax.persistence.jdbc.user" value="usr"/>
<property name="javax.persistence.jdbc.password" value=pwd/>
</properties>
</persistence-unit>
</persistence>


It is possible that something is missing in the persistence file or in the entity?



Trace:



09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) 2019-03-26 09:26:45,865 ERROR [http-localhost/127.0.0.1:8443-2] Error: es.xunta.amtega.vp301b.interfaz.web.InterfazController.sacarString() es.xunta.amtega.transversal.archam.core.exception.InternalErrorException

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.aop.LoggingAspect.translate(LoggingAspect.java:130)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.aop.LoggingAspect.logAfterExceptionThrowing(LoggingAspect.java:67)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at java.lang.reflect.Method.invoke(Method.java:606)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:609)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:66)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.vp301b.interfaz.web.InterfazController$$EnhancerBySpringCGLIB$$fa3183e9.sacarString(<generated>)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at java.lang.reflect.Method.invoke(Method.java:606)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.web.filter.RefererManagerFilter.doFilter(RefererManagerFilter.java:78)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:124)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.web.filter.ExecutionContextFilter.doFilter(ExecutionContextFilter.java:73)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.multipart.support.MultipartFilter.doFilterInternal(MultipartFilter.java:122)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.web.filter.ExceptionAwareMultipartFilter.doFilterInternal(ExceptionAwareMultipartFilter.java:64)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at java.lang.Thread.run(Thread.java:745)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) Caused by: java.lang.NullPointerException

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:76)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.isActive(JtaStatusHelper.java:118)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.engine.transaction.internal.jta.CMTTransaction.join(CMTTransaction.java:149)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1602)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.postInit(AbstractEntityManagerImpl.java:210)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.internal.EntityManagerImpl.<init>(EntityManagerImpl.java:91)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.internal.EntityManagerFactoryImpl.internalCreateEntityManager(EntityManagerFactoryImpl.java:345)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.internal.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:313)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.vp301b.interfaz.web.InterfazController.sacarString(InterfazController.java:122)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.vp301b.interfaz.web.InterfazController$$FastClassBySpringCGLIB$$3a2d1d25.invoke(<generated>)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) ... 90 more


I am using JBoss EAP 6.1 and Java 7.










share|improve this question















closed as off-topic by JB Nizet, Max Vollmer, Matteo Baldi, Mark Rotteveel, rjdkolb Mar 26 at 10:21


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Reproducible Example." – JB Nizet, Max Vollmer, Matteo Baldi, Mark Rotteveel
If this question can be reworded to fit the rules in the help center, please edit the question.
















  • the app crashes: I doubt it. You probably have an exception, with a type, a message, and a stack trace. Post all of that: reading the error message and stack trace is always the first step to discover what is wrong.

    – JB Nizet
    Mar 26 at 8:18











  • @JBNizet Sorry. I updated the question.

    – Angel Gonzalez Pena
    Mar 26 at 8:28






  • 2





    Possible duplicate of createEntityManager throws java.lang.NullPointerException at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus

    – devmind
    Mar 26 at 9:34

















0















I have created a EntityManagerFactory successfully, using the persistence unit added in my persistence.xml, but the console log shows an exception when creating the EntityManager this way:



EntityManagerFactory emf;
EntityManager em;
...
emf = Persistence.createEntityManagerFactory("unidadPersistencia");
em = emf.createEntityManager(); //the error is in this line.


The app recognizes the connection and the correct table. but I am not able to create the EntityManager.



Entity:



@Entity
@Table(name = "CVINSTELEMATICA")
public class SolicitudTelematica extends AbstractEntity{

private static final long serialVersionUID = 1L;

@Id
@NotNull
@Column(name = "ID")
private long idTelematica;

@Column(name = "NUMEROMENORES", columnDefinition = "smallint")
private int numeroMenores;

@Column(name = "NIFTUTOR", columnDefinition = "nvarchar")
private String nifTutor;


Persistence.xml:



<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="unidadPersistencia" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>es.xunta.amtega.vp301b.entity.SolicitudTelematica</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<property name="javax.persistence.jdbc.url" value="DB_URL"/>
<property name="javax.persistence.jdbc.user" value="usr"/>
<property name="javax.persistence.jdbc.password" value=pwd/>
</properties>
</persistence-unit>
</persistence>


It is possible that something is missing in the persistence file or in the entity?



Trace:



09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) 2019-03-26 09:26:45,865 ERROR [http-localhost/127.0.0.1:8443-2] Error: es.xunta.amtega.vp301b.interfaz.web.InterfazController.sacarString() es.xunta.amtega.transversal.archam.core.exception.InternalErrorException

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.aop.LoggingAspect.translate(LoggingAspect.java:130)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.aop.LoggingAspect.logAfterExceptionThrowing(LoggingAspect.java:67)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at java.lang.reflect.Method.invoke(Method.java:606)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:609)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:66)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.vp301b.interfaz.web.InterfazController$$EnhancerBySpringCGLIB$$fa3183e9.sacarString(<generated>)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at java.lang.reflect.Method.invoke(Method.java:606)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.web.filter.RefererManagerFilter.doFilter(RefererManagerFilter.java:78)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:124)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.web.filter.ExecutionContextFilter.doFilter(ExecutionContextFilter.java:73)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.multipart.support.MultipartFilter.doFilterInternal(MultipartFilter.java:122)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.web.filter.ExceptionAwareMultipartFilter.doFilterInternal(ExceptionAwareMultipartFilter.java:64)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at java.lang.Thread.run(Thread.java:745)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) Caused by: java.lang.NullPointerException

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:76)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.isActive(JtaStatusHelper.java:118)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.engine.transaction.internal.jta.CMTTransaction.join(CMTTransaction.java:149)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1602)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.postInit(AbstractEntityManagerImpl.java:210)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.internal.EntityManagerImpl.<init>(EntityManagerImpl.java:91)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.internal.EntityManagerFactoryImpl.internalCreateEntityManager(EntityManagerFactoryImpl.java:345)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.internal.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:313)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.vp301b.interfaz.web.InterfazController.sacarString(InterfazController.java:122)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.vp301b.interfaz.web.InterfazController$$FastClassBySpringCGLIB$$3a2d1d25.invoke(<generated>)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) ... 90 more


I am using JBoss EAP 6.1 and Java 7.










share|improve this question















closed as off-topic by JB Nizet, Max Vollmer, Matteo Baldi, Mark Rotteveel, rjdkolb Mar 26 at 10:21


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Reproducible Example." – JB Nizet, Max Vollmer, Matteo Baldi, Mark Rotteveel
If this question can be reworded to fit the rules in the help center, please edit the question.
















  • the app crashes: I doubt it. You probably have an exception, with a type, a message, and a stack trace. Post all of that: reading the error message and stack trace is always the first step to discover what is wrong.

    – JB Nizet
    Mar 26 at 8:18











  • @JBNizet Sorry. I updated the question.

    – Angel Gonzalez Pena
    Mar 26 at 8:28






  • 2





    Possible duplicate of createEntityManager throws java.lang.NullPointerException at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus

    – devmind
    Mar 26 at 9:34













0












0








0








I have created a EntityManagerFactory successfully, using the persistence unit added in my persistence.xml, but the console log shows an exception when creating the EntityManager this way:



EntityManagerFactory emf;
EntityManager em;
...
emf = Persistence.createEntityManagerFactory("unidadPersistencia");
em = emf.createEntityManager(); //the error is in this line.


The app recognizes the connection and the correct table. but I am not able to create the EntityManager.



Entity:



@Entity
@Table(name = "CVINSTELEMATICA")
public class SolicitudTelematica extends AbstractEntity{

private static final long serialVersionUID = 1L;

@Id
@NotNull
@Column(name = "ID")
private long idTelematica;

@Column(name = "NUMEROMENORES", columnDefinition = "smallint")
private int numeroMenores;

@Column(name = "NIFTUTOR", columnDefinition = "nvarchar")
private String nifTutor;


Persistence.xml:



<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="unidadPersistencia" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>es.xunta.amtega.vp301b.entity.SolicitudTelematica</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<property name="javax.persistence.jdbc.url" value="DB_URL"/>
<property name="javax.persistence.jdbc.user" value="usr"/>
<property name="javax.persistence.jdbc.password" value=pwd/>
</properties>
</persistence-unit>
</persistence>


It is possible that something is missing in the persistence file or in the entity?



Trace:



09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) 2019-03-26 09:26:45,865 ERROR [http-localhost/127.0.0.1:8443-2] Error: es.xunta.amtega.vp301b.interfaz.web.InterfazController.sacarString() es.xunta.amtega.transversal.archam.core.exception.InternalErrorException

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.aop.LoggingAspect.translate(LoggingAspect.java:130)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.aop.LoggingAspect.logAfterExceptionThrowing(LoggingAspect.java:67)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at java.lang.reflect.Method.invoke(Method.java:606)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:609)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:66)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.vp301b.interfaz.web.InterfazController$$EnhancerBySpringCGLIB$$fa3183e9.sacarString(<generated>)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at java.lang.reflect.Method.invoke(Method.java:606)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.web.filter.RefererManagerFilter.doFilter(RefererManagerFilter.java:78)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:124)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.web.filter.ExecutionContextFilter.doFilter(ExecutionContextFilter.java:73)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.multipart.support.MultipartFilter.doFilterInternal(MultipartFilter.java:122)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.web.filter.ExceptionAwareMultipartFilter.doFilterInternal(ExceptionAwareMultipartFilter.java:64)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at java.lang.Thread.run(Thread.java:745)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) Caused by: java.lang.NullPointerException

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:76)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.isActive(JtaStatusHelper.java:118)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.engine.transaction.internal.jta.CMTTransaction.join(CMTTransaction.java:149)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1602)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.postInit(AbstractEntityManagerImpl.java:210)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.internal.EntityManagerImpl.<init>(EntityManagerImpl.java:91)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.internal.EntityManagerFactoryImpl.internalCreateEntityManager(EntityManagerFactoryImpl.java:345)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.internal.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:313)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.vp301b.interfaz.web.InterfazController.sacarString(InterfazController.java:122)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.vp301b.interfaz.web.InterfazController$$FastClassBySpringCGLIB$$3a2d1d25.invoke(<generated>)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) ... 90 more


I am using JBoss EAP 6.1 and Java 7.










share|improve this question
















I have created a EntityManagerFactory successfully, using the persistence unit added in my persistence.xml, but the console log shows an exception when creating the EntityManager this way:



EntityManagerFactory emf;
EntityManager em;
...
emf = Persistence.createEntityManagerFactory("unidadPersistencia");
em = emf.createEntityManager(); //the error is in this line.


The app recognizes the connection and the correct table. but I am not able to create the EntityManager.



Entity:



@Entity
@Table(name = "CVINSTELEMATICA")
public class SolicitudTelematica extends AbstractEntity{

private static final long serialVersionUID = 1L;

@Id
@NotNull
@Column(name = "ID")
private long idTelematica;

@Column(name = "NUMEROMENORES", columnDefinition = "smallint")
private int numeroMenores;

@Column(name = "NIFTUTOR", columnDefinition = "nvarchar")
private String nifTutor;


Persistence.xml:



<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="unidadPersistencia" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>es.xunta.amtega.vp301b.entity.SolicitudTelematica</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<property name="javax.persistence.jdbc.url" value="DB_URL"/>
<property name="javax.persistence.jdbc.user" value="usr"/>
<property name="javax.persistence.jdbc.password" value=pwd/>
</properties>
</persistence-unit>
</persistence>


It is possible that something is missing in the persistence file or in the entity?



Trace:



09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) 2019-03-26 09:26:45,865 ERROR [http-localhost/127.0.0.1:8443-2] Error: es.xunta.amtega.vp301b.interfaz.web.InterfazController.sacarString() es.xunta.amtega.transversal.archam.core.exception.InternalErrorException

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.aop.LoggingAspect.translate(LoggingAspect.java:130)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.aop.LoggingAspect.logAfterExceptionThrowing(LoggingAspect.java:67)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at java.lang.reflect.Method.invoke(Method.java:606)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)

09:26:45,867 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:609)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:66)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.vp301b.interfaz.web.InterfazController$$EnhancerBySpringCGLIB$$fa3183e9.sacarString(<generated>)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at java.lang.reflect.Method.invoke(Method.java:606)

09:26:45,868 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)

09:26:45,869 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.web.filter.RefererManagerFilter.doFilter(RefererManagerFilter.java:78)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,870 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)

09:26:45,871 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:124)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,872 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.web.filter.ExecutionContextFilter.doFilter(ExecutionContextFilter.java:73)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,873 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.multipart.support.MultipartFilter.doFilterInternal(MultipartFilter.java:122)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.transversal.archam.core.web.filter.ExceptionAwareMultipartFilter.doFilterInternal(ExceptionAwareMultipartFilter.java:64)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,874 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)

09:26:45,875 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at java.lang.Thread.run(Thread.java:745)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) Caused by: java.lang.NullPointerException

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:76)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.isActive(JtaStatusHelper.java:118)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.engine.transaction.internal.jta.CMTTransaction.join(CMTTransaction.java:149)

09:26:45,876 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1602)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.postInit(AbstractEntityManagerImpl.java:210)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.internal.EntityManagerImpl.<init>(EntityManagerImpl.java:91)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.internal.EntityManagerFactoryImpl.internalCreateEntityManager(EntityManagerFactoryImpl.java:345)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.hibernate.jpa.internal.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:313)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.vp301b.interfaz.web.InterfazController.sacarString(InterfazController.java:122)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at es.xunta.amtega.vp301b.interfaz.web.InterfazController$$FastClassBySpringCGLIB$$3a2d1d25.invoke(<generated>)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)

09:26:45,877 INFO [stdout] (http-localhost/127.0.0.1:8443-2) ... 90 more


I am using JBoss EAP 6.1 and Java 7.







java-ee jboss persistence entitymanager






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 26 at 8:27







Angel Gonzalez Pena

















asked Mar 26 at 8:11









Angel Gonzalez PenaAngel Gonzalez Pena

56 bronze badges




56 bronze badges




closed as off-topic by JB Nizet, Max Vollmer, Matteo Baldi, Mark Rotteveel, rjdkolb Mar 26 at 10:21


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Reproducible Example." – JB Nizet, Max Vollmer, Matteo Baldi, Mark Rotteveel
If this question can be reworded to fit the rules in the help center, please edit the question.







closed as off-topic by JB Nizet, Max Vollmer, Matteo Baldi, Mark Rotteveel, rjdkolb Mar 26 at 10:21


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Reproducible Example." – JB Nizet, Max Vollmer, Matteo Baldi, Mark Rotteveel
If this question can be reworded to fit the rules in the help center, please edit the question.












  • the app crashes: I doubt it. You probably have an exception, with a type, a message, and a stack trace. Post all of that: reading the error message and stack trace is always the first step to discover what is wrong.

    – JB Nizet
    Mar 26 at 8:18











  • @JBNizet Sorry. I updated the question.

    – Angel Gonzalez Pena
    Mar 26 at 8:28






  • 2





    Possible duplicate of createEntityManager throws java.lang.NullPointerException at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus

    – devmind
    Mar 26 at 9:34

















  • the app crashes: I doubt it. You probably have an exception, with a type, a message, and a stack trace. Post all of that: reading the error message and stack trace is always the first step to discover what is wrong.

    – JB Nizet
    Mar 26 at 8:18











  • @JBNizet Sorry. I updated the question.

    – Angel Gonzalez Pena
    Mar 26 at 8:28






  • 2





    Possible duplicate of createEntityManager throws java.lang.NullPointerException at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus

    – devmind
    Mar 26 at 9:34
















the app crashes: I doubt it. You probably have an exception, with a type, a message, and a stack trace. Post all of that: reading the error message and stack trace is always the first step to discover what is wrong.

– JB Nizet
Mar 26 at 8:18





the app crashes: I doubt it. You probably have an exception, with a type, a message, and a stack trace. Post all of that: reading the error message and stack trace is always the first step to discover what is wrong.

– JB Nizet
Mar 26 at 8:18













@JBNizet Sorry. I updated the question.

– Angel Gonzalez Pena
Mar 26 at 8:28





@JBNizet Sorry. I updated the question.

– Angel Gonzalez Pena
Mar 26 at 8:28




2




2





Possible duplicate of createEntityManager throws java.lang.NullPointerException at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus

– devmind
Mar 26 at 9:34





Possible duplicate of createEntityManager throws java.lang.NullPointerException at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus

– devmind
Mar 26 at 9:34












1 Answer
1






active

oldest

votes


















0














I think when you are using JTA as a transaction type you must be in a JEE environment so the container (JBoss, in your case) will handle the entity manager with the annotation @PersistenceContext, but here you are handling the entity manager by your self, creating the entity manager factory, you are not in JEE environment, you are just using Java SE, so I think you must change transaction-type="JTA" to transaction-type="RESOURCE_LOCAL" in your persistence unit XML file.






share|improve this answer




























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I think when you are using JTA as a transaction type you must be in a JEE environment so the container (JBoss, in your case) will handle the entity manager with the annotation @PersistenceContext, but here you are handling the entity manager by your self, creating the entity manager factory, you are not in JEE environment, you are just using Java SE, so I think you must change transaction-type="JTA" to transaction-type="RESOURCE_LOCAL" in your persistence unit XML file.






    share|improve this answer





























      0














      I think when you are using JTA as a transaction type you must be in a JEE environment so the container (JBoss, in your case) will handle the entity manager with the annotation @PersistenceContext, but here you are handling the entity manager by your self, creating the entity manager factory, you are not in JEE environment, you are just using Java SE, so I think you must change transaction-type="JTA" to transaction-type="RESOURCE_LOCAL" in your persistence unit XML file.






      share|improve this answer



























        0












        0








        0







        I think when you are using JTA as a transaction type you must be in a JEE environment so the container (JBoss, in your case) will handle the entity manager with the annotation @PersistenceContext, but here you are handling the entity manager by your self, creating the entity manager factory, you are not in JEE environment, you are just using Java SE, so I think you must change transaction-type="JTA" to transaction-type="RESOURCE_LOCAL" in your persistence unit XML file.






        share|improve this answer















        I think when you are using JTA as a transaction type you must be in a JEE environment so the container (JBoss, in your case) will handle the entity manager with the annotation @PersistenceContext, but here you are handling the entity manager by your self, creating the entity manager factory, you are not in JEE environment, you are just using Java SE, so I think you must change transaction-type="JTA" to transaction-type="RESOURCE_LOCAL" in your persistence unit XML file.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 28 at 10:28









        Bhavik Patel

        6661 gold badge4 silver badges20 bronze badges




        6661 gold badge4 silver badges20 bronze badges










        answered Mar 26 at 9:49









        M.IsmailM.Ismail

        17910 bronze badges




        17910 bronze badges


















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.





            Popular posts from this blog

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

            155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해