Hi Sebastien

Some questions as I'm not clear on the WAR as a contribution point...

Simon

On 10/11/07, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote:
>
> Simon Laws wrote:
> > On 10/11/07, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote:
> >
> >> Nishant Joshi wrote:
> >>
> >>> I have found one work around for this problem but i would like to ask
> >>>
> >> one
> >>
> >>> question that if in my WAR file if i put all WEB-INF\classes files in
> a
> >>>
> >> jar
> >>
> >>> and put it under WEB-INF\lib directory and clean my classes directory
> >>>
> >> than I
> >>
> >>> can't accesss services. is it bug in tuscany or i can't access like
> this
> >>> way. This is the problem with weblogic, I have tested this scenario
> with
> >>> Tomcat where it was working fine but result was as expected i can't
> >>>
> >> access
> >>
> >>> service from lib directory.
> >>>
> >>>
> >>>
> >>>
> >> Hi Nishant,
> >>
> >> I created a WAR similar to what you're describing (moved the classes to
> >> a JAR placed in the lib directory) and I think am able to reproduce the
> >> problem you're seeing, on Tomcat as well. Here's the exception I'm
> >> seeing. Could you please confirm that this is the exception you're
> seeing?
> >>
> >> Thanks.
> >>
> >>
> >>   HTTP Status 500 -
> >>
> >>
> ------------------------------------------------------------------------
> >>
> >> *type* Exception report
> >>
> >> *message*
> >>
> >> *description* _The server encountered an internal error () that
> >> prevented it from fulfilling this request._
> >>
> >> *exception*
> >>
> >> org.apache.jasper.JasperException: An exception occurred processing JSP
> >> page /calc.jsp at line 37
> >>
> >> 34:         <th>Expression</th><th>Result</th>
> >> 35:     </tr>
> >> 36:     <tr>
> >> 37:         <td>2 + 3</td><td><%= calculatorService.add(2, 3) %></td>
> >> 38:     </tr>
> >> 39:     <tr>
> >> 40:         <td>3 - 2</td><td><%= calculatorService.subtract(3, 2)
> %></td>
> >>
> >>
> >> Stacktrace:
> >>         org.apache.jasper.servlet.JspServletWrapper.handleJspException(
> >> JspServletWrapper.java:524)
> >>         org.apache.jasper.servlet.JspServletWrapper.service(
> >> JspServletWrapper.java:435)
> >>         org.apache.jasper.servlet.JspServlet.serviceJspFile(
> >> JspServlet.java:320)
> >>         org.apache.jasper.servlet.JspServlet.service(JspServlet.java
> :266)
> >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >>
> org.apache.tuscany.sca.host.webapp.TuscanyServletFilter.doFilter(
> >> TuscanyServletFilter.java:93)
> >>
> >> *root cause*
> >>
> >> org.osoa.sca.ServiceUnavailableException: No service invoker is
> available
> >> for reference default (bindingURI=CalculatorServiceComponent
> operation=add).
> >>
> >>
> org.apache.tuscany.sca.binding.sca.impl.RuntimeSCAReferenceBindingProvider.createInvoker
> >> (RuntimeSCAReferenceBindingProvider.java:192)
> >>
> >>
> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.addBindingInterceptor
> >> (RuntimeWireImpl.java:214)
> >>
> >>
> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.initInvocationChains(
> >> RuntimeWireImpl.java:156)
> >>
> >>
> org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChains(
> >> RuntimeWireImpl.java:97)
> >>
> >>
> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.getInvocationChain
> >> (JDKInvocationHandler.java:190)
> >>
> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke
> >> (JDKInvocationHandler.java:124)
> >>         $Proxy31.add(Unknown Source)
> >>         org.apache.jsp.calc_jsp._jspService(calc_jsp.java:76)
> >>         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java
> :70)
> >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >>         org.apache.jasper.servlet.JspServletWrapper.service(
> >> JspServletWrapper.java:393)
> >>         org.apache.jasper.servlet.JspServlet.serviceJspFile(
> >> JspServlet.java:320)
> >>         org.apache.jasper.servlet.JspServlet.service(JspServlet.java
> :266)
> >>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >>
> org.apache.tuscany.sca.host.webapp.TuscanyServletFilter.doFilter(
> >> TuscanyServletFilter.java:93)
> >>
> >> *note* _The full stack trace of the root cause is available in the
> >> Apache Tomcat/6.0.14 logs._
> >>
> >> --
> >> Jean-Sebastien
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >> This error from the default SCA binding is basically saying that the
> wire
> >>
> > to the target service is not configured correctly (or at all). In
> particular
> > in this case the reference has the name "default" which is the name set
> when
> > the proxy is created for a target component that can't be found in the
> local
> > runtime. As you might expect there can be several reasons for this. Are
> you
> > seeing any warnings reported when the contributions is processed? What
> I'm
> > thinking about in particular is elements that can't be parsed because
> the
> > appropriate extension isn't loaded.
> >
> > Regards
> >
> > Simon
> >
> >

I investigated a little more and the issue is pretty simple: Tuscany

> does not scan for .composite files in JARs placed under WEB-INF/lib.


Because, in host-webapp, it's picking up the application root as a folder
based contribution which is contributed to Tuscany. In the folder based
contribution process it won't unpack jars and look for composites. So you
are saying here this behaviour is observed because the contribution
artifacts are now inside a jar and not because the jar happens to be in
WEB-INF/lib.

I think that it's by design - although we can discuss changing the


I think it just assumes that the WAR will be unpacked into a directory
structure as part of the WAR deployment process.

design :). We currently support the following SCA contribution packaging
> schemes:
>
> - A folder, SCA artifacts (.composite, .componentType files etc.) are
> placed under the folder or sub-folders.
>
> - A JAR, SCA artifacts are placed directly in the JAR.
>
> - A WAR, SCA artifacts are placed directly in the WAR.


A WAR isn't really a supported contribution scheme in the sense that the
contribution processor knows what to do with WARs.  IIUC what is happening
is that the WAR is deployed  to Tomcat (or whatever) which unpacks it to the
file system before the contents are then contributed, by host-webapp, to
Tuscany. Tuscany then treats it as a folder contribution.

I agree with the sentiment that, from a user perspective, they package the
contributed artifacts in a WAR and it then works. Am just trying to get a
grip on what is actually going on here under the covers :-)

We do not support nesting JARs inside JARs


>From the assembly spec

2830 Contributions do not contain other contributions. If the packaging
format is a JAR file that
2831 contains other JAR files (or any similar nesting of other
technologies), the internal files are not
2832 treated as separate SCA contributions

or JARs inside WARs.


If we consider a WAR to be a contribution format then this falls under this
spec restriction as well which at least seems consistent. If we wanted a JAR
to act as contributions inside a WAR (assuming we don't consider the WAR as
an SCA contribution format) then we would have to change host-webapp to look
for jars instead of (or as well as) folders.

Classes
> and resources present in JARs placed inside a WAR under WEB-INF/lib are
> available through the Webapp ClassLoader, but SCA artifacts and other
> XML artifacts like WSDL and XSD for example need to be placed directly
> under the WAR, i.e. not hidden inside a JAR.
>
> Technically it would be easy to adjust the scanning algorithm to include
> JARs inside WARs but we would have to consider this carefully as
> allowing for nested archives may cause all kinds of complications (not
> really technical problems but confusion and complications in the various
> use cases for SCA contributions).



Nishant, do you have a requirement to package your SCA artifacts in a
> JAR under WEB-INF/lib? or are you OK with having them directly under the
> WAR?
>
> --
> Jean-Sebastien
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to