alan_pjr 19 de out. de 2011
jhonatan1 19 de out. de 2011
Opa… beleza?
Acontece um nullpointer se tento usar o EntityManager.
1 : 00 : 13 , 093 INFO [ config ] Initializing Mojarra ( 1.2 _12 - b01 - FCS ) for context '/fies'
11 : 00 : 14 , 671 INFO [ ServletContextListener ] Welcome to Seam 2.2.0 . GA
11 : 00 : 17 , 843 WARN [ PersistentPermissionResolver ] no permission store available - please install a PermissionStore with the name 'org.jboss.seam.security.jpaPermissionStore' if persistent permissions are required .
11 : 00 : 17 , 984 INFO [ Http11Protocol ] Starting Coyote HTTP / 1.1 on http - localhost % 2 F127 .0.0.1 - 8080
11 : 00 : 18 , 875 INFO [ AjpProtocol ] Starting Coyote AJP / 1.3 on ajp - localhost % 2 F127 .0.0.1 - 8009
11 : 00 : 18 , 890 INFO [ ServerImpl ] JBoss ( Microcontainer ) [ 5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634) ] Started in 44 s : 609 ms
11 : 00 : 37 , 875 WARN [ StatelessBeanContext ] EJBTHREE - 1337 : do not get WebServiceContext property from stateless bean context , it should already have been injected
11 : 00 : 37 , 890 WARN [ InterceptorsFactory ] EJBTHREE - 1246 : Do not use InterceptorsFactory with a ManagedObjectAdvisor , InterceptorRegistry should be used via the bean container
11 : 00 : 37 , 890 WARN [ InterceptorsFactory ] EJBTHREE - 1246 : Do not use InterceptorsFactory with a ManagedObjectAdvisor , InterceptorRegistry should be used via the bean container
11 : 00 : 41 , 921 WARN [ StatelessBeanContext ] EJBTHREE - 1337 : do not get WebServiceContext property from stateless bean context , it should already have been injected
11 : 00 : 41 , 937 ERROR [ SOAPFaultHelperJAXWS ] SOAP request exception
javax . ejb . EJBException : java . lang . NullPointerException
at org . jboss . ejb3 . tx . Ejb3TxPolicy . handleExceptionInOurTx ( Ejb3TxPolicy . java : 77 )
at org . jboss . aspects . tx . TxPolicy . invokeInOurTx ( TxPolicy . java : 83 )
at org . jboss . aspects . tx . TxInterceptor $ Required . invoke ( TxInterceptor . java : 190 )
at org . jboss . aop . joinpoint . MethodInvocation . invokeNext ( MethodInvocation . java : 102 )
at org . jboss . aspects . tx . TxPropagationInterceptor . invoke ( TxPropagationInterceptor . java : 76 )
at org . jboss . aop . joinpoint . MethodInvocation . invokeNext ( MethodInvocation . java : 102 )
at org . jboss . ejb3 . tx . NullInterceptor . invoke ( NullInterceptor . java : 42 )
at org . jboss . aop . joinpoint . MethodInvocation . invokeNext ( MethodInvocation . java : 102 )
at org . jboss . ejb3 . security . RoleBasedAuthorizationInterceptorv2 . invoke ( RoleBasedAuthorizationInterceptorv2 . java : 201 )
at org . jboss . aop . joinpoint . MethodInvocation . invokeNext ( MethodInvocation . java : 102 )
at org . jboss . ejb3 . security . Ejb3AuthenticationInterceptorv2 . invoke ( Ejb3AuthenticationInterceptorv2 . java : 186 )
at org . jboss . aop . joinpoint . MethodInvocation . invokeNext ( MethodInvocation . java : 102 )
at org . jboss . ejb3 . ENCPropagationInterceptor . invoke ( ENCPropagationInterceptor . java : 41 )
at org . jboss . aop . joinpoint . MethodInvocation . invokeNext ( MethodInvocation . java : 102 )
at org . jboss . ejb3 . BlockContainerShutdownInterceptor . invoke ( BlockContainerShutdownInterceptor . java : 67 )
at org . jboss . aop . joinpoint . MethodInvocation . invokeNext ( MethodInvocation . java : 102 )
at org . jboss . aspects . currentinvocation . CurrentInvocationInterceptor . invoke ( CurrentInvocationInterceptor . java : 67 )
at org . jboss . aop . joinpoint . MethodInvocation . invokeNext ( MethodInvocation . java : 102 )
at org . jboss . ejb3 . stateless . StatelessContainer . localInvoke ( StatelessContainer . java : 306 )
at org . jboss . ejb3 . stateless . StatelessContainer . invokeEndpoint ( StatelessContainer . java : 662 )
at org . jboss . wsf . container . jboss50 . invocation . InvocationHandlerEJB3 . invoke ( InvocationHandlerEJB3 . java : 96 )
at org . jboss . ws . core . server . ServiceEndpointInvoker . invoke ( ServiceEndpointInvoker . java : 222 )
at org . jboss . wsf . stack . jbws . RequestHandlerImpl . processRequest ( RequestHandlerImpl . java : 474 )
at org . jboss . wsf . stack . jbws . RequestHandlerImpl . handleRequest ( RequestHandlerImpl . java : 295 )
at org . jboss . wsf . stack . jbws . RequestHandlerImpl . doPost ( RequestHandlerImpl . java : 205 )
at org . jboss . wsf . stack . jbws . RequestHandlerImpl . handleHttpRequest ( RequestHandlerImpl . java : 131 )
at org . jboss . wsf . common . servlet . AbstractEndpointServlet . service ( AbstractEndpointServlet . java : 85 )
at javax . servlet . http . HttpServlet . service ( HttpServlet . java : 803 )
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 290 )
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 )
at org . jboss . web . tomcat . filters . ReplyHeaderFilter . doFilter ( ReplyHeaderFilter . java : 96 )
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( ApplicationFilterChain . java : 235 )
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 )
at org . apache . catalina . core . StandardWrapperValve . invoke ( StandardWrapperValve . java : 235 )
at org . apache . catalina . core . StandardContextValve . invoke ( StandardContextValve . java : 191 )
at org . jboss . web . tomcat . security . SecurityAssociationValve . invoke ( SecurityAssociationValve . java : 190 )
at org . jboss . web . tomcat . security . JaccContextValve . invoke ( JaccContextValve . java : 92 )
at org . jboss . web . tomcat . security . SecurityContextEstablishmentValve . process ( SecurityContextEstablishmentValve . java : 126 )
at org . jboss . web . tomcat . security . SecurityContextEstablishmentValve . invoke ( SecurityContextEstablishmentValve . java : 70 )
at org . apache . catalina . core . StandardHostValve . invoke ( StandardHostValve . java : 127 )
at org . apache . catalina . valves . ErrorReportValve . invoke ( ErrorReportValve . java : 102 )
at org . jboss . web . tomcat . service . jca . CachedConnectionValve . invoke ( CachedConnectionValve . java : 158 )
at org . apache . catalina . core . StandardEngineValve . invoke ( StandardEngineValve . java : 109 )
at org . apache . catalina . connector . CoyoteAdapter . service ( CoyoteAdapter . java : 330 )
at org . apache . coyote . http11 . Http11Processor . process ( Http11Processor . java : 829 )
at org . apache . coyote . http11 . Http11Protocol $ Http11ConnectionHandler . process ( Http11Protocol . java : 598 )
at org . apache . tomcat . util . net . JIoEndpoint $ Worker . run ( JIoEndpoint . java : 447 )
at java . lang . Thread . run ( Unknown Source )
Caused by : java . lang . NullPointerException
at br . gov . mec . fies . services . DriService . listarDrisDisponiveis ( DriService . java : 33 )
at sun . reflect . NativeMethodAccessorImpl . invoke0 ( Native Method )
at sun . reflect . NativeMethodAccessorImpl . invoke ( Unknown Source )
at sun . reflect . DelegatingMethodAccessorImpl . invoke ( Unknown Source )
at java . lang . reflect . Method . invoke ( Unknown Source )
at org . jboss . aop . joinpoint . MethodInvocation . invokeTarget ( MethodInvocation . java : 122 )
at org . jboss . aop . joinpoint . MethodInvocation . invokeNext ( MethodInvocation . java : 111 )
at org . jboss . ejb3 . EJBContainerInvocationWrapper . invokeNext ( EJBContainerInvocationWrapper . java : 69 )
at org . jboss . ejb3 . interceptors . aop . InvocationContextInterceptor $ InvocationContext . proceed ( InvocationContextInterceptor . java : 138 )
at org . jboss . seam . intercept . EJBInvocationContext . proceed ( EJBInvocationContext . java : 44 )
at org . jboss . seam . intercept . RootInterceptor . invoke ( RootInterceptor . java : 101 )
at org . jboss . seam . intercept . SessionBeanInterceptor . aroundInvoke ( SessionBeanInterceptor . java : 50 )
at sun . reflect . NativeMethodAccessorImpl . invoke0 ( Native Method )
at sun . reflect . NativeMethodAccessorImpl . invoke ( Unknown Source )
at sun . reflect . DelegatingMethodAccessorImpl . invoke ( Unknown Source )
at java . lang . reflect . Method . invoke ( Unknown Source )
at org . jboss . ejb3 . interceptors . aop . EJB3InterceptorInterceptor . invoke ( EJB3InterceptorInterceptor . java : 83 )
at org . jboss . ejb3 . interceptors . aop . EJB3InterceptorInterceptor . invoke ( EJB3InterceptorInterceptor . java : 70 )
at org . jboss . ejb3 . EJBContainerInvocationWrapper . invokeNext ( EJBContainerInvocationWrapper . java : 59 )
at org . jboss . ejb3 . interceptors . aop . InterceptorSequencer . invoke ( InterceptorSequencer . java : 73 )
at org . jboss . ejb3 . interceptors . aop . InterceptorSequencer . aroundInvoke ( InterceptorSequencer . java : 59 )
at sun . reflect . NativeMethodAccessorImpl . invoke0 ( Native Method )
at sun . reflect . NativeMethodAccessorImpl . invoke ( Unknown Source )
at sun . reflect . DelegatingMethodAccessorImpl . invoke ( Unknown Source )
at java . lang . reflect . Method . invoke ( Unknown Source )
at org . jboss . aop . advice . PerJoinpointAdvice . invoke ( PerJoinpointAdvice . java : 174 )
at org . jboss . aop . joinpoint . MethodInvocation . invokeNext ( MethodInvocation . java : 102 )
at org . jboss . ejb3 . interceptors . aop . InvocationContextInterceptor . fillMethod ( InvocationContextInterceptor . java : 72 )
at org . jboss . aop . advice . org . jboss . ejb3 . interceptors . aop . InvocationContextInterceptor_z_fillMethod_3136433 . invoke ( InvocationContextInterceptor_z_fillMethod_3136433 . java )
at org . jboss . aop . joinpoint . MethodInvocation . invokeNext ( MethodInvocation . java : 102 )
at org . jboss . ejb3 . interceptors . aop . InvocationContextInterceptor . setup ( InvocationContextInterceptor . java : 88 )
at org . jboss . aop . advice . org . jboss . ejb3 . interceptors . aop . InvocationContextInterceptor_z_setup_3136433 . invoke ( InvocationContextInterceptor_z_setup_3136433 . java )
at org . jboss . aop . joinpoint . MethodInvocation . invokeNext ( MethodInvocation . java : 102 )
at org . jboss . ejb3 . connectionmanager . CachedConnectionInterceptor . invoke ( CachedConnectionInterceptor . java : 62 )
at org . jboss . aop . joinpoint . MethodInvocation . invokeNext ( MethodInvocation . java : 102 )
at org . jboss . ejb3 . entity . TransactionScopedEntityManagerInterceptor . invoke ( TransactionScopedEntityManagerInterceptor . java : 56 )
at org . jboss . aop . joinpoint . MethodInvocation . invokeNext ( MethodInvocation . java : 102 )
at org . jboss . ejb3 . AllowedOperationsInterceptor . invoke ( AllowedOperationsInterceptor . java : 47 )
at org . jboss . aop . joinpoint . MethodInvocation . invokeNext ( MethodInvocation . java : 102 )
at org . jboss . ejb3 . tx . NullInterceptor . invoke ( NullInterceptor . java : 42 )
at org . jboss . aop . joinpoint . MethodInvocation . invokeNext ( MethodInvocation . java : 102 )
at org . jboss . ejb3 . stateless . StatelessInstanceInterceptor . invoke ( StatelessInstanceInterceptor . java : 68 )
at org . jboss . aop . joinpoint . MethodInvocation . invokeNext ( MethodInvocation . java : 102 )
at org . jboss . aspects . tx . TxPolicy . invokeInOurTx ( TxPolicy . java : 79 )
... 46 more
Obrigado
adrianoacp 19 de out. de 2011
Cara passei um problema desse, tenta colocar
< ui : jpa - entity - loader entity - manager = "#{entityManager}" />
no componentes.xml
e declarar la em cima
xmlns : ui = "http://jboss.com/products/seam/ui"
jhonatan1 19 de out. de 2011
Nada cara… mesmo erro ainda
jhonatan1 19 de out. de 2011
Na verdade, apareceu um erro no components
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element ‘ui:jpa-entity-loader’. components.xml /fies/resources/WEB-INF line 32 XML Problem
<? xml version = "1.0" encoding = "UTF-8" ?>
< components xmlns = "http://jboss.com/products/seam/components"
xmlns : core = "http://jboss.com/products/seam/core"
xmlns : persistence = "http://jboss.com/products/seam/persistence"
xmlns : drools = "http://jboss.com/products/seam/drools"
xmlns : bpm = "http://jboss.com/products/seam/bpm"
xmlns : security = "http://jboss.com/products/seam/security"
xmlns : mail = "http://jboss.com/products/seam/mail"
xmlns : web = "http://jboss.com/products/seam/web"
xmlns : xsi = "http://www.w3.org/2001/XMLSchema-instance"
xmlns : ui = "http://jboss.com/products/seam/ui"
xsi : schemaLocation =
"http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.2.xsd
http : //jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.2.xsd
http : //jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.2.xsd
http : //jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.2.xsd
http : //jboss.com/products/seam/security http://jboss.com/products/seam/security-2.2.xsd
http : //jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.2.xsd
http : //jboss.com/products/seam/web http://jboss.com/products/seam/web-2.2.xsd
http : //jboss.com/products/seam/components http://jboss.com/products/seam/components-2.2.xsd">
< core : init debug = "true" jndi - pattern = "@jndiPattern@" />
< core : manager concurrent - request - timeout = "500"
conversation - timeout = "120000"
conversation - id - parameter = "cid"
parent - conversation - id - parameter = "pid" />
<!-- Make sure this URL pattern is the same as that used by the Faces Servlet -->
< web : hot - deploy - filter url - pattern = "*.seam" />
< ui : jpa - entity - loader entity - manager = "#{entityManager}" />
< persistence : managed - persistence - context name = "entityManager" auto - create = "true"
persistence - unit - jndi - name = "java:/fiesEntityManagerFactory" />
< drools : rule - base name = "securityRules" >
< drools : rule - files >< value >/ security . drl </ value ></ drools : rule - files >
</ drools : rule - base >
< security : rule - based - permission - resolver security - rules = "#{securityRules}" />
< security : identity authenticate - method = "#{authenticator.authenticate}" remember - me = "true" />
< event type = "org.jboss.seam.security.notLoggedIn" >
< action execute = "#{redirect.captureCurrentView}" />
</ event >
< event type = "org.jboss.seam.security.loginSuccessful" >
< action execute = "#{redirect.returnToCapturedView}" />
</ event >
< mail : mail - session host = "localhost" port = "25" />
<!-- For use with jBPM pageflow or process management -->
<!--
< bpm : jbpm >
< bpm : process - definitions ></ bpm : process - definitions >
< bpm : pageflow - definitions ></ bpm : pageflow - definitions >
</ bpm : jbpm >
-->
</ components >
alissonvla 19 de out. de 2011
cara,
vc tem injetar seu EntityManager com @PersistenceContext nao @In e vc tem injeta-lo na sua camada de negocio(EJB).
No meu projeto eu so persistence:managed-persistence-context sem ui:jpa-entity-loader.
espero que te ajude.
t+
jhonatan1 19 de out. de 2011
alissonvla:
cara,
vc tem injetar seu EntityManager com @PersistenceContext nao @In e vc tem injeta-lo na sua camada de negocio(EJB).
No meu projeto eu so persistence:managed-persistence-context sem ui:jpa-entity-loader.
espero que te ajude.
t+
Cara!!! Funcionou, era isso mesmo!
Muito obrigado mesmo!
Abraços