ok, had some time today to have a look again...
The getNext() is now done in the AbstractInterceptor.Invoke()...
so I just deleted all the lines in the LifecycleInterceptor.
Some strange things happen now and then wenn in the LifeCycle the invoke() is called
with type "invoke"... debug showed that "invoke, getLanguage" is called on the
MBeanAttributeInterceptor, which then throws an Exception because it does not
understand the command.
I just catched this exception and returned null in LifeCycle.invoke. It should not be
done this way, but now nukes deploys, at least...
Next problem ist a nullpointer:
15:02:19,484 ERROR [Engine] StandardWrapperValve[NukeServlet]: Servlet.service()
for servlet NukeServlet threw exception
java.lang.NullPointerException: charsetName
at java.lang.String.(String.java:410)
at java.lang.String.(String.java:440)
at org.apache.coyote.tomcat5.CoyoteRequest.setCharacterEncoding(CoyoteRe
quest.java:1523)
at org.apache.coyote.tomcat5.CoyoteRequestFacade.setCharacterEncoding(Co
yoteRequestFacade.java:240)
at org.jboss.nukes.servlet.ParameterEncodingFilter.doFilter(ParameterEnc
odingFilter.java:58)
LifeCycleInterceptor:
public class LifeCycleInterceptor
| extends AbstractInterceptor {
|
| // Attributes ----------------------------------------------------
|
| private Logger log;
|
|
| // Constructors --------------------------------------------------
|
| public LifeCycleInterceptor() {
| super();
| this.log = Logger.getLogger(this.getClass());
| log.debug("called no-args-constructor");
| }
|
| public LifeCycleInterceptor(MBeanInfo info, MBeanInvoker invoker) {
| log.debug("called constructor:LifeCycleInterceptor(MBeanInfo info,
MBeanInvoker invoker)");
| this.name=info.getClassName();
| this.log = Logger.getLogger(info.getClassName());
| }
|
| // Public --------------------------------------------------------
|
| public Object invoke(Invocation invocation) throws Exception,Throwable {
| this.name=invocation.getInvoker().getMetaData().getClassName();
| this.log =
Logger.getLogger(invocation.getInvoker().getMetaData().getClassName());
|
log.debug("LifeCycleInterceptor::invoke();invocation.getType()"+invocation.getType());
|
log.debug("LifeCycleInterceptor::invoke();invocation.getName()"+invocation.getName());
| try {
| if (invocation.getType() == Invocation.OP_INVOKE &&
| // changed here
| //if (invocation.getInvocationType() == Invocation.OPERATION &&
| invocation.getSignature() != null &&
| invocation.getSignature().length == 0) {
| if ("create".equals(invocation.getName())) {
| log.info("Creating");
| create(invocation);
| log.info("Created");
| return null;
| } else if ("start".equals(invocation.getName())) {
| log.info("Starting");
| start(invocation);
| log.info("Started");
| return null;
| } else if ("stop".equals(invocation.getName())) {
| log.info("Stopping");
| stop(invocation);
| log.info("Stopped");
| return null;
| } else if ("destroy".equals(invocation.getName())) {
| log.info("Destroying");
| destroy(invocation);
| log.info("Destroyed");
| return null;
| }
| }
| }
| catch (Throwable e) {
| log.error(e.getMessage());
| log.debug("invocationtype:"+invocation.getType());
| throw new Exception(e);
| }
| //getNext().invoke;
| log.debug("calling interceptor.invoke()");
| try {
| return invocation.invoke();
| } catch (Throwable e) {// changed here
| log.debug("catched exception "+e.getMessage());
| return null;
| }
| }
|
| // Private -------------------------------------------------------
|
| private void setState(int nextState, MBeanInvoker invoker) throws Exception {
| // if state changes
| if (getState(invoker) != nextState) {
| try {
| // update the state
| invoker.setAttribute(new Attribute("State", new
Integer(nextState)));
| } catch (MBeanException e) {
| log.error("Cannot send state changed notification", e);
| }
| }
| }
|
| private int getState(MBeanInvoker invoker) throws Exception {
| return ((Integer) invoker.getAttribute("State")).intValue();
| }
|
| private void create(Invocation invocation) throws Exception {
| setState(ServiceMBean.CREATED,invocation.getInvoker());
| }
|
| private void start(Invocation invocation) throws Exception {
| int state = getState(invocation.getInvoker());
| if (state == ServiceMBean.STARTING || state == ServiceMBean.STARTED) {
| return;
| }
| setState(ServiceMBean.STARTING,invocation.getInvoker());
| transition(invocation, ServiceMBean.STARTED, ServiceMBean.FAILED);
| }
|
| private void stop(Invocation invocation) throws Exception {
| if (getState(invocation.getInvoker()) != ServiceMBean.STARTED) {
| return;
| }
| setState(ServiceMBean.STOPPING,invocation.getInvoker());
| transition(invocation, ServiceMBean.STOPPED, ServiceMBean.FAILED);
| }
|
| private void destroy(Invocation invocation) throws Exception, Throwable {
| int state = getState(invocation.getInvoker());
| if (state == ServiceMBean.DESTROYED) {
| return;
| }
| if (state == ServiceMBean.STOPPED) {
| invocation.getInvoker().invoke("stop", new Object[0], new String[0]);
| }
| setState(ServiceMBean.DESTROYED,invocation.getInvoker());
| }
|
| private void transition(Invocation invocation, int success, int failure)
throws Exception {
| try {
| setState(success,invocation.getInvoker());
| } catch (Throwable e) {
| setState(failure,invocation.getInvoker());
| throw new Exception(e);
| }
| }
| }
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3844797#3844797
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3844797
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development