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.

I think that it's by design - although we can discuss changing the 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.

We do not support nesting JARs inside JARs or JARs inside WARs. 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