You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openmeetings.apache.org by "seba.wagner@gmail.com" <se...@gmail.com> on 2013/02/15 01:17:16 UTC

server sets "initComplete=true" to early

Hi Maxim,

I've seen you've added some code in the ScopeApplicationAdapter when the
server is inited lately.

In the servlets we check for that variable
(ScopeApplicationAdapter.initComplete), in order to make sure the server is
up before we request the bean.

The issue is that you can still provoke a NullPointerException, cause the
option in the ScopeApplicationAdapter is reached before the
ApplicationContext is available.

In the past it was possible to make the server stuck in the boot, it never
really booted when you hit F5 at the right time a number of times.
I think it is still possible to do that if you penetrate the server hard
enough as the "initComplete" is true too early.

Do you have an idea where else in the code we could set the flag
"ScopeApplicationAdapter.initComplete" ? Somewhere later... but I have no
idea currently where.

You will an exception like this:
[ERROR] [http-bio-0.0.0.0-5080-exec-18]
org.apache.axis2.rpc.receivers.RPCMessageReceiver - Exception occurred
while trying to invoke service method getSession
java.lang.reflect.InvocationTargetException: null
    at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source) ~[na:na]
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
~[na:1.6.0_37]
    at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_37]
    at
org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:256)
~[axis2-jar-1.7.0-SNAPSHOT.jar:na]
    at
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
~[axis2-jar-1.7.0-SNAPSHOT.jar:na]
    at
org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
[axis2-jar-1.7.0-SNAPSHOT.jar:na]
    at
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:106)
[axis2-jar-1.7.0-SNAPSHOT.jar:na]
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:169)
[axis2-jar-1.7.0-SNAPSHOT.jar:na]
    at
org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:242)
[axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
    at
org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:184)
[axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
    at
org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:870)
[axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
    at
org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:290)
[axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
    at
org.red5.logging.LoggerContextFilter.doFilter(LoggerContextFilter.java:77)
[red5.jar:na]
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
    at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
    at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
    at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
    at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
    at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[na:1.6.0_37]
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[na:1.6.0_37]
    at java.lang.Thread.run(Thread.java:680) [na:1.6.0_37]
Caused by: java.lang.NullPointerException: null
    at
org.apache.openmeetings.axis.services.UserWebServiceFacade.getSession(UserWebServiceFacade.java:67)
~[openmeetings-WebService-2.1.0-SNAPSHOT.jar:na]
    ... 32 common frames omitted

-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com

Re: server sets "initComplete=true" to early

Posted by Maxim Solodovnik <so...@gmail.com>.
will commit and recheck on other server


On Fri, Feb 15, 2013 at 9:20 AM, Maxim Solodovnik <so...@gmail.com>wrote:

> >> Its indeed a little bit tricky cause the Axis2 deployed services do
> not allow a method like:
> public <T> T
>
> what is the error?
> I just refactor this method to be
>
> // package access
>  <T> T getBean(Class<? extends T> clazz) throws AxisFault {
> return beanUtil.getBean(clazz, getServletContext());
>  }
>
> and have no issues :(
> can I commit that? or it will broke something?
>
>
>
> On Fri, Feb 15, 2013 at 8:51 AM, seba.wagner@gmail.com <
> seba.wagner@gmail.com> wrote:
>
>> I have committed another version.
>> Please review.
>> Its indeed a little bit tricky cause the Axis2 deployed services do not
>> allow a method like:
>> public <T> T
>>
>> cause it will try to build a webservice for all public methods in that
>> class, and it cannot make a return type for <T> / Templates.
>>
>> So I have added this BeanUtil as class reference.
>> The other servlets have a Base servlet now, to inject their specific
>> ServletContext.
>>
>> It is arguable if there is really a need for a Base-class for those cases.
>> However this is now just the way I did it, feel free to re-structure.
>>
>> However at least the check:
>> if (ScopeApplicationAdapter.initComplete)
>> is only done in one place in the code.
>>
>> Sebasitan
>>
>>
>> 2013/2/15 Maxim Solodovnik <so...@gmail.com>
>>
>>> Sure, this is why I have asked who is going to do the refactoring :)
>>>
>>>
>>> On Fri, Feb 15, 2013 at 8:34 AM, seba.wagner@gmail.com <
>>> seba.wagner@gmail.com> wrote:
>>>
>>>> Sorry but I will overwrite that.
>>>> You've just fixed one Bean getter method. There are around 25 accross
>>>> our code base in several Axis-WebServices, HttpServlets and
>>>> VelocityViewServlets
>>>>
>>>> Please give me some minutes, I will ping you again.
>>>>
>>>> Sebastian
>>>>
>>>>
>>>>
>>>> 2013/2/15 Maxim Solodovnik <so...@gmail.com>
>>>>
>>>>> Fixed, please see
>>>>>
>>>>> Committed revision 1446418.
>>>>>
>>>>>
>>>>> On Fri, Feb 15, 2013 at 8:09 AM, Maxim Solodovnik <
>>>>> solomax666@gmail.com> wrote:
>>>>>
>>>>>> The issue is very tricky
>>>>>> Currently the code works as expected:
>>>>>>
>>>>>> if (!ScopeApplicationAdapter.initComplete) {
>>>>>>  throw new Exception("Server not yet initialized, retry in couple of
>>>>>> seconds");
>>>>>> }
>>>>>>
>>>>>> but then ....
>>>>>> it is surprisingly being try/catched and "null" is returned ...
>>>>>>
>>>>>> I'm currently fixing the code
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Fri, Feb 15, 2013 at 8:01 AM, seba.wagner@gmail.com <
>>>>>> seba.wagner@gmail.com> wrote:
>>>>>>
>>>>>>> I already started, I just need to refactor it to use a Util class
>>>>>>> now.
>>>>>>>
>>>>>>> Sebastian
>>>>>>>
>>>>>>>
>>>>>>> 2013/2/15 Maxim Solodovnik <so...@gmail.com>
>>>>>>>
>>>>>>>> OK
>>>>>>>> Are you going to refactor getting beans? Or should I handle it?
>>>>>>>>
>>>>>>>>
>>>>>>>> On Fri, Feb 15, 2013 at 7:57 AM, seba.wagner@gmail.com <
>>>>>>>> seba.wagner@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> yes,
>>>>>>>>>
>>>>>>>>> just hit F5 constantly, for example load this URL
>>>>>>>>> http://localhost:5080/openmeetings/services/UserService/getSession
>>>>>>>>>
>>>>>>>>> And don't wait for the timeout in the browser, just hit f5
>>>>>>>>> constantly while the server boots... and you will see that exception.
>>>>>>>>>
>>>>>>>>> Sebastian
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> 2013/2/15 Maxim Solodovnik <so...@gmail.com>
>>>>>>>>>
>>>>>>>>>> Do you have any steps for this (maybe unstable)?
>>>>>>>>>>
>>>>>>>>>> My stacktrace is starting with
>>>>>>>>>> java.lang.Exception: Server not yet initialized, retry in couple
>>>>>>>>>> of seconds
>>>>>>>>>>
>>>>>>>>>> Which is expected ...
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Fri, Feb 15, 2013 at 7:17 AM, seba.wagner@gmail.com <
>>>>>>>>>> seba.wagner@gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi Maxim,
>>>>>>>>>>>
>>>>>>>>>>> I've seen you've added some code in the ScopeApplicationAdapter
>>>>>>>>>>> when the server is inited lately.
>>>>>>>>>>>
>>>>>>>>>>> In the servlets we check for that variable
>>>>>>>>>>> (ScopeApplicationAdapter.initComplete), in order to make sure the server is
>>>>>>>>>>> up before we request the bean.
>>>>>>>>>>>
>>>>>>>>>>> The issue is that you can still provoke a NullPointerException,
>>>>>>>>>>> cause the option in the ScopeApplicationAdapter is reached before the
>>>>>>>>>>> ApplicationContext is available.
>>>>>>>>>>>
>>>>>>>>>>> In the past it was possible to make the server stuck in the
>>>>>>>>>>> boot, it never really booted when you hit F5 at the right time a number of
>>>>>>>>>>> times.
>>>>>>>>>>> I think it is still possible to do that if you penetrate the
>>>>>>>>>>> server hard enough as the "initComplete" is true too early.
>>>>>>>>>>>
>>>>>>>>>>> Do you have an idea where else in the code we could set the flag
>>>>>>>>>>> "ScopeApplicationAdapter.initComplete" ? Somewhere later... but I have no
>>>>>>>>>>> idea currently where.
>>>>>>>>>>>
>>>>>>>>>>> You will an exception like this:
>>>>>>>>>>> [ERROR] [http-bio-0.0.0.0-5080-exec-18]
>>>>>>>>>>> org.apache.axis2.rpc.receivers.RPCMessageReceiver - Exception occurred
>>>>>>>>>>> while trying to invoke service method getSession
>>>>>>>>>>> java.lang.reflect.InvocationTargetException: null
>>>>>>>>>>>     at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown
>>>>>>>>>>> Source) ~[na:na]
>>>>>>>>>>>     at
>>>>>>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>>>>>>>> ~[na:1.6.0_37]
>>>>>>>>>>>     at java.lang.reflect.Method.invoke(Method.java:597)
>>>>>>>>>>> ~[na:1.6.0_37]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:256)
>>>>>>>>>>> ~[axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
>>>>>>>>>>> ~[axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
>>>>>>>>>>> [axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:106)
>>>>>>>>>>> [axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:169)
>>>>>>>>>>> [axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:242)
>>>>>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:184)
>>>>>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:870)
>>>>>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:290)
>>>>>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>>>     at
>>>>>>>>>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
>>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>>     at
>>>>>>>>>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
>>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
>>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>>     at
>>>>>>>>>>> org.red5.logging.LoggerContextFilter.doFilter(LoggerContextFilter.java:77)
>>>>>>>>>>> [red5.jar:na]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
>>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
>>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
>>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
>>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
>>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
>>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
>>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
>>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
>>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>>     at
>>>>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>>>>>>>>>> [na:1.6.0_37]
>>>>>>>>>>>     at
>>>>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>>>>>>>>>> [na:1.6.0_37]
>>>>>>>>>>>     at java.lang.Thread.run(Thread.java:680) [na:1.6.0_37]
>>>>>>>>>>> Caused by: java.lang.NullPointerException: null
>>>>>>>>>>>     at
>>>>>>>>>>> org.apache.openmeetings.axis.services.UserWebServiceFacade.getSession(UserWebServiceFacade.java:67)
>>>>>>>>>>> ~[openmeetings-WebService-2.1.0-SNAPSHOT.jar:na]
>>>>>>>>>>>     ... 32 common frames omitted
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> Sebastian Wagner
>>>>>>>>>>> https://twitter.com/#!/dead_lock
>>>>>>>>>>> http://www.webbase-design.de
>>>>>>>>>>> http://www.wagner-sebastian.com
>>>>>>>>>>> seba.wagner@gmail.com
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> WBR
>>>>>>>>>> Maxim aka solomax
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Sebastian Wagner
>>>>>>>>> https://twitter.com/#!/dead_lock
>>>>>>>>> http://www.webbase-design.de
>>>>>>>>> http://www.wagner-sebastian.com
>>>>>>>>> seba.wagner@gmail.com
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> WBR
>>>>>>>> Maxim aka solomax
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Sebastian Wagner
>>>>>>> https://twitter.com/#!/dead_lock
>>>>>>> http://www.webbase-design.de
>>>>>>> http://www.wagner-sebastian.com
>>>>>>> seba.wagner@gmail.com
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> WBR
>>>>>> Maxim aka solomax
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> WBR
>>>>> Maxim aka solomax
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Sebastian Wagner
>>>> https://twitter.com/#!/dead_lock
>>>> http://www.webbase-design.de
>>>> http://www.wagner-sebastian.com
>>>> seba.wagner@gmail.com
>>>>
>>>
>>>
>>>
>>> --
>>> WBR
>>> Maxim aka solomax
>>>
>>
>>
>>
>> --
>> Sebastian Wagner
>> https://twitter.com/#!/dead_lock
>> http://www.webbase-design.de
>> http://www.wagner-sebastian.com
>> seba.wagner@gmail.com
>>
>
>
>
> --
> WBR
> Maxim aka solomax
>



-- 
WBR
Maxim aka solomax

Re: server sets "initComplete=true" to early

Posted by Maxim Solodovnik <so...@gmail.com>.
>> Its indeed a little bit tricky cause the Axis2 deployed services do not
allow a method like:
public <T> T

what is the error?
I just refactor this method to be

// package access
<T> T getBean(Class<? extends T> clazz) throws AxisFault {
return beanUtil.getBean(clazz, getServletContext());
}

and have no issues :(
can I commit that? or it will broke something?



On Fri, Feb 15, 2013 at 8:51 AM, seba.wagner@gmail.com <
seba.wagner@gmail.com> wrote:

> I have committed another version.
> Please review.
> Its indeed a little bit tricky cause the Axis2 deployed services do not
> allow a method like:
> public <T> T
>
> cause it will try to build a webservice for all public methods in that
> class, and it cannot make a return type for <T> / Templates.
>
> So I have added this BeanUtil as class reference.
> The other servlets have a Base servlet now, to inject their specific
> ServletContext.
>
> It is arguable if there is really a need for a Base-class for those cases.
> However this is now just the way I did it, feel free to re-structure.
>
> However at least the check:
> if (ScopeApplicationAdapter.initComplete)
> is only done in one place in the code.
>
> Sebasitan
>
>
> 2013/2/15 Maxim Solodovnik <so...@gmail.com>
>
>> Sure, this is why I have asked who is going to do the refactoring :)
>>
>>
>> On Fri, Feb 15, 2013 at 8:34 AM, seba.wagner@gmail.com <
>> seba.wagner@gmail.com> wrote:
>>
>>> Sorry but I will overwrite that.
>>> You've just fixed one Bean getter method. There are around 25 accross
>>> our code base in several Axis-WebServices, HttpServlets and
>>> VelocityViewServlets
>>>
>>> Please give me some minutes, I will ping you again.
>>>
>>> Sebastian
>>>
>>>
>>>
>>> 2013/2/15 Maxim Solodovnik <so...@gmail.com>
>>>
>>>> Fixed, please see
>>>>
>>>> Committed revision 1446418.
>>>>
>>>>
>>>> On Fri, Feb 15, 2013 at 8:09 AM, Maxim Solodovnik <solomax666@gmail.com
>>>> > wrote:
>>>>
>>>>> The issue is very tricky
>>>>> Currently the code works as expected:
>>>>>
>>>>> if (!ScopeApplicationAdapter.initComplete) {
>>>>>  throw new Exception("Server not yet initialized, retry in couple of
>>>>> seconds");
>>>>> }
>>>>>
>>>>> but then ....
>>>>> it is surprisingly being try/catched and "null" is returned ...
>>>>>
>>>>> I'm currently fixing the code
>>>>>
>>>>>
>>>>>
>>>>> On Fri, Feb 15, 2013 at 8:01 AM, seba.wagner@gmail.com <
>>>>> seba.wagner@gmail.com> wrote:
>>>>>
>>>>>> I already started, I just need to refactor it to use a Util class now.
>>>>>>
>>>>>> Sebastian
>>>>>>
>>>>>>
>>>>>> 2013/2/15 Maxim Solodovnik <so...@gmail.com>
>>>>>>
>>>>>>> OK
>>>>>>> Are you going to refactor getting beans? Or should I handle it?
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Feb 15, 2013 at 7:57 AM, seba.wagner@gmail.com <
>>>>>>> seba.wagner@gmail.com> wrote:
>>>>>>>
>>>>>>>> yes,
>>>>>>>>
>>>>>>>> just hit F5 constantly, for example load this URL
>>>>>>>> http://localhost:5080/openmeetings/services/UserService/getSession
>>>>>>>>
>>>>>>>> And don't wait for the timeout in the browser, just hit f5
>>>>>>>> constantly while the server boots... and you will see that exception.
>>>>>>>>
>>>>>>>> Sebastian
>>>>>>>>
>>>>>>>>
>>>>>>>> 2013/2/15 Maxim Solodovnik <so...@gmail.com>
>>>>>>>>
>>>>>>>>> Do you have any steps for this (maybe unstable)?
>>>>>>>>>
>>>>>>>>> My stacktrace is starting with
>>>>>>>>> java.lang.Exception: Server not yet initialized, retry in couple
>>>>>>>>> of seconds
>>>>>>>>>
>>>>>>>>> Which is expected ...
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Fri, Feb 15, 2013 at 7:17 AM, seba.wagner@gmail.com <
>>>>>>>>> seba.wagner@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> Hi Maxim,
>>>>>>>>>>
>>>>>>>>>> I've seen you've added some code in the ScopeApplicationAdapter
>>>>>>>>>> when the server is inited lately.
>>>>>>>>>>
>>>>>>>>>> In the servlets we check for that variable
>>>>>>>>>> (ScopeApplicationAdapter.initComplete), in order to make sure the server is
>>>>>>>>>> up before we request the bean.
>>>>>>>>>>
>>>>>>>>>> The issue is that you can still provoke a NullPointerException,
>>>>>>>>>> cause the option in the ScopeApplicationAdapter is reached before the
>>>>>>>>>> ApplicationContext is available.
>>>>>>>>>>
>>>>>>>>>> In the past it was possible to make the server stuck in the boot,
>>>>>>>>>> it never really booted when you hit F5 at the right time a number of times.
>>>>>>>>>> I think it is still possible to do that if you penetrate the
>>>>>>>>>> server hard enough as the "initComplete" is true too early.
>>>>>>>>>>
>>>>>>>>>> Do you have an idea where else in the code we could set the flag
>>>>>>>>>> "ScopeApplicationAdapter.initComplete" ? Somewhere later... but I have no
>>>>>>>>>> idea currently where.
>>>>>>>>>>
>>>>>>>>>> You will an exception like this:
>>>>>>>>>> [ERROR] [http-bio-0.0.0.0-5080-exec-18]
>>>>>>>>>> org.apache.axis2.rpc.receivers.RPCMessageReceiver - Exception occurred
>>>>>>>>>> while trying to invoke service method getSession
>>>>>>>>>> java.lang.reflect.InvocationTargetException: null
>>>>>>>>>>     at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown
>>>>>>>>>> Source) ~[na:na]
>>>>>>>>>>     at
>>>>>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>>>>>>> ~[na:1.6.0_37]
>>>>>>>>>>     at java.lang.reflect.Method.invoke(Method.java:597)
>>>>>>>>>> ~[na:1.6.0_37]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:256)
>>>>>>>>>> ~[axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
>>>>>>>>>> ~[axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
>>>>>>>>>> [axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:106)
>>>>>>>>>> [axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:169)
>>>>>>>>>> [axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:242)
>>>>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:184)
>>>>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:870)
>>>>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:290)
>>>>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>>     at
>>>>>>>>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>     at
>>>>>>>>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>     at
>>>>>>>>>> org.red5.logging.LoggerContextFilter.doFilter(LoggerContextFilter.java:77)
>>>>>>>>>> [red5.jar:na]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>     at
>>>>>>>>>> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
>>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>>     at
>>>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>>>>>>>>> [na:1.6.0_37]
>>>>>>>>>>     at
>>>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>>>>>>>>> [na:1.6.0_37]
>>>>>>>>>>     at java.lang.Thread.run(Thread.java:680) [na:1.6.0_37]
>>>>>>>>>> Caused by: java.lang.NullPointerException: null
>>>>>>>>>>     at
>>>>>>>>>> org.apache.openmeetings.axis.services.UserWebServiceFacade.getSession(UserWebServiceFacade.java:67)
>>>>>>>>>> ~[openmeetings-WebService-2.1.0-SNAPSHOT.jar:na]
>>>>>>>>>>     ... 32 common frames omitted
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Sebastian Wagner
>>>>>>>>>> https://twitter.com/#!/dead_lock
>>>>>>>>>> http://www.webbase-design.de
>>>>>>>>>> http://www.wagner-sebastian.com
>>>>>>>>>> seba.wagner@gmail.com
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> WBR
>>>>>>>>> Maxim aka solomax
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Sebastian Wagner
>>>>>>>> https://twitter.com/#!/dead_lock
>>>>>>>> http://www.webbase-design.de
>>>>>>>> http://www.wagner-sebastian.com
>>>>>>>> seba.wagner@gmail.com
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> WBR
>>>>>>> Maxim aka solomax
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Sebastian Wagner
>>>>>> https://twitter.com/#!/dead_lock
>>>>>> http://www.webbase-design.de
>>>>>> http://www.wagner-sebastian.com
>>>>>> seba.wagner@gmail.com
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> WBR
>>>>> Maxim aka solomax
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> WBR
>>>> Maxim aka solomax
>>>>
>>>
>>>
>>>
>>> --
>>> Sebastian Wagner
>>> https://twitter.com/#!/dead_lock
>>> http://www.webbase-design.de
>>> http://www.wagner-sebastian.com
>>> seba.wagner@gmail.com
>>>
>>
>>
>>
>> --
>> WBR
>> Maxim aka solomax
>>
>
>
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>



-- 
WBR
Maxim aka solomax

Re: server sets "initComplete=true" to early

Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
I have committed another version.
Please review.
Its indeed a little bit tricky cause the Axis2 deployed services do not
allow a method like:
public <T> T

cause it will try to build a webservice for all public methods in that
class, and it cannot make a return type for <T> / Templates.

So I have added this BeanUtil as class reference.
The other servlets have a Base servlet now, to inject their specific
ServletContext.

It is arguable if there is really a need for a Base-class for those cases.
However this is now just the way I did it, feel free to re-structure.

However at least the check:
if (ScopeApplicationAdapter.initComplete)
is only done in one place in the code.

Sebasitan


2013/2/15 Maxim Solodovnik <so...@gmail.com>

> Sure, this is why I have asked who is going to do the refactoring :)
>
>
> On Fri, Feb 15, 2013 at 8:34 AM, seba.wagner@gmail.com <
> seba.wagner@gmail.com> wrote:
>
>> Sorry but I will overwrite that.
>> You've just fixed one Bean getter method. There are around 25 accross our
>> code base in several Axis-WebServices, HttpServlets and VelocityViewServlets
>>
>> Please give me some minutes, I will ping you again.
>>
>> Sebastian
>>
>>
>>
>> 2013/2/15 Maxim Solodovnik <so...@gmail.com>
>>
>>> Fixed, please see
>>>
>>> Committed revision 1446418.
>>>
>>>
>>> On Fri, Feb 15, 2013 at 8:09 AM, Maxim Solodovnik <so...@gmail.com>wrote:
>>>
>>>> The issue is very tricky
>>>> Currently the code works as expected:
>>>>
>>>> if (!ScopeApplicationAdapter.initComplete) {
>>>>  throw new Exception("Server not yet initialized, retry in couple of
>>>> seconds");
>>>> }
>>>>
>>>> but then ....
>>>> it is surprisingly being try/catched and "null" is returned ...
>>>>
>>>> I'm currently fixing the code
>>>>
>>>>
>>>>
>>>> On Fri, Feb 15, 2013 at 8:01 AM, seba.wagner@gmail.com <
>>>> seba.wagner@gmail.com> wrote:
>>>>
>>>>> I already started, I just need to refactor it to use a Util class now.
>>>>>
>>>>> Sebastian
>>>>>
>>>>>
>>>>> 2013/2/15 Maxim Solodovnik <so...@gmail.com>
>>>>>
>>>>>> OK
>>>>>> Are you going to refactor getting beans? Or should I handle it?
>>>>>>
>>>>>>
>>>>>> On Fri, Feb 15, 2013 at 7:57 AM, seba.wagner@gmail.com <
>>>>>> seba.wagner@gmail.com> wrote:
>>>>>>
>>>>>>> yes,
>>>>>>>
>>>>>>> just hit F5 constantly, for example load this URL
>>>>>>> http://localhost:5080/openmeetings/services/UserService/getSession
>>>>>>>
>>>>>>> And don't wait for the timeout in the browser, just hit f5
>>>>>>> constantly while the server boots... and you will see that exception.
>>>>>>>
>>>>>>> Sebastian
>>>>>>>
>>>>>>>
>>>>>>> 2013/2/15 Maxim Solodovnik <so...@gmail.com>
>>>>>>>
>>>>>>>> Do you have any steps for this (maybe unstable)?
>>>>>>>>
>>>>>>>> My stacktrace is starting with
>>>>>>>> java.lang.Exception: Server not yet initialized, retry in couple of
>>>>>>>> seconds
>>>>>>>>
>>>>>>>> Which is expected ...
>>>>>>>>
>>>>>>>>
>>>>>>>> On Fri, Feb 15, 2013 at 7:17 AM, seba.wagner@gmail.com <
>>>>>>>> seba.wagner@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Hi Maxim,
>>>>>>>>>
>>>>>>>>> I've seen you've added some code in the ScopeApplicationAdapter
>>>>>>>>> when the server is inited lately.
>>>>>>>>>
>>>>>>>>> In the servlets we check for that variable
>>>>>>>>> (ScopeApplicationAdapter.initComplete), in order to make sure the server is
>>>>>>>>> up before we request the bean.
>>>>>>>>>
>>>>>>>>> The issue is that you can still provoke a NullPointerException,
>>>>>>>>> cause the option in the ScopeApplicationAdapter is reached before the
>>>>>>>>> ApplicationContext is available.
>>>>>>>>>
>>>>>>>>> In the past it was possible to make the server stuck in the boot,
>>>>>>>>> it never really booted when you hit F5 at the right time a number of times.
>>>>>>>>> I think it is still possible to do that if you penetrate the
>>>>>>>>> server hard enough as the "initComplete" is true too early.
>>>>>>>>>
>>>>>>>>> Do you have an idea where else in the code we could set the flag
>>>>>>>>> "ScopeApplicationAdapter.initComplete" ? Somewhere later... but I have no
>>>>>>>>> idea currently where.
>>>>>>>>>
>>>>>>>>> You will an exception like this:
>>>>>>>>> [ERROR] [http-bio-0.0.0.0-5080-exec-18]
>>>>>>>>> org.apache.axis2.rpc.receivers.RPCMessageReceiver - Exception occurred
>>>>>>>>> while trying to invoke service method getSession
>>>>>>>>> java.lang.reflect.InvocationTargetException: null
>>>>>>>>>     at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown
>>>>>>>>> Source) ~[na:na]
>>>>>>>>>     at
>>>>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>>>>>> ~[na:1.6.0_37]
>>>>>>>>>     at java.lang.reflect.Method.invoke(Method.java:597)
>>>>>>>>> ~[na:1.6.0_37]
>>>>>>>>>     at
>>>>>>>>> org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:256)
>>>>>>>>> ~[axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>     at
>>>>>>>>> org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
>>>>>>>>> ~[axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>     at
>>>>>>>>> org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
>>>>>>>>> [axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>     at
>>>>>>>>> org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:106)
>>>>>>>>> [axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>     at
>>>>>>>>> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:169)
>>>>>>>>> [axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>     at
>>>>>>>>> org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:242)
>>>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>     at
>>>>>>>>> org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:184)
>>>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>     at
>>>>>>>>> org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:870)
>>>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>     at
>>>>>>>>> org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:290)
>>>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>>     at
>>>>>>>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>     at
>>>>>>>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>     at
>>>>>>>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>     at
>>>>>>>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>     at
>>>>>>>>> org.red5.logging.LoggerContextFilter.doFilter(LoggerContextFilter.java:77)
>>>>>>>>> [red5.jar:na]
>>>>>>>>>     at
>>>>>>>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>     at
>>>>>>>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>     at
>>>>>>>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>     at
>>>>>>>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>     at
>>>>>>>>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>     at
>>>>>>>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>     at
>>>>>>>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>     at
>>>>>>>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>     at
>>>>>>>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>     at
>>>>>>>>> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>     at
>>>>>>>>> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>     at
>>>>>>>>> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
>>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>>     at
>>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>>>>>>>> [na:1.6.0_37]
>>>>>>>>>     at
>>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>>>>>>>> [na:1.6.0_37]
>>>>>>>>>     at java.lang.Thread.run(Thread.java:680) [na:1.6.0_37]
>>>>>>>>> Caused by: java.lang.NullPointerException: null
>>>>>>>>>     at
>>>>>>>>> org.apache.openmeetings.axis.services.UserWebServiceFacade.getSession(UserWebServiceFacade.java:67)
>>>>>>>>> ~[openmeetings-WebService-2.1.0-SNAPSHOT.jar:na]
>>>>>>>>>     ... 32 common frames omitted
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Sebastian Wagner
>>>>>>>>> https://twitter.com/#!/dead_lock
>>>>>>>>> http://www.webbase-design.de
>>>>>>>>> http://www.wagner-sebastian.com
>>>>>>>>> seba.wagner@gmail.com
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> WBR
>>>>>>>> Maxim aka solomax
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Sebastian Wagner
>>>>>>> https://twitter.com/#!/dead_lock
>>>>>>> http://www.webbase-design.de
>>>>>>> http://www.wagner-sebastian.com
>>>>>>> seba.wagner@gmail.com
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> WBR
>>>>>> Maxim aka solomax
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Sebastian Wagner
>>>>> https://twitter.com/#!/dead_lock
>>>>> http://www.webbase-design.de
>>>>> http://www.wagner-sebastian.com
>>>>> seba.wagner@gmail.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> WBR
>>>> Maxim aka solomax
>>>>
>>>
>>>
>>>
>>> --
>>> WBR
>>> Maxim aka solomax
>>>
>>
>>
>>
>> --
>> Sebastian Wagner
>> https://twitter.com/#!/dead_lock
>> http://www.webbase-design.de
>> http://www.wagner-sebastian.com
>> seba.wagner@gmail.com
>>
>
>
>
> --
> WBR
> Maxim aka solomax
>



-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com

Re: server sets "initComplete=true" to early

Posted by Maxim Solodovnik <so...@gmail.com>.
Sure, this is why I have asked who is going to do the refactoring :)


On Fri, Feb 15, 2013 at 8:34 AM, seba.wagner@gmail.com <
seba.wagner@gmail.com> wrote:

> Sorry but I will overwrite that.
> You've just fixed one Bean getter method. There are around 25 accross our
> code base in several Axis-WebServices, HttpServlets and VelocityViewServlets
>
> Please give me some minutes, I will ping you again.
>
> Sebastian
>
>
>
> 2013/2/15 Maxim Solodovnik <so...@gmail.com>
>
>> Fixed, please see
>>
>> Committed revision 1446418.
>>
>>
>> On Fri, Feb 15, 2013 at 8:09 AM, Maxim Solodovnik <so...@gmail.com>wrote:
>>
>>> The issue is very tricky
>>> Currently the code works as expected:
>>>
>>> if (!ScopeApplicationAdapter.initComplete) {
>>>  throw new Exception("Server not yet initialized, retry in couple of
>>> seconds");
>>> }
>>>
>>> but then ....
>>> it is surprisingly being try/catched and "null" is returned ...
>>>
>>> I'm currently fixing the code
>>>
>>>
>>>
>>> On Fri, Feb 15, 2013 at 8:01 AM, seba.wagner@gmail.com <
>>> seba.wagner@gmail.com> wrote:
>>>
>>>> I already started, I just need to refactor it to use a Util class now.
>>>>
>>>> Sebastian
>>>>
>>>>
>>>> 2013/2/15 Maxim Solodovnik <so...@gmail.com>
>>>>
>>>>> OK
>>>>> Are you going to refactor getting beans? Or should I handle it?
>>>>>
>>>>>
>>>>> On Fri, Feb 15, 2013 at 7:57 AM, seba.wagner@gmail.com <
>>>>> seba.wagner@gmail.com> wrote:
>>>>>
>>>>>> yes,
>>>>>>
>>>>>> just hit F5 constantly, for example load this URL
>>>>>> http://localhost:5080/openmeetings/services/UserService/getSession
>>>>>>
>>>>>> And don't wait for the timeout in the browser, just hit f5 constantly
>>>>>> while the server boots... and you will see that exception.
>>>>>>
>>>>>> Sebastian
>>>>>>
>>>>>>
>>>>>> 2013/2/15 Maxim Solodovnik <so...@gmail.com>
>>>>>>
>>>>>>> Do you have any steps for this (maybe unstable)?
>>>>>>>
>>>>>>> My stacktrace is starting with
>>>>>>> java.lang.Exception: Server not yet initialized, retry in couple of
>>>>>>> seconds
>>>>>>>
>>>>>>> Which is expected ...
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Feb 15, 2013 at 7:17 AM, seba.wagner@gmail.com <
>>>>>>> seba.wagner@gmail.com> wrote:
>>>>>>>
>>>>>>>> Hi Maxim,
>>>>>>>>
>>>>>>>> I've seen you've added some code in the ScopeApplicationAdapter
>>>>>>>> when the server is inited lately.
>>>>>>>>
>>>>>>>> In the servlets we check for that variable
>>>>>>>> (ScopeApplicationAdapter.initComplete), in order to make sure the server is
>>>>>>>> up before we request the bean.
>>>>>>>>
>>>>>>>> The issue is that you can still provoke a NullPointerException,
>>>>>>>> cause the option in the ScopeApplicationAdapter is reached before the
>>>>>>>> ApplicationContext is available.
>>>>>>>>
>>>>>>>> In the past it was possible to make the server stuck in the boot,
>>>>>>>> it never really booted when you hit F5 at the right time a number of times.
>>>>>>>> I think it is still possible to do that if you penetrate the server
>>>>>>>> hard enough as the "initComplete" is true too early.
>>>>>>>>
>>>>>>>> Do you have an idea where else in the code we could set the flag
>>>>>>>> "ScopeApplicationAdapter.initComplete" ? Somewhere later... but I have no
>>>>>>>> idea currently where.
>>>>>>>>
>>>>>>>> You will an exception like this:
>>>>>>>> [ERROR] [http-bio-0.0.0.0-5080-exec-18]
>>>>>>>> org.apache.axis2.rpc.receivers.RPCMessageReceiver - Exception occurred
>>>>>>>> while trying to invoke service method getSession
>>>>>>>> java.lang.reflect.InvocationTargetException: null
>>>>>>>>     at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
>>>>>>>> ~[na:na]
>>>>>>>>     at
>>>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>>>>> ~[na:1.6.0_37]
>>>>>>>>     at java.lang.reflect.Method.invoke(Method.java:597)
>>>>>>>> ~[na:1.6.0_37]
>>>>>>>>     at
>>>>>>>> org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:256)
>>>>>>>> ~[axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>     at
>>>>>>>> org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
>>>>>>>> ~[axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>     at
>>>>>>>> org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
>>>>>>>> [axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>     at
>>>>>>>> org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:106)
>>>>>>>> [axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>     at
>>>>>>>> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:169)
>>>>>>>> [axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>     at
>>>>>>>> org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:242)
>>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>     at
>>>>>>>> org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:184)
>>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>     at
>>>>>>>> org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:870)
>>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>     at
>>>>>>>> org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:290)
>>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>     at
>>>>>>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>     at
>>>>>>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>     at
>>>>>>>> org.red5.logging.LoggerContextFilter.doFilter(LoggerContextFilter.java:77)
>>>>>>>> [red5.jar:na]
>>>>>>>>     at
>>>>>>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>     at
>>>>>>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>     at
>>>>>>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>     at
>>>>>>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>     at
>>>>>>>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>     at
>>>>>>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>     at
>>>>>>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>     at
>>>>>>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>     at
>>>>>>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>     at
>>>>>>>> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>     at
>>>>>>>> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>     at
>>>>>>>> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
>>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>>     at
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>>>>>>> [na:1.6.0_37]
>>>>>>>>     at
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>>>>>>> [na:1.6.0_37]
>>>>>>>>     at java.lang.Thread.run(Thread.java:680) [na:1.6.0_37]
>>>>>>>> Caused by: java.lang.NullPointerException: null
>>>>>>>>     at
>>>>>>>> org.apache.openmeetings.axis.services.UserWebServiceFacade.getSession(UserWebServiceFacade.java:67)
>>>>>>>> ~[openmeetings-WebService-2.1.0-SNAPSHOT.jar:na]
>>>>>>>>     ... 32 common frames omitted
>>>>>>>>
>>>>>>>> --
>>>>>>>> Sebastian Wagner
>>>>>>>> https://twitter.com/#!/dead_lock
>>>>>>>> http://www.webbase-design.de
>>>>>>>> http://www.wagner-sebastian.com
>>>>>>>> seba.wagner@gmail.com
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> WBR
>>>>>>> Maxim aka solomax
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Sebastian Wagner
>>>>>> https://twitter.com/#!/dead_lock
>>>>>> http://www.webbase-design.de
>>>>>> http://www.wagner-sebastian.com
>>>>>> seba.wagner@gmail.com
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> WBR
>>>>> Maxim aka solomax
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Sebastian Wagner
>>>> https://twitter.com/#!/dead_lock
>>>> http://www.webbase-design.de
>>>> http://www.wagner-sebastian.com
>>>> seba.wagner@gmail.com
>>>>
>>>
>>>
>>>
>>> --
>>> WBR
>>> Maxim aka solomax
>>>
>>
>>
>>
>> --
>> WBR
>> Maxim aka solomax
>>
>
>
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>



-- 
WBR
Maxim aka solomax

Re: server sets "initComplete=true" to early

Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
Sorry but I will overwrite that.
You've just fixed one Bean getter method. There are around 25 accross our
code base in several Axis-WebServices, HttpServlets and VelocityViewServlets

Please give me some minutes, I will ping you again.

Sebastian



2013/2/15 Maxim Solodovnik <so...@gmail.com>

> Fixed, please see
>
> Committed revision 1446418.
>
>
> On Fri, Feb 15, 2013 at 8:09 AM, Maxim Solodovnik <so...@gmail.com>wrote:
>
>> The issue is very tricky
>> Currently the code works as expected:
>>
>> if (!ScopeApplicationAdapter.initComplete) {
>>  throw new Exception("Server not yet initialized, retry in couple of
>> seconds");
>> }
>>
>> but then ....
>> it is surprisingly being try/catched and "null" is returned ...
>>
>> I'm currently fixing the code
>>
>>
>>
>> On Fri, Feb 15, 2013 at 8:01 AM, seba.wagner@gmail.com <
>> seba.wagner@gmail.com> wrote:
>>
>>> I already started, I just need to refactor it to use a Util class now.
>>>
>>> Sebastian
>>>
>>>
>>> 2013/2/15 Maxim Solodovnik <so...@gmail.com>
>>>
>>>> OK
>>>> Are you going to refactor getting beans? Or should I handle it?
>>>>
>>>>
>>>> On Fri, Feb 15, 2013 at 7:57 AM, seba.wagner@gmail.com <
>>>> seba.wagner@gmail.com> wrote:
>>>>
>>>>> yes,
>>>>>
>>>>> just hit F5 constantly, for example load this URL
>>>>> http://localhost:5080/openmeetings/services/UserService/getSession
>>>>>
>>>>> And don't wait for the timeout in the browser, just hit f5 constantly
>>>>> while the server boots... and you will see that exception.
>>>>>
>>>>> Sebastian
>>>>>
>>>>>
>>>>> 2013/2/15 Maxim Solodovnik <so...@gmail.com>
>>>>>
>>>>>> Do you have any steps for this (maybe unstable)?
>>>>>>
>>>>>> My stacktrace is starting with
>>>>>> java.lang.Exception: Server not yet initialized, retry in couple of
>>>>>> seconds
>>>>>>
>>>>>> Which is expected ...
>>>>>>
>>>>>>
>>>>>> On Fri, Feb 15, 2013 at 7:17 AM, seba.wagner@gmail.com <
>>>>>> seba.wagner@gmail.com> wrote:
>>>>>>
>>>>>>> Hi Maxim,
>>>>>>>
>>>>>>> I've seen you've added some code in the ScopeApplicationAdapter when
>>>>>>> the server is inited lately.
>>>>>>>
>>>>>>> In the servlets we check for that variable
>>>>>>> (ScopeApplicationAdapter.initComplete), in order to make sure the server is
>>>>>>> up before we request the bean.
>>>>>>>
>>>>>>> The issue is that you can still provoke a NullPointerException,
>>>>>>> cause the option in the ScopeApplicationAdapter is reached before the
>>>>>>> ApplicationContext is available.
>>>>>>>
>>>>>>> In the past it was possible to make the server stuck in the boot, it
>>>>>>> never really booted when you hit F5 at the right time a number of times.
>>>>>>> I think it is still possible to do that if you penetrate the server
>>>>>>> hard enough as the "initComplete" is true too early.
>>>>>>>
>>>>>>> Do you have an idea where else in the code we could set the flag
>>>>>>> "ScopeApplicationAdapter.initComplete" ? Somewhere later... but I have no
>>>>>>> idea currently where.
>>>>>>>
>>>>>>> You will an exception like this:
>>>>>>> [ERROR] [http-bio-0.0.0.0-5080-exec-18]
>>>>>>> org.apache.axis2.rpc.receivers.RPCMessageReceiver - Exception occurred
>>>>>>> while trying to invoke service method getSession
>>>>>>> java.lang.reflect.InvocationTargetException: null
>>>>>>>     at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
>>>>>>> ~[na:na]
>>>>>>>     at
>>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>>>> ~[na:1.6.0_37]
>>>>>>>     at java.lang.reflect.Method.invoke(Method.java:597)
>>>>>>> ~[na:1.6.0_37]
>>>>>>>     at
>>>>>>> org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:256)
>>>>>>> ~[axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>     at
>>>>>>> org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
>>>>>>> ~[axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>     at
>>>>>>> org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
>>>>>>> [axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>     at
>>>>>>> org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:106)
>>>>>>> [axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>     at
>>>>>>> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:169)
>>>>>>> [axis2-jar-1.7.0-SNAPSHOT.jar:na]
>>>>>>>     at
>>>>>>> org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:242)
>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>     at
>>>>>>> org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:184)
>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>     at
>>>>>>> org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:870)
>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>     at
>>>>>>> org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:290)
>>>>>>> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>>>>>>>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>     at
>>>>>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>     at
>>>>>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>     at
>>>>>>> org.red5.logging.LoggerContextFilter.doFilter(LoggerContextFilter.java:77)
>>>>>>> [red5.jar:na]
>>>>>>>     at
>>>>>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>     at
>>>>>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>     at
>>>>>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>     at
>>>>>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>     at
>>>>>>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>     at
>>>>>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>     at
>>>>>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>     at
>>>>>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>     at
>>>>>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>     at
>>>>>>> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>     at
>>>>>>> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>     at
>>>>>>> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
>>>>>>> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>>>>>>>     at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>>>>>> [na:1.6.0_37]
>>>>>>>     at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>>>>>> [na:1.6.0_37]
>>>>>>>     at java.lang.Thread.run(Thread.java:680) [na:1.6.0_37]
>>>>>>> Caused by: java.lang.NullPointerException: null
>>>>>>>     at
>>>>>>> org.apache.openmeetings.axis.services.UserWebServiceFacade.getSession(UserWebServiceFacade.java:67)
>>>>>>> ~[openmeetings-WebService-2.1.0-SNAPSHOT.jar:na]
>>>>>>>     ... 32 common frames omitted
>>>>>>>
>>>>>>> --
>>>>>>> Sebastian Wagner
>>>>>>> https://twitter.com/#!/dead_lock
>>>>>>> http://www.webbase-design.de
>>>>>>> http://www.wagner-sebastian.com
>>>>>>> seba.wagner@gmail.com
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> WBR
>>>>>> Maxim aka solomax
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Sebastian Wagner
>>>>> https://twitter.com/#!/dead_lock
>>>>> http://www.webbase-design.de
>>>>> http://www.wagner-sebastian.com
>>>>> seba.wagner@gmail.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> WBR
>>>> Maxim aka solomax
>>>>
>>>
>>>
>>>
>>> --
>>> Sebastian Wagner
>>> https://twitter.com/#!/dead_lock
>>> http://www.webbase-design.de
>>> http://www.wagner-sebastian.com
>>> seba.wagner@gmail.com
>>>
>>
>>
>>
>> --
>> WBR
>> Maxim aka solomax
>>
>
>
>
> --
> WBR
> Maxim aka solomax
>



-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com

Re: server sets "initComplete=true" to early

Posted by Maxim Solodovnik <so...@gmail.com>.
Do you have any steps for this (maybe unstable)?

My stacktrace is starting with
java.lang.Exception: Server not yet initialized, retry in couple of seconds

Which is expected ...


On Fri, Feb 15, 2013 at 7:17 AM, seba.wagner@gmail.com <
seba.wagner@gmail.com> wrote:

> Hi Maxim,
>
> I've seen you've added some code in the ScopeApplicationAdapter when the
> server is inited lately.
>
> In the servlets we check for that variable
> (ScopeApplicationAdapter.initComplete), in order to make sure the server is
> up before we request the bean.
>
> The issue is that you can still provoke a NullPointerException, cause the
> option in the ScopeApplicationAdapter is reached before the
> ApplicationContext is available.
>
> In the past it was possible to make the server stuck in the boot, it never
> really booted when you hit F5 at the right time a number of times.
> I think it is still possible to do that if you penetrate the server hard
> enough as the "initComplete" is true too early.
>
> Do you have an idea where else in the code we could set the flag
> "ScopeApplicationAdapter.initComplete" ? Somewhere later... but I have no
> idea currently where.
>
> You will an exception like this:
> [ERROR] [http-bio-0.0.0.0-5080-exec-18]
> org.apache.axis2.rpc.receivers.RPCMessageReceiver - Exception occurred
> while trying to invoke service method getSession
> java.lang.reflect.InvocationTargetException: null
>     at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
> ~[na:na]
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> ~[na:1.6.0_37]
>     at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_37]
>     at
> org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:256)
> ~[axis2-jar-1.7.0-SNAPSHOT.jar:na]
>     at
> org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
> ~[axis2-jar-1.7.0-SNAPSHOT.jar:na]
>     at
> org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
> [axis2-jar-1.7.0-SNAPSHOT.jar:na]
>     at
> org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:106)
> [axis2-jar-1.7.0-SNAPSHOT.jar:na]
>     at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:169)
> [axis2-jar-1.7.0-SNAPSHOT.jar:na]
>     at
> org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:242)
> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>     at
> org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:184)
> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>     at
> org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:870)
> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>     at
> org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:290)
> [axis2-transport-http-bundle-1.7.0-SNAPSHOT.jar:na]
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>     at
> org.red5.logging.LoggerContextFilter.doFilter(LoggerContextFilter.java:77)
> [red5.jar:na]
>     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>     at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>     at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>     at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>     at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>     at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>     at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>     at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>     at
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>     at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>     at
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
> [tomcat-embed-core-jar-7.0.34.jar:7.0.34]
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> [na:1.6.0_37]
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> [na:1.6.0_37]
>     at java.lang.Thread.run(Thread.java:680) [na:1.6.0_37]
> Caused by: java.lang.NullPointerException: null
>     at
> org.apache.openmeetings.axis.services.UserWebServiceFacade.getSession(UserWebServiceFacade.java:67)
> ~[openmeetings-WebService-2.1.0-SNAPSHOT.jar:na]
>     ... 32 common frames omitted
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>



-- 
WBR
Maxim aka solomax