That usually mean very beginning of the method.
Most of the transformations we are doing insert code at the beginning
method before line number label marker.
Basically any transformation that emits new code at
MethodVisitor+.visitCode() will cause this.
To work around we need to change those transformations to do something
like this:
void visit*Insn(..) { // all other visit methods for bytecode
instructions only
if(!started) { // to handle case when there is no debug info
emitCodeAtMethodStart();
}
super.visit*Insn(..);
}
void visitLineNumber(...) {
if(!started) {
emitCodeAtMethodStart();
}
super.visitLineNumber(...);
}
visit emitCodeAtMethodStart() {
started = true;
... emit code here
}
The AdviceAdapter may seem look similar, but it mainly meant for
emitting code at the beginning of constructors. I still need to check if
it handle line numbers for methods.
Orion Letizi wrote:
> It doesn't say what line of the WebScope.register method is actually
> causing the error.
>
> The message at the top says that the init() method failed, but the
> stack trace is silent about line numbers.
>
>
>
>
> [ERROR] 2007-06-27 19:34:30,573 main:( org.mortbay.log.invoke )
> Nested in org.springframework.beans.factory.BeanCreationException:
> Error creating bean with name 'web.scope' defined in ServletContext
> resource [/WEB-INF/red5-web.xml]: Invocation of init method failed;
> nested exception is com.tc.object.tx.UnlockedSharedObjectException:
> ************************************************************************
> *******
> Attempt to access a shared object outside the scope of a shared lock.
> All access to shared objects must be within the scope of one or more
> shared locks defined in your Terracotta configuration.
> Please alter the locks section of your Terracotta configuration so
> that this access is auto-locked or protected by a named lock.
>
> Caused by Thread: main in VM(0)
>
> ************************************************************************
> *******
> :
> com.tc.object.tx.UnlockedSharedObjectException:
> ************************************************************************
> *******
> Attempt to access a shared object outside the scope of a shared lock.
> All access to shared objects must be within the scope of one or more
> shared locks defined in your Terracotta configuration.
> Please alter the locks section of your Terracotta configuration so
> that this access is auto-locked or protected by a named lock.
>
> Caused by Thread: main in VM(0)
>
> ************************************************************************
> *******
>
> at
> com.tc.object.tx.ClientTransactionManagerImpl.getTransaction
> (ClientTransactionManagerImpl.java:256)
> at
> com.tc.object.tx.ClientTransactionManagerImpl.getTransaction
> (ClientTransactionManagerImpl.java:241)
> at com.tc.object.tx.ClientTransactionManagerImpl.commit
> (ClientTransactionManagerImpl.java:292)
> at com.tc.object.bytecode.ManagerImpl.monitorExit
> (ManagerImpl.java:464)
> at com.tc.object.bytecode.ManagerUtil.monitorExit
> (ManagerUtil.java:212)
> at org.red5.server.WebScope.register(WebScope.java)
> 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.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:
> 1240)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1205)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.createBean(AbstractAutowireCapableBeanFactory.java:425)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory
> $1.getObject(AbstractBeanFactory.java:251)
> at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.g
> etSingleton(DefaultSingletonBeanRegistry.java:156)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean
> (AbstractBeanFactory.java:248)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean
> (AbstractBeanFactory.java:160)
> at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.pre
> InstantiateSingletons(DefaultListableBeanFactory.java:287)
> at
> org.springframework.context.support.AbstractApplicationContext.refresh
> (AbstractApplicationContext.java:352)
> at
> org.springframework.web.context.ContextLoader.createWebApplicationContex
> t(ContextLoader.java:244)
> at
> org.springframework.web.context.ContextLoader.initWebApplicationContext(
> ContextLoader.java:187)
> at
> org.springframework.web.context.ContextLoaderListener.contextInitialized
> (ContextLoaderListener.java:49)
> at org.mortbay.jetty.handler.ContextHandler.startContext
> (ContextHandler.java:511)
> at org.mortbay.jetty.servlet.Context.startContext
> (Context.java:135)
> at org.mortbay.jetty.webapp.WebAppContext.startContext
> (WebAppContext.java:1191)
> at org.mortbay.jetty.handler.ContextHandler.doStart
> (ContextHandler.java:481)
> at org.mortbay.jetty.webapp.WebAppContext.doStart
> (WebAppContext.java:434)
> at org.mortbay.component.AbstractLifeCycle.start
> (AbstractLifeCycle.java:40)
> at org.mortbay.jetty.handler.HandlerCollection.doStart
> (HandlerCollection.java:147)
> at org.mortbay.jetty.handler.ContextHandlerCollection.doStart
> (ContextHandlerCollection.java:120)
> at org.mortbay.component.AbstractLifeCycle.start
> (AbstractLifeCycle.java:40)
> at org.mortbay.jetty.handler.HandlerCollection.doStart
> (HandlerCollection.java:147)
> at org.mortbay.component.AbstractLifeCycle.start
> (AbstractLifeCycle.java:40)
> at org.mortbay.jetty.handler.HandlerWrapper.doStart
> (HandlerWrapper.java:117)
> at org.mortbay.jetty.Server.doStart(Server.java:210)
> at org.mortbay.component.AbstractLifeCycle.start
> (AbstractLifeCycle.java:40)
> at org.red5.server.JettyLoader.init(JettyLoader.java:166)
> 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.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:
> 1240)
>
> _______________________________________________
> tc-dev mailing list
> [email protected]
> http://lists.terracotta.org/mailman/listinfo/tc-dev
>
_______________________________________________
tc-dev mailing list
[email protected]
http://lists.terracotta.org/mailman/listinfo/tc-dev