[EJB 3.0] - Exception with AroundInvoke
by peiguo
I wrote a Profiler with AroundInvoke, and here is the code:
import javax.interceptor.*;
| import javax.ejb.*;
|
| public class Profiler
| {
| public Profiler() {
| }
|
| @AroundInvoke
| public Object profile(InvocationContext ctx) throws Exception
| {
| System.out.println("there");
| long t1 = System.currentTimeMillis();
| try
| {
| return ctx.proceed();
| }
| finally
| {
| long t2 = System.currentTimeMillis() - t1;
| System.out.println(ctx.getMethod().getName() +
| "(" + ctx.getParameters()[0] + ") took: " +
| ((t2 - t1)/ 1000.0) + " ms");
| }
| }
| }
|
I used it to annotate a class like this:
@Interceptors ({Profiler.class})
When I invoke the EJB, I got this:
2008-07-26 11:35:03,675 ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] SOAP request exception
| org.jboss.tutorial.entity.bean.WSException: web service failed
| at org.jboss.tutorial.entity.bean.CalculatorBean.testReflect(CalculatorBean.java:305)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
| at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.wsf.container.jboss42.InvocationHandlerEJB3.invoke(InvocationHandlerEJB3.java:103)
| at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:220)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:408)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:272)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:189)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:122)
| at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
| 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:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| 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:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:595)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166808#4166808
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166808
17 years, 9 months
Newbie JBoss Clustering Problem
by samk@twinix.com
See Thread at: http://www.techienuggets.com/Detail?tx=45902 Posted on behalf of a User
Hi,
I have two JBoss Servers: 4.2.3.GA (Windows XP) and 4.2.1.GA (Windows 2000). They are running in the "all" server configuration. My problem is that they don't discover each other. The Windows XP on start up shows the following message:
12:49:09,906 INFO [DefaultPartition] Number of cluster members: 1
12:49:09,906 INFO [DefaultPartition] Other members: 0
12:49:09,906 INFO [DefaultPartition] Fetching state (will wait for 30000 millis
econds):
12:49:09,906 INFO [DefaultPartition] State could not be retrieved (we are the f
irst member in group)
I haven't restarted the JBoss running on Windows 2000. I have disabled the firewall on the Windows XP box.
Thanks for any advice.
17 years, 9 months
[JBoss jBPM] - Re: org.hibernate.HibernateException: null index column for
by kukeltje
anonymous wrote : to be honest, I do not know why i am posting question on this forum, since I am the one who only answers on them, and I really do not think I will have an answer on this one :)
Sorry, but that might have to do with how questions are posed, what info is provided etc...
- do you use spring jBPM template? if so, ditch it (not spring, just this template, it's officially only for 3.1.x afaik)
- Do both the junit and tomcat use spring?
- Same jbpm config? (not e.g. one without and one with transactions configured)
- same transactionmanager?
- same transactionmanager config?
- if you cut spring out of it (for this specific situation) does it work then?
anonymous wrote : NOTE: since I am using JBPM with spring and within a big enterprise application, I am not able to send short Unit test, that someone can try locally.
Hmm...... strange.... Does this mean you have very few big classes that do a lot of work?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166795#4166795
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166795
17 years, 9 months