OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | exoplatform List | April 2008 Index

<--  Date Index  --> <--  Thread Index  -->

[exoplatform] Re: Re: Problem instanciating a component via reflection


Could you describe with more details what your applications does exactly and in which context that filter code is called?

Cheers

On Tue, Apr 8, 2008 at 5:46 PM, Luis Arias <kaaloo@xxxxxxxxx> wrote:
Benjamin,

The webapp web.xml was modified to use the filters you pointed out
below, using /* as the filter mapping.

We are getting the following stacktrace in the filter:


 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: "Servlet.service()" pour la servlet jsp a généré une exception
javax.servlet.ServletException: Could not initialize
PortalContainer.Current ExoContainer is:
org.exoplatform.container.RootContainer@1862525
       at org.exoplatform.frameworks.jcr.web.PortalContainerInitializedFilter.doFilter(PortalContainerInitializedFilter.java:80)
       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:228)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
       at java.lang.Thread.run(Thread.java:619)

Are there any other configuration items that need to be addressed in
the web.xml or is there some java code that needs to be written to
correctly initialize the webapp in the exo environment ?

Please let us know if any other code or configuration items are useful
to you so Michael can send them to you.

Thanks again,
Luis
On Tue, Apr 8, 2008 at 3:42 PM, Benjamin Mestrallet
<benjamin.mestrallet@xxxxxxxxxxxxxxx> wrote:
> How does the webapp is called, I mean that code?
>
> as a portlet (aka groing through the portal URL) or independently (for
> example in an IFrame)
>
> If it is an IFrame then you surely need to have a filer in your webapp that
> will setup the PortalContainer current instance in the threadlocal of your
> request (from the iframe to your webapp)
>
> The filter that may be needed in your web.xml are:
>
>   <filter>
>     <filter-name>PortalContainerInitializedFilter</filter-name>
>
> <filter-class>org.exoplatform.frameworks.jcr.web.PortalContainerInitializedFilter</filter-class>
>    </filter>
>
>   <filter>
>     <filter-name>ThreadLocalSessionProviderInitializedFilter</filter-name>
>
> <filter-class>org.exoplatform.frameworks.jcr.web.ThreadLocalSessionProviderInitializedFilter</filter-class>
>    </filter>
>
> and then need to correctly set up the filter mapping like for instance:
>
>  <filter-mapping>
>     <filter-name>PortalContainerInitializedFilter</filter-name>
>     <url-pattern>/rest/*</url-pattern>
>    </filter-mapping>
>
>
>
>
> On Tue, Apr 8, 2008 at 12:38 PM, Luis Arias <kaaloo@xxxxxxxxx> wrote:
> >
> >
> >
> > Hi,
> >
> > I'm reporting this problem for a friend Michael who has been having
> > some problems recently instanciating a component from a webapp running
> > on an exo-tomcat installation (latest community build).
> >
> > The component passes unit tests run against the StandaloneContainer,
> > but fails when instanciated from the webapp.
> >
> > [07 avr. 17:24:12] DEBUG (class Archiver in thread
> > graphane.diffusion.listener#0) - calling
> > Archiver.diffuse(Hashtable<String, String> argsHashTable, java.io.File
> > file)
> >  java.lang.Exception: PortalContainer.getInstance() returns null
> >     at com.docxa.corus.jcr.Archiver.getSession(Archiver.java:59)
> >     at com.docxa.corus.jcr.Archiver.diffuse(Archiver.java:77)
> >     at
> com.graphane.core.diffusion.listener.ListenerDiffusionComponent.dispatchDocuments(ListenerDiffusionComponent.java:85)
> >     at
> com.graphane.satellites.diffusion.threadstools.ThreadProcessor.callDispatchDocuments(ThreadProcessor.java:63)
> >     at
> com.graphane.satellites.diffusion.threadstools.ThreadProcessor.processDiffusion(ThreadProcessor.java:99)
> >     at
> com.graphane.satellites.diffusion.threadstools.ThreadProcessor.run(ThreadProcessor.java:222)
> >  [07 avr. 17:24:12] ERROR (class Archiver in thread
> > graphane.diffusion.listener#0) - Unable to diffuse to JCR
> >  java.lang.Exception: PortalContainer.getInstance() returns null
> >     at com.docxa.corus.jcr.Archiver.getSession(Archiver.java:59)
> >     at com.docxa.corus.jcr.Archiver.diffuse(Archiver.java:77)
> >     at
> com.graphane.core.diffusion.listener.ListenerDiffusionComponent.dispatchDocuments(ListenerDiffusionComponent.java:85)
> >     at
> com.graphane.satellites.diffusion.threadstools.ThreadProcessor.callDispatchDocuments(ThreadProcessor.java:63)
> >     at
> com.graphane.satellites.diffusion.threadstools.ThreadProcessor.processDiffusion(ThreadProcessor.java:99)
> >     at
> com.graphane.satellites.diffusion.threadstools.ThreadProcessor.run(ThreadProcessor.java:222)
> >
> >
> > The code that instanciates the component in the webapp is the following:
> >
> > Class < DiffusionListenerInterface > classToLoad =
> >                     (Class < DiffusionListenerInterface > )
> > Class.forName(classNameToRegister);
> >  Constructor < DiffusionListenerInterface > constructor =
> > classToLoad.getConstructor();
> >  DiffusionListenerInterface diffusionListenerToRegister =
> > constructor.newInstance();
> >
> >
> > The call to PortalContainer.getInstance() that fails in the component
> > is the following:
> >
> >    private Session getSession() throws RepositoryException
> >    {
> >        RepositoryService repoService =
> >
> (RepositoryService)PortalContainer.getInstance().getComponentInstanceOfType(RepositoryService.class);
> >        repository = repoService.getCurrentRepository();
> >        String wsName =
> repository.getConfiguration().getDefaultWorkspaceName();
> >        return
> repository.getSystemSession(wsName).getRootNode().getSession();
> >    }
> >
> > We are stumped as to why this is happening, maybe some configuration
> > files missing in the webapp ?  Is there a better way to obtain a JCR
> > Session for the component ?  Is there a better way to instanciate the
> > component from the webapp ?
> >
> > Thanks,
> >
> > --
> > Luis Arias
> > +33 6 14 20 87 93
> > skype : kaaloo
> >
> >
> > --
> > You receive this message as a subscriber of the exoplatform@xxxxxxx
> mailing list.
> > To unsubscribe: mailto:exoplatform-unsubscribe@xxxxxxx
> > For general help: mailto:sympa@xxxxxxx?subject=help
> > OW2 mailing lists service home page: http://www.ow2.org/wws
> >
> >
>
>



--
Luis Arias
+33 6 14 20 87 93
skype : kaaloo


--
You receive this message as a subscriber of the exoplatform@xxxxxxx mailing list.
To unsubscribe: mailto:exoplatform-unsubscribe@xxxxxxx
For general help: mailto:sympa@xxxxxxx?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws




<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 2006-2007, OW2 Consortium | contact | webmaster.