You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Urso Wieske <uw...@gmail.com> on 2011/01/09 21:33:46 UTC

Callback and Tuscany 2.0 Samples

Hi

I am evaluating Tuscany 2.0 Beta1 and am trying to learn more about
Callbacks (Bi-Directional interface) of SCA 1.1.
I downloaded the Tuscany Sample files and started to explore the callback
implementations with webservice binding, i.e. the Search and SearchCallback
interfaces.
It took me a while before I realized that the Tuscany SCA Samples were based
on SCA v1.0.   Tuscany 2.0 Beta1 is based on the SCA v1.1 specs.
After studying the sample sources, I have written my own callback.

Unfortunately, I kept on getting a runtime exception after I installed and
deployed my contribution. By the way, I am using Eclipse and the maven
tuscany plugin.

I can't find the problem and hope if someone can point me in the right
direction.

This is the error (printed on my console) I am getting when I try to run my
program:
[ERROR] Failed to execute goal
org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
(default-cli) on project handler-agent: Execution default-cli of goal
org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run failed:
org.oasisopen.sca.ServiceRuntimeException: [Composite: {
http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component:
MessageInterpreterComponent] - [ASM60033] No targets for reference:
Composite = {http://docs.oasis-open.org/ns/opencsa/sca/200912} Reference =
messageInterpreterCallback -> [Help 1]

I suspect that I am doing something wrong in the composite file. I can't
imagine I did something wrong in the java sources. (See below for the
sources.)


Kind Regards,

Urso


-------------------- THE SERVICE Interface With Callback Interface
association ----------

/**
 *
 */
package org.acme.logix;

import org.acme.logix.message.Message;
import org.oasisopen.sca.annotation.Callback;
import org.oasisopen.sca.annotation.OneWay;
import org.oasisopen.sca.annotation.Remotable;

/**
 *
 *
 */
@Remotable
@Callback(MessageInterpreterCallback.class)
public interface MessageInterpreter {

@OneWay
void interpret(Message msg);
 }


/**
 *
 */
package org.acme.logix;

import org.oasisopen.sca.annotation.OneWay;
import org.oasisopen.sca.annotation.Remotable;

/**
 *
 *
 */
@Remotable
public interface MessageInterpreterCallback {
 void onInterpret(Interpretation ipr);
}


---------- THE CLIENT implementing the callback interface ------------

/**
 *
 */
package org.acme.logix;

import org.acme.logix.message.Message;
import org.oasisopen.sca.annotation.Reference;

/**
 *
 */
public class LogisticCenterImpl implements LogisticCenter,
MessageInterpreterCallback {
 private AuditService auditService;
 @Reference
protected MessageInterpreter messageInterpreter;

/* (non-Javadoc)
 * @see
org.acme.logix.LogisticCenter#processMessage(org.acme.logix.message.Message)
 */
public void processMessage(Message message) {
 System.out.println("Processing message with payload " +
message.getPayload() );
auditService.logSentMessage(message);
messageInterpreter.interpret(message);
}

/**
 * @return the auditService
 */
public AuditService getAuditService() {
return auditService;
}

/**
 * @param auditService the auditService to set
 */
@Reference
public void setAuditService(AuditService auditService) {
this.auditService = auditService;
}

/**
 * @param messageInterpreter the messageInterpreter to set
 */
 public void setMessageInterpreter(MessageInterpreter messageInterpreter) {
this.messageInterpreter = messageInterpreter;
}

/**
 * @return the messageInterpreter
 */
public MessageInterpreter getMessageInterpreter() {
return messageInterpreter;
}


        /**
        *  THE CALLBACK method of MessageInterpreterCallback interface
        */
public void onInterpret(Interpretation ipr) {
System.out.println("Message has been interpreted.");
 }

}


---------THE SERVICE WHICH IS CALLED BY THE CLIENT THROUGH WEBSERVICE
BINDING ---------

/**
 *
 */
package org.acme.logix;

import org.acme.logix.message.Message;
import org.oasisopen.sca.RequestContext;
import org.oasisopen.sca.ServiceReference;
import org.oasisopen.sca.annotation.Callback;
import org.oasisopen.sca.annotation.Context;
import org.oasisopen.sca.annotation.Reference;
import org.oasisopen.sca.annotation.Service;

/**
 *
 *
 */
public class MessageInterpreterImpl implements MessageInterpreter{

@Callback
protected MessageInterpreterCallback messageInterpreterCallback;
  /* (non-Javadoc)
 * @see
org.acme.logix.MessageInterpreter#interpret(org.acme.logix.message.Message)
 */
 public void interpret(Message msg) {
 System.out.println("The message is being interpreted..");
Interpretation ipr = new Interpretation();
messageInterpreterCallback.onInterpret(ipr);
}



/**
 * @return the messageInterpreterCallback
 */
public MessageInterpreterCallback getMessageInterpreterCallback() {
return messageInterpreterCallback;
}



/**
 * @param messageInterpreterCallback the messageInterpreterCallback to set
 */
public void setMessageInterpreterCallback(
MessageInterpreterCallback messageInterpreterCallback) {
this.messageInterpreterCallback = messageInterpreterCallback;
}
}





---- THE COMPOSITE -----------



<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
           targetNamespace="http://logistix"
           xmlns:logistix="http://logistix"
           name="AfnemerLogisticCenter">

    <component name="AfnemerHandlingAgentComponent">
 <implementation.java class="org.acme.logix.HandlingAgentImpl"/>
        <reference name="logisticCenter" >
         <binding.ws uri="
http://127.0.0.1:8087/AfnemerHandlingAgentComponent"/>
        </reference>
        <reference name="auditService" target="AuditServiceComponent"/>

    </component>


    <component name="AfnemerLogisticCenterComponent">
        <implementation.java class="org.acme.logix.LogisticCenterImpl"/>

<reference name="messageInterpreter">
 <interface.java interface="org.acme.logix.MessageInterpreter"

 callbackInterface="org.acme.logix.MessageInterpreterCallback"/>

<binding.ws uri="
http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
 <callback >
<binding.ws uri="http://localhost:8084/Client/MessageInterpreterCallback<http://localhost:8081/Client/MessageInterpreterCallback>
" />
 </callback>
</reference>
         <reference name="auditService">
           <binding.jms
initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
jndiURL="tcp://localhost:61616">
   <destination jndiName="AuditServiceQueue" />
   </binding.jms>
        </reference>

    </component>

    <component name="MessageInterpreterComponent">
     <implementation.java class="org.acme.logix.MessageInterpreterImpl"/>

     <service name="MessageInterpreter">
<interface.java interface="org.acme.logix.MessageInterpreter"

 callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
<binding.ws  uri="
http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
 <callback>
<binding.ws uri="http://localhost:8084/Client/MessageInterpreterCallback<http://localhost:8081/Client/MessageInterpreterCallback>
"/>
 </callback>
</service>
    </component>


    <component name="AuditServiceComponent">
        <implementation.java class="org.acme.logix.AuditServiceImpl"/>

        <service name="AuditService">
            <binding.jms
initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
jndiURL="tcp://localhost:61616">
   <destination jndiName="AuditServiceQueue" />
</binding.jms>
        </service>
    </component>

</composite>

Re: Callback and Tuscany 2.0 Samples

Posted by Simon Nash <si...@cjnash.com>.
Urso Wieske wrote:
> Simon,
> 
> I added the dependencies AS PART OF the maven plugin dependency element. 
> (Dependencies element enclosed  in the build/plugins/plugin element).
> Then it should work!
> 
Hi Urso,
I've tried just about every possible combination of dependencies in the
build/plugin element and I get errors every time.  What combination are
you using?

   Simon

> 
> Kind regards,
> Urso
> 
> 2011/1/16 Urso Wieske <uwieske@gmail.com <ma...@gmail.com>>
> 
>     Nope, I was mislead.  The maven plugin does not work. Only the
>     Testclass is working.
> 
>     Kind regards
>     Urso
> 
>     2011/1/16 Urso Wieske <uwieske@gmail.com <ma...@gmail.com>>
> 
>         Hi Simon,
> 
>         I have been studying the source code around SCA binding.ws
>         <http://binding.ws> extension.
>         As you mentioned earlier, the Tuscany SCA runtime  uses by
>         default de reference implementation of JAX-WS binding. 
> 
>         In the resource of binding-ws-runtime-jaxws-ri at the path
>         META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory:
> 
>         org.apache.tuscany.sca.binding.ws.jaxws.ri.JAXWSBindingProviderFactory;model=org.apache.tuscany.sca.binding.ws.WebServiceBinding
> 
>         you can indeed see that the Factory JAXWSBindingProviderFactory
>         is used as default.
> 
>         I believe -I have not digged into the code yet- that the
>         reference implementation is overridden as soon as the SCA
>         runtime finds an alternative binding.ws <http://binding.ws>
>         implementation on the classpath. 
>         I check this by just adding the Axis2 extension to my dependency
>         set and I the runtime appears switch automatically to Axis2.
> 
>         I manage to run my code with the maven plugin. I removed 
>                          <dependency>
>             <groupId>org.apache.tuscany.sca</groupId>
>             <artifactId>tuscany-node-impl</artifactId>
>             <version>2.0-Beta1</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.tuscany.sca</groupId>
>             <artifactId>tuscany-implementation-java-runtime</artifactId>
>             <version>2.0-Beta1</version>
>         </dependency>
> 
>         from my dependencyset and ran my code succesfully. 
>         I don't understand the "negative" effect of these two
>         dependencies on my code.
> 
>         Maybe you have some clarification for this?
> 
> 
>         Kind Regards,
>         Urso 
> 
>         2011/1/15 Simon Nash <nash@apache.org <ma...@apache.org>>
> 
>             Urso Wieske wrote:
> 
>                 Hi Simon,
> 
>                 Could you send me a copy of your POM which you have used
>                 /adapted?
>                 Also which public repositories are you using to download
>                 your Tuscany 2.0 Beta1 dependencies?
>                 (I have initially googled for a oublic maven repository
>                 where I could donwload the Tuscany v2 Beta1 dependencies.)
> 
>                 I replaced my base runtime for the 4 dependencies you
>                 have stated, but I get runtime exceptions due to other
>                 causes. Most probably I should have other dependencies
>                 too which you have not mentioned.
> 
>                 Kind regards.
>                 Urso
> 
>             Hi Urso,
>             My pom and JUnit test case are attached below.  The
>             repository URL
>             is included in the pom.
> 
>              Simon
> 
>             ----- begin pom -----
> 
>             <project xmlns="http://maven.apache.org/POM/4.0.0"
>             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>                    
>             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>             http://maven.apache.org/xsd/maven-4.0.0.xsd">
>                <modelVersion>4.0.0</modelVersion>
>                <parent>
>                    <groupId>org.apache.tuscany.sca</groupId>
>                    <artifactId>tuscany-sca</artifactId>
>                    <version>2.0-Beta1</version>
>                </parent>
>                <groupId>org.acme.logix</groupId>
>                <artifactId>handler-agent</artifactId>
>                <version>0.0.1-SNAPSHOT</version>
>                <packaging>jar</packaging>
> 
>                <name>handler-agent</name>
>                <url>http://maven.apache.org</url>
> 
>                <properties>
>                  
>              <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>                </properties>
> 
>                <repositories>
>                    <repository>
>                        <id>apache.staging</id>
>                      
>              <url>https://repository.apache.org/content/groups/staging</url>
>                    </repository>
>                </repositories>
> 
>                <build>
>                  
>              <finalName>afnemer-handling-agent-contribution</finalName>
>                    <plugins>
>                        <plugin>
>                          
>              <groupId>org.apache.tuscany.maven.plugins</groupId>
>                            <artifactId>maven-tuscany-plugin</artifactId>
>                            <version>2.0-Beta1</version>
>                            <dependencies>
>                                <dependency>
>                                    <groupId>org.apache.tuscany.sca</groupId>
>                                  
>              <artifactId>tuscany-binding-jms-runtime</artifactId>
>                                    <version>2.0-Beta1</version>
>                                </dependency>
> 
>                                <dependency>
>                                    <groupId>org.apache.activemq</groupId>
>                                    <artifactId>activemq-all</artifactId>
>                                    <version>5.3.0</version>
>                                    <scope>runtime</scope>
>                                </dependency>
>                            </dependencies>
>                        </plugin>
>                        <plugin>
>                            <groupId>org.apache.maven.plugins</groupId>
>                            <artifactId>maven-compiler-plugin</artifactId>
>                            <version>2.3.2</version>
>                            <configuration>
>                                <source>1.6</source>
>                                <target>1.6</target>
>                            </configuration>
>                        </plugin>
>                    </plugins>
>                </build>
>                <dependencies>
>                    <dependency>
>                        <groupId>org.apache.tuscany.sca</groupId>
>                        <artifactId>tuscany-feature-api</artifactId>
>                        <type>pom</type>
>                        <version>2.0-Beta1</version>
>                    </dependency>
> 
>                    <dependency>
>                        <groupId>org.apache.tuscany.sca</groupId>
>                        <artifactId>tuscany-binding-jms-runtime</artifactId>
>                        <version>2.0-Beta1</version>
>                    </dependency>
> 
>                    <dependency>
>                        <groupId>org.apache.activemq</groupId>
>                        <artifactId>activemq-all</artifactId>
>                        <version>5.3.0</version>
>                        <scope>runtime</scope>
>                    </dependency>
> 
>                   <dependency>
>                        <groupId>org.apache.tuscany.sca</groupId>
>                      
>              <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>                        <version>2.0-Beta1</version>
>                   </dependency>
> 
>                    <dependency>
>                        <groupId>org.apache.tuscany.sca</groupId>
>                        <artifactId>tuscany-host-jetty</artifactId>
>                        <version>2.0-Beta1</version>
>                    </dependency>
> 
>                    <dependency>
>                        <groupId>org.apache.tuscany.sca</groupId>
>                        <artifactId>tuscany-node-impl</artifactId>
>                        <version>2.0-Beta1</version>
>                    </dependency>
> 
>                    <dependency>
>                        <groupId>org.apache.tuscany.sca</groupId>
>                      
>              <artifactId>tuscany-implementation-java-runtime</artifactId>
>                        <version>2.0-Beta1</version>
>                    </dependency>
> 
>                    <dependency>
>                        <groupId>junit</groupId>
>                        <artifactId>junit</artifactId>
>                        <version>4.8.1</version>
>                        <scope>test</scope>
>                    </dependency>
>                </dependencies>
>             </project>
> 
>             ----- begin test case -----
> 
>             package acme;
> 
>             import org.apache.activemq.broker.BrokerService;
>             import org.apache.tuscany.sca.node.Contribution;
>             import org.apache.tuscany.sca.node.Node;
>             import org.apache.tuscany.sca.node.NodeFactory;
>             import org.junit.Test;
> 
>             public class CallbackTestCase {
> 
>                @Test
>                public void testSayHello() throws Exception {
> 
>                    // Start the JMS broker
>                    BrokerService jmsBroker = new BrokerService();
>                    jmsBroker.setPersistent(false);
>                    jmsBroker.setUseJmx(false);
>                    jmsBroker.addConnector("tcp://localhost:61616");
>                    jmsBroker.start();
> 
>                    // Start the Tuscany runtime with this module as the
>             contribution
>                    System.out.println("starting Tuscany runtime");
>                    Node node = NodeFactory.newInstance().createNode(new
>             Contribution("c1", "target/classes"));
>                    System.out.println("Tuscany runtime started");
> 
>                    // Start the Tuscany node. This also runs the
>             @EagerInit test method.
>                    node.start();
>                    System.out.println("Tuscany node started");
> 
>                    // Stop the Tuscany runtime
>                    node.stop();
> 
>                    // Stop the JMS broker
>                    jmsBroker.stop();
>                }
> 
>             }
> 
>             ----- end test case -----
> 
>              > 2011/1/15 Simon Nash <nash@apache.org
>             <ma...@apache.org> <mailto:nash@apache.org
>             <ma...@apache.org>>>
> 
> 
>                    Urso Wieske wrote:
> 
>                        Hi Simon,
> 
>                        Thanks for the quick response.
>                        That's a pitty that maven-tuscany-plugin is not
>                 behaving
>                        accordingly. It's a great instrument to use
>                 within my IDE
>                        (Eclipse). I'll submit an issue at the Tuscany
>                 projectsite. I
>                        will also dig into the "maven-tuscany-plugin"
>                 problem to figure
>                        out what is the cause of this deviation.
> 
>                    Hi Urso,
>                    I agree.  It should be possible to use
>                 maven-tuscany-plugin and
>                    replace things in the base runtime by alternative
>                 implementations.
>                    Maybe there is a way to do this, but I couldn't find one.
> 
>                     Simon
> 
>                        Kind Regards
>                        Urso
> 
> 
>                        2011/1/15 Simon Nash <nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>>
> 
>                           Urso Wieske wrote:
> 
>                               Hi Simon,
> 
>                               I have uploaded my sources as a zipped file.
> 
>                           Hi Urso,
>                           This problem is caused by a bug in Tuscany.
>                  Please raise a JIRA
>                           so that we can track and fix the problem.  In
>                 the meantime, I can
>                           suggest a partial workaround.
> 
>                           The injection failure only happens if Tuscany
>                 is using the
>                           tuscany-binding-ws-runtime-jaxws module as the
>                 runtime
>                        implementation
>                           for <binding.ws <http://binding.ws>
>                 <http://binding.ws> <http://binding.ws>>.  It
>                        doesn't happen if
>                           tuscany-binding-ws-runtime-axis2
>                           is used instead of
>                 tuscany-binding-ws-runtime-jaxws.  This
>                        implies that
>                           the problem is caused by a bug in the -jaxws
>                 version.
> 
>                           By default, Tuscany uses the -jaxws version.
>                  To get Tuscany
>                        to use
>                           the -axis2 version instead, you need to do special
>                        configuration in
>                           the pom.xml file.
> 
>                           Unfortunately I couldn't find a way to make
>                 this change when
>                        using
>                           maven-tuscany-plugin to run the application.
>                  This is because
>                           maven-tuscany-plugin has a dependency on
>                 tuscany-base-runtime.
>                           The tuscany-base-runtime jar contains the
>                 -jaxws version and
>                        seems
>                           to always use it even if the -axis2 version is
>                 declared as an
>                           additional dependency.
> 
>                           I did find a way to get Tuscany to use the
>                 -axis2 version
>                        when not
>                           using maven-tuscany-plugin.  If you replace
>                 this dependency:
>                            <dependency>
>                                <groupId>org.apache.tuscany.sca</groupId>
>                                <artifactId>tuscany-base-runtime</artifactId>
>                                <version>2.0-Beta1</version>
>                            </dependency>
> 
>                           by the following four dependencies:
>                            <dependency>
>                                <groupId>org.apache.tuscany.sca</groupId>
>                              
>                  <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>                                <version>2.0-Beta1</version>
>                            </dependency>
> 
>                            <dependency>
>                                <groupId>org.apache.tuscany.sca</groupId>
>                                <artifactId>tuscany-host-jetty</artifactId>
>                                <version>2.0-Beta1</version>
>                            </dependency>
> 
>                            <dependency>
>                                <groupId>org.apache.tuscany.sca</groupId>
>                                <artifactId>tuscany-node-impl</artifactId>
>                                <version>2.0-Beta1</version>
>                            </dependency>
> 
>                            <dependency>
>                                <groupId>org.apache.tuscany.sca</groupId>
>                              
>                  <artifactId>tuscany-implementation-java-runtime</artifactId>
>                                <version>2.0-Beta1</version>
>                            </dependency>
> 
>                           then the application runs successfully.  I
>                 used a maven JUnit
>                        test
>                           to verify this.
> 
>                            Simon
> 
>                               Hi Simon,
> 
>                               I adapted my code as you suggested. It
>                 seems like the
>                        error has
>                               dissappeared, but I got new ones. Well I
>                 removed the
>                        setter and
>                               getter of messageInterpreterCallback from
>                               MessageInterpreterImpl. Now my
>                 MessageInterpreterImpl class
>                               contains only the instance variable
>                        messageInterpreterCallback .
>                               I have made it a protected variable.
> 
>                               I get a HTTP Internal Server ( error 500).
>                               I am still missing something.SCA runtime
>                 is supposed
>                               "automatically" inject my callback
>                 instance in the
>                               messageInterpreterCallback member variable of
>                               MessageInterpreterImpl. The
>                 MessageInterpreterImpl needs
>                        to have
>                               a reference to some callback instance.
>                               I can;t seem to solve this problem.
> 
>                               This is the error....
>                               ---------------------------------------
>                               SEVERE: Exception invoking injector - null
>                               org.oasisopen.sca.ServiceRuntimeException:
>                 Exception invoking
>                               injector - null
>                               at
>                                    
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                               at
>                                    
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                               at
>                                    
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                               at
>                                    
>                  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                               at
>                                    
>                  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                               at
>                                    
>                  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                               at
>                                    
>                  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                               at
>                      
>                  com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                               at
>                 sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                               at
>                      
>                  com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                               at
>                                    
>                  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                               at
>                      
>                  com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                               at
>                      
>                  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                               at
>                                    
>                  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                               at
>                                    
>                  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                               at java.lang.Thread.run(Thread.java:662)
>                               Caused by:
>                              
>                 org.apache.tuscany.sca.core.factory.ObjectCreationException:
>                               Exception invoking injector - null
>                               at
>                                    
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>                               at
>                                    
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>                               ... 27 more
>                               Caused by: java.lang.NullPointerException
>                               at
>                                    
>                  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>                               at
>                                    
>                  org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>                               at
>                                    
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>                               ... 28 more
>                               10-jan-2011 1:39:26
>                                    
>                  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>                               processRequest
>                               SEVERE: The server sent HTTP status code
>                 500: Internal
>                        Server Error
>                              
>                 com.sun.xml.internal.ws.client.ClientTransportException: The
>                               server sent HTTP status code 500: Internal
>                 Server Error
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                               at
>                 com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>                               at
>                                    
>                  com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>                               at
>                                    
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>                               at
>                                    
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>                               at $Proxy50.interpret(Unknown Source)
>                               at
>                                    
>                  org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>                               at
>                 sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>                        Method)
>                               at
>                                    
>                  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>                               at
>                                    
>                  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>                               at
>                 java.lang.reflect.Method.invoke(Method.java:597)
>                               at
>                                    
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                               at
>                                    
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                               at
>                                    
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                               at
>                                    
>                  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                               at
>                                    
>                  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                               at
>                                    
>                  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                               at
>                                    
>                  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                               at
>                      
>                  com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                               at
>                 sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                               at
>                      
>                  com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                               at
>                                    
>                  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                               at
>                      
>                  com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                               at
>                      
>                  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                               at
>                                    
>                  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                               at
>                                    
>                  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                               at java.lang.Thread.run(Thread.java:662)
>                               -----------------------------------------
>                                Hope you can help me. (?)
> 
>                               Kind Regards
>                               Urso
> 
> 
> 
> 
>                               2011/1/14 Simon Nash <nash@apache.org
>                 <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>                 <mailto:nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>>
>                               <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>>>
> 
> 
>                                  Hi Urso,
>                                  I'm starting to look at your project
>                 code now.
> 
>                                  It's important to keep these threads on
>                 the Tuscany
>                        mailing list
>                                  so that other members of the Tuscany
>                 community are
>                        included in
>                                  the discussion.  The Tuscany mailing
>                 list archives are an
>                               important
>                                  resource for Tuscany users who are
>                 experiencing a
>                        problem and are
>                                  looking to see if others have found a
>                 solution.  If a
>                        problem is
>                                  solved by a private message exchange
>                 instead of on the
>                        public
>                               list,
>                                  the knowledge of how to solve it is
>                 confined to one person
>                               instead
>                                  of being shared by the community.
> 
>                                  The best way to make this happen would
>                 be for you to
>                        resend your
>                                  recent private emails to the public
>                 list.  I'll look
>                        out for them
>                                  on the public list so that I can
>                 respond to them there.
> 
>                                   Simon
> 
>                                  Urso Wieske wrote:
> 
>                                      Hi Simon,
> 
>                                      You'll find in this email the
>                 zipped file
>                        containing my
>                               sourcecode.
> 
>                                      Unfortunately, I still have errors.
>                                      I changed the member variable from
>                 protected to
>                        private
>                               like you
>                                      suggested.
>                                      And created Getter and Setter for
>                 this member
>                        variable.
>                                      (messageInterpreterCallback).
>                                      I annotated the setter with @Callback.
>                                      I also removed the URI attribute
>                 from the
>                               callback/binding.ws <http://binding.ws>
>                 <http://binding.ws> <http://binding.ws>
>                                      <http://binding.ws>
>                 <http://binding.ws> element of the
>                               service
> 
>                                      according to your suggestion. Still
>                 problems.... :-(
> 
> 
>                                      I have zipped my source. It's an
>                 Eclipse project.
> 
>                                      I appreciate the fact that you are
>                 willing to
>                        verify this
>                               issue.
>                                      If you have any questions about the
>                 code, just let
>                        me know.
> 
>                                      Please checkout also if my POM is
>                 well specified with
>                               regard to
>                                      dependencies. Do I have the proper
>                 dependencies. I
>                        am using
>                                      Tuscany 2.0 Beta1.
> 
>                                      Kind Regards
>                                      Urso
> 
> 
>                                      2011/1/10 Simon Nash
>                 <nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>                               <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>
>                               <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>>>
>                                      <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>
>                               <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>>>>
> 
> 
>                                         Urso Wieske wrote:
> 
>                                             Hi Simon,
> 
>                                             I adapted my code as you
>                 suggested. It
>                        seems like the
>                                      error has
>                                             dissappeared, but I got new
>                 ones. Well I
>                        removed the
>                                      setter and
>                                             getter of
>                 messageInterpreterCallback from
>                                             MessageInterpreterImpl. Now my
>                               MessageInterpreterImpl class
>                                             contains only the instance
>                 variable
>                                      messageInterpreterCallback .
>                                             I have made it a protected
>                 variable.
> 
>                                         According to the SCA 1.1 specs,
>                 this variable
>                        should
>                               be private
>                                         in order to avoid having it
>                 treated as a reference.
>                                Can you try
>                                         changing this and see if it
>                 makes any difference?
> 
> 
>                                             I get a HTTP Internal Server
>                 ( error 500).
>                                             I am still missing
>                 something.SCA runtime is
>                        supposed
>                                             "automatically" inject my
>                 callback instance
>                        in the
>                                             messageInterpreterCallback
>                 member variable of
>                                             MessageInterpreterImpl. The
>                        MessageInterpreterImpl
>                               needs
>                                      to have
>                                             a reference to some callback
>                 instance.
>                                             I can;t seem to solve this
>                 problem.
> 
>                                          >From the stack trace it seems
>                 that the thread
>                        message
>                                      context doesn't
>                                         contain the callback endpoint.
>                  I'm not sure what
>                               could cause
>                                      this.
>                                         However I noticed a problem in
>                 your composite that
>                               would be worth
>                                         fixing, and it's just possible
>                 that this might be
>                               related to the
>                                         problem that you're seeing.
> 
>                                         The problem is that you have
>                 specified a
>                        callback URI
>                               for the
>                                         MessageInterpreter service in
>                               MessageInterpreterComponent, as
>                                      follows:
> 
>                                          <service name="MessageInterpreter">
>                                            <interface.java
>                               interface="org.acme.logix.MessageInterpreter"
>                                                                    
>                 callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>                                            <binding.ws
>                 <http://binding.ws> <http://binding.ws>
>                        <http://binding.ws> <http://binding.ws>
>                               <http://binding.ws>
> 
> 
>                                                            
>                  uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                                            <callback>
>                                              <binding.ws
>                 <http://binding.ws> <http://binding.ws>
>                        <http://binding.ws>
>                               <http://binding.ws> <http://binding.ws>
>                                                      
>                 uri="http://localhost:8084/Client/MessageInterpreterCallback"/>
>                                            </callback>
>                                          </service>
> 
>                                         There shouldn't be any callback
>                 URI in the service
>                                      definition, because
>                                         this information is provided at
>                 runtime by the
>                        client
>                                      invocation.  So
>                                         you should change the above to:
> 
>                                          <service name="MessageInterpreter">
>                                            <interface.java
>                               interface="org.acme.logix.MessageInterpreter"
>                                                                    
>                 callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>                                            <binding.ws
>                 <http://binding.ws> <http://binding.ws>
>                        <http://binding.ws> <http://binding.ws>
>                               <http://binding.ws>
> 
> 
>                                                            
>                  uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                                            <callback>
>                                              <binding.ws/
>                 <http://binding.ws/> <http://binding.ws/>
>                        <http://binding.ws/>
>                               <http://binding.ws/> <http://binding.ws/>>
> 
> 
>                                            </callback>
>                                          </service>
> 
>                                         If neither of these suggested
>                 changes fixes the
>                               problem, please
>                                         post the complete application as
>                 a zip file.
> 
>                                          Simon
> 
>                                             This is the error....
>                                            
>                 ---------------------------------------
>                                             SEVERE: Exception invoking
>                 injector - null
>                                            
>                 org.oasisopen.sca.ServiceRuntimeException:
>                               Exception invoking
>                                             injector - null
>                                             at
>                                                                
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                                             at
>                                                  
>                  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                                             at
>                                            
>                 com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                                             at
>                                            
>                 com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                                             at
>                                                  
>                  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                                             at
>                                            
>                 com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                                             at
>                              
>                 sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                                             at
>                                            
>                 com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                                             at
>                                                                
>                  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                                             at
>                                            
>                 com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                                             at
>                                                  
>                  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                                             at
>                                                                
>                  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                                             at
>                                                                
>                  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                                             at
>                 java.lang.Thread.run(Thread.java:662)
>                                             Caused by:
>                                                          
>                 org.apache.tuscany.sca.core.factory.ObjectCreationException:
>                                             Exception invoking injector
>                 - null
>                                             at
>                                                                
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>                                             ... 27 more
>                                             Caused by:
>                 java.lang.NullPointerException
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>                                             ... 28 more
>                                             10-jan-2011 1:39:26
>                                                                
>                  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>                                             processRequest
>                                             SEVERE: The server sent HTTP
>                 status code
>                        500: Internal
>                                      Server Error
>                                                          
>                 com.sun.xml.internal.ws.client.ClientTransportException: The
>                                             server sent HTTP status code
>                 500: Internal
>                        Server
>                               Error
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>                                             at
>                                                  
>                  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                                             at
>                                            
>                 com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                                             at
>                                            
>                 com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                                             at
>                                                  
>                  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                                             at
>                              
>                 com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>                                             at
>                 $Proxy50.interpret(Unknown Source)
>                                             at
>                                                                
>                  org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>                                             at
>                        sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>                                      Method)
>                                             at
>                                                                
>                  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>                                             at
>                                                                
>                  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>                                             at
>                        java.lang.reflect.Method.invoke(Method.java:597)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                                             at
>                                                  
>                  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                                             at
>                                            
>                 com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                                             at
>                                            
>                 com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                                             at
>                                                  
>                  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                                             at
>                                            
>                 com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                                             at
>                              
>                 sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                                             at
>                                            
>                 com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                                             at
>                                                                
>                  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                                             at
>                                            
>                 com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                                             at
>                                                  
>                  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                                             at
>                                                                
>                  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                                             at
>                                                                
>                  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                                             at
>                 java.lang.Thread.run(Thread.java:662)
>                                            
>                 -----------------------------------------
>                                              Hope you can help me. (?)
> 
>                                             Kind Regards
>                                             Urso
> 
>                                             2011/1/9 Simon Nash
>                 <nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>                               <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>>
>                                      <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>>
>                               <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>
>                                      <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>>>
>                                             <mailto:nash@apache.org
>                 <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>                 <mailto:nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>>
>                               <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>>
>                                      <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>
>                               <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>>>>>
> 
> 
> 
>                                                Urso Wieske wrote:
> 
>                                                    Hi
>                                                    I am evaluating
>                 Tuscany 2.0 Beta1 and am
>                               trying to
>                                      learn more
>                                                    about Callbacks
>                 (Bi-Directional
>                        interface)
>                               of SCA
>                                      1.1. I
>                                                    downloaded the
>                 Tuscany Sample files and
>                               started to
>                                             explore the
>                                                    callback
>                 implementations with webservice
>                               binding,
>                                      i.e. the
>                                                    Search and
>                 SearchCallback interfaces.
>                                                    It took me a while
>                 before I realized
>                        that the
>                                      Tuscany SCA
>                                                    Samples were based on
>                 SCA v1.0.          Tuscany
>                               2.0 Beta1 is
>                                             based on
>                                                    the SCA v1.1 specs.
>                                                    After studying the
>                 sample sources, I
>                        have
>                               written
>                                      my own
>                                             callback.
> 
>                                                    Unfortunately, I kept
>                 on getting a
>                        runtime
>                                      exception after I
>                                                    installed and deployed my
>                        contribution. By the
>                                      way, I am
>                                             using
>                                                    Eclipse and the maven
>                 tuscany plugin.
> 
>                                                    I can't find the
>                 problem and hope if
>                               someone can
>                                      point me
>                                             in the
>                                                    right direction.
> 
>                                                    This is the error
>                 (printed on my
>                        console) I am
>                                      getting when I
>                                                    try to run my program:
>                                                    [ERROR] Failed to
>                 execute goal
>                                                                        
>                      
>                  org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>                                                    (default-cli) on
>                 project handler-agent:
>                               Execution
>                                             default-cli of
>                                                    goal
>                                                                        
>                      
>                  org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>                                                    failed:
>                               org.oasisopen.sca.ServiceRuntimeException:
>                                             [Composite:
>                                                                
>                  {http://docs.oasis-open.org/ns/opencsa/sca/200912},
>                                             Component:
>                                                  
>                  MessageInterpreterComponent] -
>                        [ASM60033] No
>                                      targets for
>                                                    reference: Composite =
>                                                                
>                  {http://docs.oasis-open.org/ns/opencsa/sca/200912}
>                                             Reference =
>                                                  
>                  messageInterpreterCallback -> [Help 1]
> 
>                                                    I suspect that I am
>                 doing something
>                        wrong
>                               in the
>                                             composite file.
>                                                    I can't imagine I did
>                 something wrong in
>                               the java
>                                             sources. (See
>                                                    below for the sources.)
> 
>                                                Because the
>                 MessageInterpreterImpl class
>                        doesn't
>                                      contain any
>                                                @Reference or
>                                                @Property annotations,
>                 SCA creates implicit
>                               references for
>                                             all public
>                                                setter methods in this
>                 class whose type is a
>                               remotable SCA
>                                                interface, and
>                                                also for all public or
>                 protected fields
>                        in this
>                               class
>                                      whose
>                                             type is a
>                                                remotable SCA interface.
> 
>                                                There is a public setter
>                 method
>                                            
>                 setMessageInterpreterCallback() and a
>                                                protected field
>                        messageInterpreterCallback, so SCA
>                                      defines a
>                                             reference
>                                                named
>                 messageInterpreterCallback.  This
>                               reference doesn't
>                                             have a target
>                                                configured in the
>                 composite, hence the error
>                               message.
> 
>                                                To fix the problem, you
>                 need to remove
>                        the setter
>                                      method (or
>                                             make it
>                                                protected) and change the
>                 field from
>                        protected
>                               to private.
> 
>                                                 Simon
> 
> 
>                                                    Kind Regards,
> 
>                                                    Urso
> 
> 
>                                                    --------------------
>                 THE SERVICE
>                        Interface With
>                                      Callback
>                                                    Interface association
>                 ----------
>                                                    /**
>                                                     *  */
>                                                    package org.acme.logix;
> 
>                                                    import
>                 org.acme.logix.message.Message;
>                                                    import
>                        org.oasisopen.sca.annotation.Callback;
>                                                    import
>                        org.oasisopen.sca.annotation.OneWay;
>                                                    import
>                        org.oasisopen.sca.annotation.Remotable;
> 
>                                                    /**
>                                                     *  *
>                                                     */
>                                                    @Remotable
>                                                          
>                 @Callback(MessageInterpreterCallback.class)
>                                                    public interface
>                 MessageInterpreter {
> 
>                                                    @OneWay
>                                                    void
>                 interpret(Message msg);
>                                                    }
> 
> 
>                                                    /**
>                                                     *  */
>                                                    package org.acme.logix;
> 
>                                                    import
>                        org.oasisopen.sca.annotation.OneWay;
>                                                    import
>                        org.oasisopen.sca.annotation.Remotable;
> 
>                                                    /**
>                                                     *  *
>                                                     */
>                                                    @Remotable
>                                                    public interface
>                        MessageInterpreterCallback {
>                                                    void
>                 onInterpret(Interpretation ipr);
>                                                    }
> 
> 
>                                                    ---------- THE CLIENT
>                 implementing
>                        the callback
>                                      interface
>                                                    ------------
> 
>                                                    /**
>                                                     *  */
>                                                    package org.acme.logix;
> 
>                                                    import
>                 org.acme.logix.message.Message;
>                                                    import
>                        org.oasisopen.sca.annotation.Reference;
> 
>                                                    /**
>                                                     *  */
>                                                    public class
>                 LogisticCenterImpl
>                        implements
>                                      LogisticCenter,
>                                                  
>                  MessageInterpreterCallback {
>                                                    private AuditService
>                 auditService;
>                                                    @Reference
>                                                    protected
>                 MessageInterpreter
>                               messageInterpreter;
> 
>                                                    /* (non-Javadoc)
>                                                    * @see
>                                                                        
>                      
>                  org.acme.logix.LogisticCenter#processMessage(org.acme.logix.message.Message)
>                                                    */
>                                                    public void
>                 processMessage(Message
>                        message) {
>                                                  
>                  System.out.println("Processing
>                        message with
>                                      payload " +
>                                                    message.getPayload() );
>                                                  
>                  auditService.logSentMessage(message);
>                                                  
>                  messageInterpreter.interpret(message);
>                                                    }
> 
>                                                    /**
>                                                    * @return the
>                 auditService
>                                                    */
>                                                    public AuditService
>                 getAuditService() {
>                                                    return auditService;
>                                                    }
> 
>                                                    /**
>                                                    * @param auditService the
>                        auditService to set
>                                                    */
>                                                    @Reference
>                                                    public void
>                 setAuditService(AuditService
>                                      auditService) {
>                                                    this.auditService =
>                 auditService;
>                                                    }
> 
>                                                    /**
>                                                    * @param
>                 messageInterpreter the
>                               messageInterpreter
>                                      to set
>                                                    */
>                                                    public void
>                               setMessageInterpreter(MessageInterpreter
>                                                    messageInterpreter) {
>                                                    this.messageInterpreter =
>                        messageInterpreter;
>                                                    }
> 
>                                                    /**
>                                                    * @return the
>                 messageInterpreter
>                                                    */
>                                                    public MessageInterpreter
>                               getMessageInterpreter() {
>                                                    return
>                 messageInterpreter;
>                                                    }
> 
> 
>                                                           /**
>                                                           *  THE
>                 CALLBACK method of
>                                      MessageInterpreterCallback
>                                                    interface
>                                                           */
>                                                    public void
>                        onInterpret(Interpretation ipr) {
>                                                  
>                  System.out.println("Message has been
>                               interpreted.");
>                                                    }
> 
>                                                    }
> 
> 
>                                                    ---------THE SERVICE
>                 WHICH IS CALLED
>                        BY THE
>                               CLIENT
>                                      THROUGH
>                                                    WEBSERVICE BINDING
>                 ---------
> 
>                                                    /**
>                                                     *  */
>                                                    package org.acme.logix;
> 
>                                                    import
>                 org.acme.logix.message.Message;
>                                                    import
>                 org.oasisopen.sca.RequestContext;
>                                                    import
>                        org.oasisopen.sca.ServiceReference;
>                                                    import
>                        org.oasisopen.sca.annotation.Callback;
>                                                    import
>                        org.oasisopen.sca.annotation.Context;
>                                                    import
>                        org.oasisopen.sca.annotation.Reference;
>                                                    import
>                        org.oasisopen.sca.annotation.Service;
> 
>                                                    /**
>                                                     *  *
>                                                     */
>                                                    public class
>                 MessageInterpreterImpl
>                        implements
>                                             MessageInterpreter{
> 
>                                                    @Callback
>                                                    protected
>                 MessageInterpreterCallback
>                                             messageInterpreterCallback;
>                                                    /* (non-Javadoc)
>                                                    * @see
>                                                                        
>                      
>                  org.acme.logix.MessageInterpreter#interpret(org.acme.logix.message.Message)
>                                                    */
>                                                    public void
>                 interpret(Message msg) {
>                                                  
>                  System.out.println("The message is being
>                                      interpreted..");
>                                                    Interpretation ipr = new
>                        Interpretation();
>                                                          
>                 messageInterpreterCallback.onInterpret(ipr);
>                                                    }
> 
> 
> 
>                                                    /**
>                                                    * @return the
>                 messageInterpreterCallback
>                                                    */
>                                                    public
>                 MessageInterpreterCallback
>                                            
>                 getMessageInterpreterCallback() {
>                                                    return
>                 messageInterpreterCallback;
>                                                    }
> 
> 
> 
>                                                    /**
>                                                    * @param
>                 messageInterpreterCallback the
>                                                  
>                  messageInterpreterCallback to set
>                                                    */
>                                                    public void
>                        setMessageInterpreterCallback(
>                                                  
>                  MessageInterpreterCallback
>                                      messageInterpreterCallback) {
>                                                  
>                  this.messageInterpreterCallback =
>                                      messageInterpreterCallback;
>                                                    }
>                                                    }
> 
> 
> 
> 
> 
>                                                    ---- THE COMPOSITE
>                 -----------
> 
> 
> 
>                                                    <composite
>                                                          
>                 xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
>                                                                    
>                 targetNamespace="http://logistix"
>                                                                    
>                 xmlns:logistix="http://logistix"
>                                                            
>                  name="AfnemerLogisticCenter">
> 
>                                                       <component
>                               name="AfnemerHandlingAgentComponent">
>                                                    <implementation.java
>                                            
>                 class="org.acme.logix.HandlingAgentImpl"/>
>                                                             <reference
>                        name="logisticCenter" >
>                                                            <binding.ws
>                 <http://binding.ws>
>                        <http://binding.ws> <http://binding.ws>
>                               <http://binding.ws>
>                                      <http://binding.ws>
>                                             <http://binding.ws>
>                 <http://binding.ws>
> 
>                                                                        
>                      
>                  uri="http://127.0.0.1:8087/AfnemerHandlingAgentComponent"/>
>                                                             </reference>
>                         <reference
>                                      name="auditService"
>                                                  
>                  target="AuditServiceComponent"/>                      
>                                </component>
> 
> 
> 
>                                                       <component
>                               name="AfnemerLogisticCenterComponent">
>                                                          
>                 <implementation.java
>                                                          
>                 class="org.acme.logix.LogisticCenterImpl"/>
>                                                           <reference
>                        name="messageInterpreter">
>                                                    <interface.java
>                                                  
>                  interface="org.acme.logix.MessageInterpreter"          
>                                                                        
>                                          
>                 callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
> 
>                                                    <binding.ws
>                 <http://binding.ws> <http://binding.ws>
>                        <http://binding.ws>
>                               <http://binding.ws>
>                                      <http://binding.ws> <http://binding.ws>
>                                             <http://binding.ws>
> 
>                                                                        
>                      
>                  uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                                                    <callback >
>                                                    <binding.ws
>                 <http://binding.ws> <http://binding.ws>
>                        <http://binding.ws>
>                               <http://binding.ws>
>                                      <http://binding.ws> <http://binding.ws>
>                                             <http://binding.ws>
> 
>                                                                        
>                 uri="http://localhost:8084/Client/MessageInterpreterCallback
>                                                                        
>                 <http://localhost:8081/Client/MessageInterpreterCallback>"
>                 />
> 
>                                                    </callback>
>                                                    </reference>
>                                                           <reference
>                        name="auditService">                            
>                                             <binding.jms
>                                                                        
>                      
>                  initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>                                                  
>                  jndiURL="tcp://localhost:61616">
>                                                      <destination
>                        jndiName="AuditServiceQueue" />
>                                                      </binding.jms>    
>                     </reference>
>                                                            </component>
>                                                           <component
>                               name="MessageInterpreterComponent">
>                                                        <implementation.java
>                                                          
>                 class="org.acme.logix.MessageInterpreterImpl"/>
>                                                            <service
>                        name="MessageInterpreter">
>                                                    <interface.java
>                                    
>                  interface="org.acme.logix.MessageInterpreter"
>                                                                        
>                                          
>                  callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>                                                    <binding.ws
>                 <http://binding.ws> <http://binding.ws>
>                        <http://binding.ws>
>                               <http://binding.ws>
>                                      <http://binding.ws> <http://binding.ws>
>                                             <http://binding.ws>
> 
>                                                                        
>                        
>                 uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                                                    <callback>
>                                                    <binding.ws
>                 <http://binding.ws> <http://binding.ws>
>                        <http://binding.ws>
>                               <http://binding.ws>
>                                      <http://binding.ws> <http://binding.ws>
>                                             <http://binding.ws>
> 
>                                                                        
>                 uri="http://localhost:8084/Client/MessageInterpreterCallback
>                                                                        
>                 <http://localhost:8081/Client/MessageInterpreterCallback>"/>
> 
>                                                    </callback>
>                                                    </service>
>                                                       </component>
> 
> 
>                                                       <component
>                        name="AuditServiceComponent">
>                                                          
>                 <implementation.java
>                                                          
>                 class="org.acme.logix.AuditServiceImpl"/>
>                                                                   <service
>                        name="AuditService">
>                                                               <binding.jms
>                                                                        
>                      
>                  initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>                                                  
>                  jndiURL="tcp://localhost:61616">
>                                                      <destination
>                        jndiName="AuditServiceQueue" />
>                                                    </binding.jms>      
>                   </service>
>                                                       </component>
>                                                       </composite>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 


Re: Callback and Tuscany 2.0 Samples

Posted by Urso Wieske <uw...@gmail.com>.
Please do.
It saves a lot of pain and time trying to make it work. (Well, it won't
really work).

Kind Regards
Urso

2011/2/22 ant elder <an...@apache.org>

> We've not done anything about this yet so unless anyone says otherwise
> i'm going to move the jaxws versions of the WS binding out to contrib.
>
> I still think it would be good to have the version that works with
> just Java and no other dependencies but until we have that working
> more completely or someone working on it then it seems better to not
> be confusing users like this.
>
>   ...ant
>
> ---------- Forwarded message ----------
> From: Urso Wieske <uw...@gmail.com>
> Date: Mon, Jan 17, 2011 at 7:20 PM
> Subject: Re: Callback and Tuscany 2.0 Samples
> To: user@tuscany.apache.org, antelder@apache.org
>
>
> Hi Ant,
> Well, I suggest to remove JAXWS RI. Some SCA characteristics such as
> Callback through binding.ws are not working properly.
> I use the maven tuscany plugin in Eclipse to build my projects. (Ease
> of use and development)
> Kind Regards
> Urso
>
> 2011/1/17 ant elder <an...@gmail.com>
> >
> > You should be able to use the Axis2 based WS binding with the Tuscany
> > plugin instead of the JAXWS RI based one by adding the dependencies as
> > follows:
> >
> >         <plugin>
> >             <groupId>org.apache.tuscany.maven.plugins</groupId>
> >             <artifactId>maven-tuscany-plugin</artifactId>
> >             <version>2.0-SNAPSHOT</version>
> >             <dependencies>
> >                <dependency>
> >                   <groupId>org.apache.tuscany.sca</groupId>
> >
> <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
> >                   <version>2.0-SNAPSHOT</version>
> >                </dependency>
> >                <dependency>
> >                   <groupId>org.mortbay.jetty</groupId>
> >                   <artifactId>jetty</artifactId>
> >                   <version>6.1.19</version>
> >                </dependency>
> >             </dependencies>
> >         </plugin>
> >
> > We need to decide if we want to keep maintaining the JAXWS RI based WS
> > binding or drop it and just use the Axis2 based one, its not getting
> > updated much these days so is getting out of date, i guess thats a
> > discussion for the dev list.
> >
> > It would be interesting to hear a bit more about how you use the
> > Tuscany plugin, you say you use it in Eclipse, could you tell us a bit
> > more about what you do?
> >
> >   ...ant
>

Fwd: Callback and Tuscany 2.0 Samples

Posted by ant elder <an...@apache.org>.
We've not done anything about this yet so unless anyone says otherwise
i'm going to move the jaxws versions of the WS binding out to contrib.

I still think it would be good to have the version that works with
just Java and no other dependencies but until we have that working
more completely or someone working on it then it seems better to not
be confusing users like this.

   ...ant

---------- Forwarded message ----------
From: Urso Wieske <uw...@gmail.com>
Date: Mon, Jan 17, 2011 at 7:20 PM
Subject: Re: Callback and Tuscany 2.0 Samples
To: user@tuscany.apache.org, antelder@apache.org


Hi Ant,
Well, I suggest to remove JAXWS RI. Some SCA characteristics such as
Callback through binding.ws are not working properly.
I use the maven tuscany plugin in Eclipse to build my projects. (Ease
of use and development)
Kind Regards
Urso

2011/1/17 ant elder <an...@gmail.com>
>
> You should be able to use the Axis2 based WS binding with the Tuscany
> plugin instead of the JAXWS RI based one by adding the dependencies as
> follows:
>
>         <plugin>
>             <groupId>org.apache.tuscany.maven.plugins</groupId>
>             <artifactId>maven-tuscany-plugin</artifactId>
>             <version>2.0-SNAPSHOT</version>
>             <dependencies>
>                <dependency>
>                   <groupId>org.apache.tuscany.sca</groupId>
>                   <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>                   <version>2.0-SNAPSHOT</version>
>                </dependency>
>                <dependency>
>                   <groupId>org.mortbay.jetty</groupId>
>                   <artifactId>jetty</artifactId>
>                   <version>6.1.19</version>
>                </dependency>
>             </dependencies>
>         </plugin>
>
> We need to decide if we want to keep maintaining the JAXWS RI based WS
> binding or drop it and just use the Axis2 based one, its not getting
> updated much these days so is getting out of date, i guess thats a
> discussion for the dev list.
>
> It would be interesting to hear a bit more about how you use the
> Tuscany plugin, you say you use it in Eclipse, could you tell us a bit
> more about what you do?
>
>   ...ant

Re: Callback and Tuscany 2.0 Samples

Posted by Urso Wieske <uw...@gmail.com>.
Hi Ant,

Well, I suggest to remove JAXWS RI. Some SCA characteristics such as
Callback through binding.ws are not working properly.

I use the maven tuscany plugin in Eclipse to build my projects. (Ease of use
and development)

Kind Regards
Urso

2011/1/17 ant elder <an...@gmail.com>

> You should be able to use the Axis2 based WS binding with the Tuscany
> plugin instead of the JAXWS RI based one by adding the dependencies as
> follows:
>
>         <plugin>
>             <groupId>org.apache.tuscany.maven.plugins</groupId>
>             <artifactId>maven-tuscany-plugin</artifactId>
>              <version>2.0-SNAPSHOT</version>
>              <dependencies>
>                <dependency>
>                   <groupId>org.apache.tuscany.sca</groupId>
>
> <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>                    <version>2.0-SNAPSHOT</version>
>                </dependency>
>                <dependency>
>                   <groupId>org.mortbay.jetty</groupId>
>                   <artifactId>jetty</artifactId>
>                   <version>6.1.19</version>
>                </dependency>
>             </dependencies>
>         </plugin>
>
> We need to decide if we want to keep maintaining the JAXWS RI based WS
> binding or drop it and just use the Axis2 based one, its not getting
> updated much these days so is getting out of date, i guess thats a
> discussion for the dev list.
>
> It would be interesting to hear a bit more about how you use the
> Tuscany plugin, you say you use it in Eclipse, could you tell us a bit
> more about what you do?
>
>   ...ant
>

Re: Callback and Tuscany 2.0 Samples

Posted by Simon Nash <na...@apache.org>.
ant elder wrote:
> Might you have multiple versions of the Tuscany artifacts being used?
> I don't have 2.0-Beta1 artifacts so just used 2.0-SNAPSHOT to try it,
> but if your pom.xml now has dependencies using both versions that
> might be confusing things.
> 
All the Tuscany dependencies in my pom are on 2.0-Beta1.

   Simon

>    ...ant
> 
> On Mon, Jan 17, 2011 at 11:50 AM, Simon Nash <na...@apache.org> wrote:
>> ant elder wrote:
>>> You should be able to use the Axis2 based WS binding with the Tuscany
>>> plugin instead of the JAXWS RI based one by adding the dependencies as
>>> follows:
>>>
>>>         <plugin>
>>>             <groupId>org.apache.tuscany.maven.plugins</groupId>
>>>             <artifactId>maven-tuscany-plugin</artifactId>
>>>             <version>2.0-SNAPSHOT</version>
>>>             <dependencies>
>>>                <dependency>
>>>                   <groupId>org.apache.tuscany.sca</groupId>
>>>
>>> <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>>>                   <version>2.0-SNAPSHOT</version>
>>>                </dependency>
>>>                <dependency>
>>>                   <groupId>org.mortbay.jetty</groupId>
>>>                   <artifactId>jetty</artifactId>
>>>                   <version>6.1.19</version>
>>>                </dependency>
>>>             </dependencies>
>>>         </plugin>
>>>
>>> We need to decide if we want to keep maintaining the JAXWS RI based WS
>>> binding or drop it and just use the Axis2 based one, its not getting
>>> updated much these days so is getting out of date, i guess thats a
>>> discussion for the dev list.
>>>
>>> It would be interesting to hear a bit more about how you use the
>>> Tuscany plugin, you say you use it in Eclipse, could you tell us a bit
>>> more about what you do?
>>>
>>>   ...ant
>>>
>>>
>> I tried this (using mvn tuscany:run from the command line) and I get
>> the stack trace shown below.
>>
>> I assume that the messages about duplicate bindings and intents can
>> be ignored.  I'm not sure if I should be concerned about the
>> PrivilegedActionException.  The NoSuchMethodError is a showstopper.
>>
>> Any ideas what could cause this?
>>
>>  Simon
>>
>> [INFO] [tuscany:run]
>> [INFO] Starting Tuscany Runtime...
>> [INFO] Project contribution:
>> file:/F:/urso/handler-agent/target/afnemer-handling
>> -agent-contribution.jar
>> 17-Jan-2011 11:46:31 org.apache.tuscany.sca.node.impl.NodeImpl start
>> INFO: Starting node: http://tuscany.apache.org/sca/1.1/nodes/default0
>> domain: de
>> fault
>> 17-Jan-2011 11:46:51 com.hazelcast.system
>> INFO: [default] Hazelcast 1.8.3 (20100407) starting at
>> Address[192.168.0.11:1482
>> 0]
>> 17-Jan-2011 11:46:51 com.hazelcast.system
>> INFO: [default] Copyright (C) 2008-2010 Hazelcast.com
>> 17-Jan-2011 11:46:53 com.hazelcast.impl.Node
>> INFO: [default]
>>
>>
>> Members [1] {
>>        Member [192.168.0.11:14820] this
>> }
>>
>> 17-Jan-2011 11:46:53 org.apache.tuscany.sca.node.impl.NodeFactoryImpl
>> loadContri
>> butions
>> INFO: Loading contribution:
>> file:/F:/urso/handler-agent/target/afnemer-handling-
>> agent-contribution.jar
>> 17-Jan-2011 11:46:53
>> org.apache.tuscany.sca.contribution.processor.DefaultValida
>> tingXMLInputFactory [] (PrivilegedActionException)
>> WARNING: PrivilegedActionException occured due to : {0}
>> 17-Jan-2011 11:46:54 org.apache.tuscany.sca.definitions.impl.DefinitionsImpl
>> [Ex
>> tension points definitions] (DuplicateIntent)
>> SEVERE: [ASM10001,POL30002] Duplicate intent
>> {http://tuscany.apache.org/xmlns/sc
>> a/1.1}MTOM found in domain
>> 17-Jan-2011 11:46:54 org.apache.tuscany.sca.definitions.impl.DefinitionsImpl
>> [Ex
>> tension points definitions] (DuplicateBindingType)
>> SEVERE: [POL40020] Duplicate binding type
>> {http://docs.oasis-open.org/ns/opencsa
>> /sca/200912}binding.ws found in domain
>> [INFO]
>> ------------------------------------------------------------------------
>> [ERROR] FATAL ERROR
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] java.lang.NoSuchMethodError:
>> org.apache.tuscany.sca.definitions.Definitio
>> ns.getExternalAttachments()Ljava/util/List;
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Trace
>> java.lang.IllegalStateException: java.lang.NoSuchMethodError:
>> org.apache.tuscany
>> .sca.definitions.Definitions.getExternalAttachments()Ljava/util/List;
>>        at org.apache.tuscany.sca.node.impl.NodeImpl.start(NodeImpl.java:172)
>>        at
>> org.apache.tuscany.maven.plugin.TuscanyRunMojo.execute(TuscanyRunMojo
>> .java:105)
>>        at
>> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
>> nManager.java:453)
>>        at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
>> ultLifecycleExecutor.java:559)
>>        at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone
>> Goal(DefaultLifecycleExecutor.java:513)
>>        at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
>> ltLifecycleExecutor.java:483)
>>        at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
>> dleFailures(DefaultLifecycleExecutor.java:331)
>>        at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
>> ts(DefaultLifecycleExecutor.java:292)
>>        at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
>> fecycleExecutor.java:142)
>>        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>>        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>>        at org.apache.maven.cli.MavenCli.main(MavenCli.java:301)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
>> java:39)
>>        at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>> sorImpl.java:25)
>>        at java.lang.reflect.Method.invoke(Method.java:597)
>>        at
>> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>>        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>>        at
>> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>>
>>        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>> Caused by: java.lang.NoSuchMethodError:
>> org.apache.tuscany.sca.definitions.Defin
>> itions.getExternalAttachments()Ljava/util/List;
>>        at
>> org.apache.tuscany.sca.builder.impl.PolicyAttachmentBuilderImpl.apply
>> XPath(PolicyAttachmentBuilderImpl.java:132)
>>        at
>> org.apache.tuscany.sca.builder.impl.PolicyAttachmentBuilderImpl.build
>> (PolicyAttachmentBuilderImpl.java:94)
>>        at
>> org.apache.tuscany.sca.builder.impl.ModelBuilderImpl.build(ModelBuild
>> erImpl.java:108)
>>        at
>> org.apache.tuscany.sca.assembly.builder.DefaultBuilderExtensionPoint$
>> LazyCompositeBuilder.build(DefaultBuilderExtensionPoint.java:256)
>>        at
>> org.apache.tuscany.sca.deployment.impl.DeployerImpl.build(DeployerImp
>> l.java:547)
>>        at
>> org.apache.tuscany.sca.node.impl.NodeFactoryImpl.configureNode(NodeFa
>> ctoryImpl.java:318)
>>        at org.apache.tuscany.sca.node.impl.NodeImpl.start(NodeImpl.java:127)
>>        ... 19 more
>>
>>
> 
> 


Re: Callback and Tuscany 2.0 Samples

Posted by ant elder <an...@gmail.com>.
Might you have multiple versions of the Tuscany artifacts being used?
I don't have 2.0-Beta1 artifacts so just used 2.0-SNAPSHOT to try it,
but if your pom.xml now has dependencies using both versions that
might be confusing things.

   ...ant

On Mon, Jan 17, 2011 at 11:50 AM, Simon Nash <na...@apache.org> wrote:
> ant elder wrote:
>>
>> You should be able to use the Axis2 based WS binding with the Tuscany
>> plugin instead of the JAXWS RI based one by adding the dependencies as
>> follows:
>>
>>         <plugin>
>>             <groupId>org.apache.tuscany.maven.plugins</groupId>
>>             <artifactId>maven-tuscany-plugin</artifactId>
>>             <version>2.0-SNAPSHOT</version>
>>             <dependencies>
>>                <dependency>
>>                   <groupId>org.apache.tuscany.sca</groupId>
>>
>> <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>>                   <version>2.0-SNAPSHOT</version>
>>                </dependency>
>>                <dependency>
>>                   <groupId>org.mortbay.jetty</groupId>
>>                   <artifactId>jetty</artifactId>
>>                   <version>6.1.19</version>
>>                </dependency>
>>             </dependencies>
>>         </plugin>
>>
>> We need to decide if we want to keep maintaining the JAXWS RI based WS
>> binding or drop it and just use the Axis2 based one, its not getting
>> updated much these days so is getting out of date, i guess thats a
>> discussion for the dev list.
>>
>> It would be interesting to hear a bit more about how you use the
>> Tuscany plugin, you say you use it in Eclipse, could you tell us a bit
>> more about what you do?
>>
>>   ...ant
>>
>>
> I tried this (using mvn tuscany:run from the command line) and I get
> the stack trace shown below.
>
> I assume that the messages about duplicate bindings and intents can
> be ignored.  I'm not sure if I should be concerned about the
> PrivilegedActionException.  The NoSuchMethodError is a showstopper.
>
> Any ideas what could cause this?
>
>  Simon
>
> [INFO] [tuscany:run]
> [INFO] Starting Tuscany Runtime...
> [INFO] Project contribution:
> file:/F:/urso/handler-agent/target/afnemer-handling
> -agent-contribution.jar
> 17-Jan-2011 11:46:31 org.apache.tuscany.sca.node.impl.NodeImpl start
> INFO: Starting node: http://tuscany.apache.org/sca/1.1/nodes/default0
> domain: de
> fault
> 17-Jan-2011 11:46:51 com.hazelcast.system
> INFO: [default] Hazelcast 1.8.3 (20100407) starting at
> Address[192.168.0.11:1482
> 0]
> 17-Jan-2011 11:46:51 com.hazelcast.system
> INFO: [default] Copyright (C) 2008-2010 Hazelcast.com
> 17-Jan-2011 11:46:53 com.hazelcast.impl.Node
> INFO: [default]
>
>
> Members [1] {
>        Member [192.168.0.11:14820] this
> }
>
> 17-Jan-2011 11:46:53 org.apache.tuscany.sca.node.impl.NodeFactoryImpl
> loadContri
> butions
> INFO: Loading contribution:
> file:/F:/urso/handler-agent/target/afnemer-handling-
> agent-contribution.jar
> 17-Jan-2011 11:46:53
> org.apache.tuscany.sca.contribution.processor.DefaultValida
> tingXMLInputFactory [] (PrivilegedActionException)
> WARNING: PrivilegedActionException occured due to : {0}
> 17-Jan-2011 11:46:54 org.apache.tuscany.sca.definitions.impl.DefinitionsImpl
> [Ex
> tension points definitions] (DuplicateIntent)
> SEVERE: [ASM10001,POL30002] Duplicate intent
> {http://tuscany.apache.org/xmlns/sc
> a/1.1}MTOM found in domain
> 17-Jan-2011 11:46:54 org.apache.tuscany.sca.definitions.impl.DefinitionsImpl
> [Ex
> tension points definitions] (DuplicateBindingType)
> SEVERE: [POL40020] Duplicate binding type
> {http://docs.oasis-open.org/ns/opencsa
> /sca/200912}binding.ws found in domain
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] java.lang.NoSuchMethodError:
> org.apache.tuscany.sca.definitions.Definitio
> ns.getExternalAttachments()Ljava/util/List;
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.IllegalStateException: java.lang.NoSuchMethodError:
> org.apache.tuscany
> .sca.definitions.Definitions.getExternalAttachments()Ljava/util/List;
>        at org.apache.tuscany.sca.node.impl.NodeImpl.start(NodeImpl.java:172)
>        at
> org.apache.tuscany.maven.plugin.TuscanyRunMojo.execute(TuscanyRunMojo
> .java:105)
>        at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
> nManager.java:453)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:559)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone
> Goal(DefaultLifecycleExecutor.java:513)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
> ltLifecycleExecutor.java:483)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
> dleFailures(DefaultLifecycleExecutor.java:331)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
> ts(DefaultLifecycleExecutor.java:292)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
> fecycleExecutor.java:142)
>        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>        at org.apache.maven.cli.MavenCli.main(MavenCli.java:301)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at
> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>        at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>
>        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: java.lang.NoSuchMethodError:
> org.apache.tuscany.sca.definitions.Defin
> itions.getExternalAttachments()Ljava/util/List;
>        at
> org.apache.tuscany.sca.builder.impl.PolicyAttachmentBuilderImpl.apply
> XPath(PolicyAttachmentBuilderImpl.java:132)
>        at
> org.apache.tuscany.sca.builder.impl.PolicyAttachmentBuilderImpl.build
> (PolicyAttachmentBuilderImpl.java:94)
>        at
> org.apache.tuscany.sca.builder.impl.ModelBuilderImpl.build(ModelBuild
> erImpl.java:108)
>        at
> org.apache.tuscany.sca.assembly.builder.DefaultBuilderExtensionPoint$
> LazyCompositeBuilder.build(DefaultBuilderExtensionPoint.java:256)
>        at
> org.apache.tuscany.sca.deployment.impl.DeployerImpl.build(DeployerImp
> l.java:547)
>        at
> org.apache.tuscany.sca.node.impl.NodeFactoryImpl.configureNode(NodeFa
> ctoryImpl.java:318)
>        at org.apache.tuscany.sca.node.impl.NodeImpl.start(NodeImpl.java:127)
>        ... 19 more
>
>

Re: Callback and Tuscany 2.0 Samples

Posted by Simon Nash <na...@apache.org>.
ant elder wrote:
> You should be able to use the Axis2 based WS binding with the Tuscany
> plugin instead of the JAXWS RI based one by adding the dependencies as
> follows:
> 
>          <plugin>
>              <groupId>org.apache.tuscany.maven.plugins</groupId>
>              <artifactId>maven-tuscany-plugin</artifactId>
>              <version>2.0-SNAPSHOT</version>
>              <dependencies>
>                 <dependency>
>                    <groupId>org.apache.tuscany.sca</groupId>
>                    <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>                    <version>2.0-SNAPSHOT</version>
>                 </dependency>
>                 <dependency>
>                    <groupId>org.mortbay.jetty</groupId>
>                    <artifactId>jetty</artifactId>
>                    <version>6.1.19</version>
>                 </dependency>
>              </dependencies>
>          </plugin>
> 
> We need to decide if we want to keep maintaining the JAXWS RI based WS
> binding or drop it and just use the Axis2 based one, its not getting
> updated much these days so is getting out of date, i guess thats a
> discussion for the dev list.
> 
> It would be interesting to hear a bit more about how you use the
> Tuscany plugin, you say you use it in Eclipse, could you tell us a bit
> more about what you do?
> 
>    ...ant
> 
> 
I tried this (using mvn tuscany:run from the command line) and I get
the stack trace shown below.

I assume that the messages about duplicate bindings and intents can
be ignored.  I'm not sure if I should be concerned about the
PrivilegedActionException.  The NoSuchMethodError is a showstopper.

Any ideas what could cause this?

   Simon

[INFO] [tuscany:run]
[INFO] Starting Tuscany Runtime...
[INFO] Project contribution: file:/F:/urso/handler-agent/target/afnemer-handling
-agent-contribution.jar
17-Jan-2011 11:46:31 org.apache.tuscany.sca.node.impl.NodeImpl start
INFO: Starting node: http://tuscany.apache.org/sca/1.1/nodes/default0 domain: de
fault
17-Jan-2011 11:46:51 com.hazelcast.system
INFO: [default] Hazelcast 1.8.3 (20100407) starting at Address[192.168.0.11:1482
0]
17-Jan-2011 11:46:51 com.hazelcast.system
INFO: [default] Copyright (C) 2008-2010 Hazelcast.com
17-Jan-2011 11:46:53 com.hazelcast.impl.Node
INFO: [default]


Members [1] {
         Member [192.168.0.11:14820] this
}

17-Jan-2011 11:46:53 org.apache.tuscany.sca.node.impl.NodeFactoryImpl loadContri
butions
INFO: Loading contribution: file:/F:/urso/handler-agent/target/afnemer-handling-
agent-contribution.jar
17-Jan-2011 11:46:53 org.apache.tuscany.sca.contribution.processor.DefaultValida
tingXMLInputFactory [] (PrivilegedActionException)
WARNING: PrivilegedActionException occured due to : {0}
17-Jan-2011 11:46:54 org.apache.tuscany.sca.definitions.impl.DefinitionsImpl [Ex
tension points definitions] (DuplicateIntent)
SEVERE: [ASM10001,POL30002] Duplicate intent {http://tuscany.apache.org/xmlns/sc
a/1.1}MTOM found in domain
17-Jan-2011 11:46:54 org.apache.tuscany.sca.definitions.impl.DefinitionsImpl [Ex
tension points definitions] (DuplicateBindingType)
SEVERE: [POL40020] Duplicate binding type {http://docs.oasis-open.org/ns/opencsa
/sca/200912}binding.ws found in domain
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] java.lang.NoSuchMethodError: org.apache.tuscany.sca.definitions.Definitio
ns.getExternalAttachments()Ljava/util/List;
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.IllegalStateException: java.lang.NoSuchMethodError: org.apache.tuscany
.sca.definitions.Definitions.getExternalAttachments()Ljava/util/List;
         at org.apache.tuscany.sca.node.impl.NodeImpl.start(NodeImpl.java:172)
         at org.apache.tuscany.maven.plugin.TuscanyRunMojo.execute(TuscanyRunMojo
.java:105)
         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:453)
         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:559)
         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone
Goal(DefaultLifecycleExecutor.java:513)
         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:483)
         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:331)
         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:292)
         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:142)
         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
         at org.apache.maven.cli.MavenCli.main(MavenCli.java:301)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: java.lang.NoSuchMethodError: org.apache.tuscany.sca.definitions.Defin
itions.getExternalAttachments()Ljava/util/List;
         at org.apache.tuscany.sca.builder.impl.PolicyAttachmentBuilderImpl.apply
XPath(PolicyAttachmentBuilderImpl.java:132)
         at org.apache.tuscany.sca.builder.impl.PolicyAttachmentBuilderImpl.build
(PolicyAttachmentBuilderImpl.java:94)
         at org.apache.tuscany.sca.builder.impl.ModelBuilderImpl.build(ModelBuild
erImpl.java:108)
         at org.apache.tuscany.sca.assembly.builder.DefaultBuilderExtensionPoint$
LazyCompositeBuilder.build(DefaultBuilderExtensionPoint.java:256)
         at org.apache.tuscany.sca.deployment.impl.DeployerImpl.build(DeployerImp
l.java:547)
         at org.apache.tuscany.sca.node.impl.NodeFactoryImpl.configureNode(NodeFa
ctoryImpl.java:318)
         at org.apache.tuscany.sca.node.impl.NodeImpl.start(NodeImpl.java:127)
         ... 19 more


Re: Callback and Tuscany 2.0 Samples

Posted by ant elder <an...@gmail.com>.
You should be able to use the Axis2 based WS binding with the Tuscany
plugin instead of the JAXWS RI based one by adding the dependencies as
follows:

         <plugin>
             <groupId>org.apache.tuscany.maven.plugins</groupId>
             <artifactId>maven-tuscany-plugin</artifactId>
             <version>2.0-SNAPSHOT</version>
             <dependencies>
                <dependency>
                   <groupId>org.apache.tuscany.sca</groupId>
                   <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
                   <version>2.0-SNAPSHOT</version>
                </dependency>
                <dependency>
                   <groupId>org.mortbay.jetty</groupId>
                   <artifactId>jetty</artifactId>
                   <version>6.1.19</version>
                </dependency>
             </dependencies>
         </plugin>

We need to decide if we want to keep maintaining the JAXWS RI based WS
binding or drop it and just use the Axis2 based one, its not getting
updated much these days so is getting out of date, i guess thats a
discussion for the dev list.

It would be interesting to hear a bit more about how you use the
Tuscany plugin, you say you use it in Eclipse, could you tell us a bit
more about what you do?

   ...ant

Re: Callback and Tuscany 2.0 Samples

Posted by Urso Wieske <uw...@gmail.com>.
Hi Simon,

No need to spend much more time on the subject.
Thanks for dedicating your time so far.

Kind regards,
Urso 

Sent from my iPhone

On 16 jan. 2011, at 22:09, Simon Nash <na...@apache.org> wrote:

> Urso Wieske wrote:
>> Simon,
>> Checkout my POM.
>> I had also to remove two dependencies you suggested me to add originally.
>> I kept my base-runtime dependency by the way.
>> 
> Hi Urso,
> I tried this pom but I get an error when running the maven Junit test
> and a different error when running maven-tuscany-plugin.
> 
> As you have got a setup now that's working for you, I don't think
> there's any need for me to debug this further.
> 
>  Simon
> 
>> -------------------- START ---------------
>> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
>> <modelVersion>4.0.0</modelVersion>
>> <groupId>org.acme.logix</groupId>
>> <artifactId>handler-agent</artifactId>
>> <version>0.0.1-SNAPSHOT</version>
>> <packaging>jar</packaging>
>> <parent>
>>       <groupId>org.apache.tuscany.sca</groupId>
>>       <artifactId>tuscany-sca</artifactId>
>>       <version>2.0-Beta1</version>
>>    </parent>
>> <name>handler-agent</name>
>> <url>http://maven.apache.org</url>
>> <properties>
>> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>> </properties>
>>   <repositories>
>>       <repository>
>>           <id>apache.staging</id>
>>           <url>https://repository.apache.org/content/groups/staging</url>
>>       </repository>
>>   </repositories>
>> <build>
>> <finalName>afnemer-handling-agent-contribution</finalName>
>> <plugins>
>> <plugin>
>> <groupId>org.apache.tuscany.maven.plugins</groupId>
>> <artifactId>maven-tuscany-plugin</artifactId>
>> <version>2.0-Beta1</version>
>> <dependencies>
>> <dependency>
>> <groupId>org.apache.tuscany.sca</groupId>
>> <artifactId>tuscany-binding-jms-runtime</artifactId>
>> <version>2.0-Beta1</version>
>> </dependency>
>> <!-- These two dependencies below are added in the context of the m2 plugin. -->
>> <dependency>
>>   <groupId>org.apache.tuscany.sca</groupId>
>>    <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>>    <version>2.0-Beta1</version>
>> </dependency>
>> <dependency>
>>    <groupId>org.apache.tuscany.sca</groupId>
>>    <artifactId>tuscany-host-jetty</artifactId>
>>    <version>2.0-Beta1</version>
>> </dependency>
>> <dependency>
>> <groupId>org.apache.activemq</groupId>
>> <artifactId>activemq-all</artifactId>
>> <version>5.3.0</version>
>> <scope>runtime</scope>
>> </dependency>
>> </dependencies>
>> </plugin>
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-compiler-plugin</artifactId>
>> <version>2.3.2</version>
>> <configuration>
>> <source>1.6</source>
>> <target>1.6</target>
>> </configuration>
>> </plugin>
>> </plugins>
>> </build>
>> <dependencies>
>> <dependency>
>> <groupId>org.apache.tuscany.sca</groupId>
>> <artifactId>tuscany-feature-api</artifactId>
>> <type>pom</type>
>> <version>2.0-Beta1</version>
>> </dependency>
>> <dependency>
>> <groupId>org.apache.tuscany.sca</groupId>
>> <artifactId>tuscany-base-runtime</artifactId>
>> <version>2.0-Beta1</version>
>> </dependency>
>> <!-- THESE Dependencies are introduced because of flaw
>> in the jaxws tuscany runtime implementation with respect to
>> callback injection. The base runtime depenedency s replaced
>> by the 4 dependencies below.  --> <dependency>
>>   <groupId>org.apache.tuscany.sca</groupId>
>>     <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>>     <version>2.0-Beta1</version>
>>  </dependency>
>> <dependency>
>>    <groupId>org.apache.tuscany.sca</groupId>
>>    <artifactId>tuscany-host-jetty</artifactId>
>>    <version>2.0-Beta1</version>
>> </dependency>
>> <!-- I Had to remove the two dependencies below, because of error at runtime. -->
>> <!--
>> <dependency>
>>    <groupId>org.apache.tuscany.sca</groupId>
>>    <artifactId>tuscany-node-impl</artifactId>
>>    <version>2.0-Beta1</version>
>> </dependency>
>> <dependency>
>>    <groupId>org.apache.tuscany.sca</groupId>
>>    <artifactId>tuscany-implementation-java-runtime</artifactId>
>>    <version>2.0-Beta1</version>
>> </dependency>
>> -->
>> <dependency>
>> <groupId>org.apache.tuscany.sca</groupId>
>> <artifactId>tuscany-binding-jms-runtime</artifactId>
>> <version>2.0-Beta1</version>
>> </dependency>
>> <dependency>
>> <groupId>org.apache.activemq</groupId>
>> <artifactId>activemq-all</artifactId>
>> <version>5.3.0</version>
>> <scope>runtime</scope>
>> </dependency>
>> <dependency>
>> <groupId>junit</groupId>
>> <artifactId>junit</artifactId>
>> <version>4.8.1</version>
>> <scope>test</scope>
>> </dependency>
>> </dependencies>
>> </project>
>> ------------------- END ------------------ Kind Regards
>> Urso
>> 2011/1/16 Simon Nash <nash@apache.org <ma...@apache.org>>
>>    Urso Wieske wrote:
>>        Simon,
>>        I added the dependencies AS PART OF the maven plugin dependency
>>        element. (Dependencies element enclosed  in the
>>        build/plugins/plugin element).
>>        Then it should work!
>>    Hi Urso,
>>    I've tried just about every possible combination of dependencies in the
>>    build/plugin element, and I get errors every time.  What combination are
>>    you using?
>>     Simon
>>        Kind regards,
>>        Urso
>>        2011/1/16 Urso Wieske <uwieske@gmail.com
>>        <ma...@gmail.com> <mailto:uwieske@gmail.com
>>        <ma...@gmail.com>>>
>>           Nope, I was mislead.  The maven plugin does not work. Only the
>>           Testclass is working.
>>           Kind regards
>>           Urso
>>           2011/1/16 Urso Wieske <uwieske@gmail.com
>>        <ma...@gmail.com> <mailto:uwieske@gmail.com
>>        <ma...@gmail.com>>>
>>               Hi Simon,
>>               I have been studying the source code around SCA
>>        binding.ws <http://binding.ws>
>>               <http://binding.ws> extension.
>>               As you mentioned earlier, the Tuscany SCA runtime  uses by
>>               default de reference implementation of JAX-WS binding.
>>               In the resource of binding-ws-runtime-jaxws-ri at the path
>>                      META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory:
>>                      org.apache.tuscany.sca.binding.ws.jaxws.ri.JAXWSBindingProviderFactory;model=org.apache.tuscany.sca.binding.ws.WebServiceBinding
>>               you can indeed see that the Factory
>>        JAXWSBindingProviderFactory
>>               is used as default.
>>               I believe -I have not digged into the code yet- that the
>>               reference implementation is overridden as soon as the SCA
>>               runtime finds an alternative binding.ws
>>        <http://binding.ws> <http://binding.ws>
>>               implementation on the classpath.         I check this by
>>        just adding the Axis2 extension to my dependency
>>               set and I the runtime appears switch automatically to Axis2.
>>               I manage to run my code with the maven plugin. I removed
>>                                 <dependency>
>>                   <groupId>org.apache.tuscany.sca</groupId>
>>                   <artifactId>tuscany-node-impl</artifactId>
>>                   <version>2.0-Beta1</version>
>>               </dependency>
>>               <dependency>
>>                   <groupId>org.apache.tuscany.sca</groupId>
>>                          <artifactId>tuscany-implementation-java-runtime</artifactId>
>>                   <version>2.0-Beta1</version>
>>               </dependency>
>>               from my dependencyset and ran my code succesfully.                I don't understand the "negative" effect of these two
>>               dependencies on my code.
>>               Maybe you have some clarification for this?
>>               Kind Regards,
>>               Urso
>>               2011/1/15 Simon Nash <nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>>
>>                   Urso Wieske wrote:
>>                       Hi Simon,
>>                       Could you send me a copy of your POM which you
>>        have used
>>                       /adapted?
>>                       Also which public repositories are you using to
>>        download
>>                       your Tuscany 2.0 Beta1 dependencies?
>>                       (I have initially googled for a oublic maven
>>        repository
>>                       where I could donwload the Tuscany v2 Beta1
>>        dependencies.)
>>                       I replaced my base runtime for the 4 dependencies you
>>                       have stated, but I get runtime exceptions due to
>>        other
>>                       causes. Most probably I should have other
>>        dependencies
>>                       too which you have not mentioned.
>>                       Kind regards.
>>                       Urso
>>                   Hi Urso,
>>                   My pom and JUnit test case are attached below.  The
>>                   repository URL
>>                   is included in the pom.
>>                    Simon
>>                   ----- begin pom -----
>>                   <project xmlns="http://maven.apache.org/POM/4.0.0"
>>                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>                                             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>>                   http://maven.apache.org/xsd/maven-4.0.0.xsd">
>>                      <modelVersion>4.0.0</modelVersion>
>>                      <parent>
>>                          <groupId>org.apache.tuscany.sca</groupId>
>>                          <artifactId>tuscany-sca</artifactId>
>>                          <version>2.0-Beta1</version>
>>                      </parent>
>>                      <groupId>org.acme.logix</groupId>
>>                      <artifactId>handler-agent</artifactId>
>>                      <version>0.0.1-SNAPSHOT</version>
>>                      <packaging>jar</packaging>
>>                      <name>handler-agent</name>
>>                      <url>http://maven.apache.org</url>
>>                      <properties>
>>                                            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>>                      </properties>
>>                      <repositories>
>>                          <repository>
>>                              <id>apache.staging</id>
>>                                                <url>https://repository.apache.org/content/groups/staging</url>
>>                          </repository>
>>                      </repositories>
>>                      <build>
>>                                            <finalName>afnemer-handling-agent-contribution</finalName>
>>                          <plugins>
>>                              <plugin>
>>                                                    <groupId>org.apache.tuscany.maven.plugins</groupId>
>>                                         <artifactId>maven-tuscany-plugin</artifactId>
>>                                  <version>2.0-Beta1</version>
>>                                  <dependencies>
>>                                      <dependency>
>>                                                 <groupId>org.apache.tuscany.sca</groupId>
>>                                                            <artifactId>tuscany-binding-jms-runtime</artifactId>
>>                                          <version>2.0-Beta1</version>
>>                                      </dependency>
>>                                      <dependency>
>>                                                 <groupId>org.apache.activemq</groupId>
>>                                                 <artifactId>activemq-all</artifactId>
>>                                          <version>5.3.0</version>
>>                                          <scope>runtime</scope>
>>                                      </dependency>
>>                                  </dependencies>
>>                              </plugin>
>>                              <plugin>
>>                                         <groupId>org.apache.maven.plugins</groupId>
>>                                         <artifactId>maven-compiler-plugin</artifactId>
>>                                  <version>2.3.2</version>
>>                                  <configuration>
>>                                      <source>1.6</source>
>>                                      <target>1.6</target>
>>                                  </configuration>
>>                              </plugin>
>>                          </plugins>
>>                      </build>
>>                      <dependencies>
>>                          <dependency>
>>                              <groupId>org.apache.tuscany.sca</groupId>
>>                              <artifactId>tuscany-feature-api</artifactId>
>>                              <type>pom</type>
>>                              <version>2.0-Beta1</version>
>>                          </dependency>
>>                          <dependency>
>>                              <groupId>org.apache.tuscany.sca</groupId>
>>                                     <artifactId>tuscany-binding-jms-runtime</artifactId>
>>                              <version>2.0-Beta1</version>
>>                          </dependency>
>>                          <dependency>
>>                              <groupId>org.apache.activemq</groupId>
>>                              <artifactId>activemq-all</artifactId>
>>                              <version>5.3.0</version>
>>                              <scope>runtime</scope>
>>                          </dependency>
>>                         <dependency>
>>                              <groupId>org.apache.tuscany.sca</groupId>
>>                                                <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>>                              <version>2.0-Beta1</version>
>>                         </dependency>
>>                          <dependency>
>>                              <groupId>org.apache.tuscany.sca</groupId>
>>                              <artifactId>tuscany-host-jetty</artifactId>
>>                              <version>2.0-Beta1</version>
>>                          </dependency>
>>                          <dependency>
>>                              <groupId>org.apache.tuscany.sca</groupId>
>>                              <artifactId>tuscany-node-impl</artifactId>
>>                              <version>2.0-Beta1</version>
>>                          </dependency>
>>                          <dependency>
>>                              <groupId>org.apache.tuscany.sca</groupId>
>>                                                <artifactId>tuscany-implementation-java-runtime</artifactId>
>>                              <version>2.0-Beta1</version>
>>                          </dependency>
>>                          <dependency>
>>                              <groupId>junit</groupId>
>>                              <artifactId>junit</artifactId>
>>                              <version>4.8.1</version>
>>                              <scope>test</scope>
>>                          </dependency>
>>                      </dependencies>
>>                   </project>
>>                   ----- begin test case -----
>>                   package acme;
>>                   import org.apache.activemq.broker.BrokerService;
>>                   import org.apache.tuscany.sca.node.Contribution;
>>                   import org.apache.tuscany.sca.node.Node;
>>                   import org.apache.tuscany.sca.node.NodeFactory;
>>                   import org.junit.Test;
>>                   public class CallbackTestCase {
>>                      @Test
>>                      public void testSayHello() throws Exception {
>>                          // Start the JMS broker
>>                          BrokerService jmsBroker = new BrokerService();
>>                          jmsBroker.setPersistent(false);
>>                          jmsBroker.setUseJmx(false);
>>                          jmsBroker.addConnector("tcp://localhost:61616");
>>                          jmsBroker.start();
>>                          // Start the Tuscany runtime with this module
>>        as the
>>                   contribution
>>                          System.out.println("starting Tuscany runtime");
>>                          Node node =
>>        NodeFactory.newInstance().createNode(new
>>                   Contribution("c1", "target/classes"));
>>                          System.out.println("Tuscany runtime started");
>>                          // Start the Tuscany node. This also runs the
>>                   @EagerInit test method.
>>                          node.start();
>>                          System.out.println("Tuscany node started");
>>                          // Stop the Tuscany runtime
>>                          node.stop();
>>                          // Stop the JMS broker
>>                          jmsBroker.stop();
>>                      }
>>                   }
>>                   ----- end test case -----
>>                    > 2011/1/15 Simon Nash <nash@apache.org
>>        <ma...@apache.org>
>>                   <mailto:nash@apache.org <ma...@apache.org>>
>>        <mailto:nash@apache.org <ma...@apache.org>
>>                   <mailto:nash@apache.org <ma...@apache.org>>>>
>>                          Urso Wieske wrote:
>>                              Hi Simon,
>>                              Thanks for the quick response.
>>                              That's a pitty that maven-tuscany-plugin
>>        is not
>>                       behaving
>>                              accordingly. It's a great instrument to use
>>                       within my IDE
>>                              (Eclipse). I'll submit an issue at the Tuscany
>>                       projectsite. I
>>                              will also dig into the "maven-tuscany-plugin"
>>                       problem to figure
>>                              out what is the cause of this deviation.
>>                          Hi Urso,
>>                          I agree.  It should be possible to use
>>                       maven-tuscany-plugin and
>>                          replace things in the base runtime by alternative
>>                       implementations.
>>                          Maybe there is a way to do this, but I
>>        couldn't find one.
>>                           Simon
>>                              Kind Regards
>>                              Urso
>>                              2011/1/15 Simon Nash <nash@apache.org
>>        <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>
>>        <mailto:nash@apache.org <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>>
>>                              <mailto:nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>>>
>>                                 Urso Wieske wrote:
>>                                     Hi Simon,
>>                                     I have uploaded my sources as a
>>        zipped file.
>>                                 Hi Urso,
>>                                 This problem is caused by a bug in Tuscany.
>>                        Please raise a JIRA
>>                                 so that we can track and fix the
>>        problem.  In
>>                       the meantime, I can
>>                                 suggest a partial workaround.
>>                                 The injection failure only happens if
>>        Tuscany
>>                       is using the
>>                                 tuscany-binding-ws-runtime-jaxws module
>>        as the
>>                       runtime
>>                              implementation
>>                                 for <binding.ws <http://binding.ws>
>>        <http://binding.ws>
>>                       <http://binding.ws> <http://binding.ws>>.  It
>>                              doesn't happen if
>>                                 tuscany-binding-ws-runtime-axis2
>>                                 is used instead of
>>                       tuscany-binding-ws-runtime-jaxws.  This
>>                              implies that
>>                                 the problem is caused by a bug in the
>>        -jaxws
>>                       version.
>>                                 By default, Tuscany uses the -jaxws
>>        version.
>>                        To get Tuscany
>>                              to use
>>                                 the -axis2 version instead, you need to
>>        do special
>>                              configuration in
>>                                 the pom.xml file.
>>                                 Unfortunately I couldn't find a way to make
>>                       this change when
>>                              using
>>                                 maven-tuscany-plugin to run the
>>        application.
>>                        This is because
>>                                 maven-tuscany-plugin has a dependency on
>>                       tuscany-base-runtime.
>>                                 The tuscany-base-runtime jar contains the
>>                       -jaxws version and
>>                              seems
>>                                 to always use it even if the -axis2
>>        version is
>>                       declared as an
>>                                 additional dependency.
>>                                 I did find a way to get Tuscany to use the
>>                       -axis2 version
>>                              when not
>>                                 using maven-tuscany-plugin.  If you replace
>>                       this dependency:
>>                                  <dependency>
>>                                             <groupId>org.apache.tuscany.sca</groupId>
>>                                             <artifactId>tuscany-base-runtime</artifactId>
>>                                      <version>2.0-Beta1</version>
>>                                  </dependency>
>>                                 by the following four dependencies:
>>                                  <dependency>
>>                                             <groupId>org.apache.tuscany.sca</groupId>
>>                                                            <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>>                                      <version>2.0-Beta1</version>
>>                                  </dependency>
>>                                  <dependency>
>>                                             <groupId>org.apache.tuscany.sca</groupId>
>>                                             <artifactId>tuscany-host-jetty</artifactId>
>>                                      <version>2.0-Beta1</version>
>>                                  </dependency>
>>                                  <dependency>
>>                                             <groupId>org.apache.tuscany.sca</groupId>
>>                                             <artifactId>tuscany-node-impl</artifactId>
>>                                      <version>2.0-Beta1</version>
>>                                  </dependency>
>>                                  <dependency>
>>                                             <groupId>org.apache.tuscany.sca</groupId>
>>                                                            <artifactId>tuscany-implementation-java-runtime</artifactId>
>>                                      <version>2.0-Beta1</version>
>>                                  </dependency>
>>                                 then the application runs successfully.  I
>>                       used a maven JUnit
>>                              test
>>                                 to verify this.
>>                                  Simon
>>                                     Hi Simon,
>>                                     I adapted my code as you suggested. It
>>                       seems like the
>>                              error has
>>                                     dissappeared, but I got new ones.
>>        Well I
>>                       removed the
>>                              setter and
>>                                     getter of
>>        messageInterpreterCallback from
>>                                     MessageInterpreterImpl. Now my
>>                       MessageInterpreterImpl class
>>                                     contains only the instance variable
>>                              messageInterpreterCallback .
>>                                     I have made it a protected variable.
>>                                     I get a HTTP Internal Server (
>>        error 500).
>>                                     I am still missing something.SCA
>>        runtime
>>                       is supposed
>>                                     "automatically" inject my callback
>>                       instance in the
>>                                     messageInterpreterCallback member
>>        variable of
>>                                     MessageInterpreterImpl. The
>>                       MessageInterpreterImpl needs
>>                              to have
>>                                     a reference to some callback instance.
>>                                     I can;t seem to solve this problem.
>>                                     This is the error....
>>                                     ---------------------------------------
>>                                     SEVERE: Exception invoking injector
>>        - null
>>                                            org.oasisopen.sca.ServiceRuntimeException:
>>                       Exception invoking
>>                                     injector - null
>>                                     at
>>                                                                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>>                                     at
>>                                                                  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>                                     at
>>                                                                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>                                     at
>>                                                                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>                                     at
>>                                                                  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>                                     at
>>                                                                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>                                     at
>>                                                                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>                                     at
>>                                                    com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>                                     at
>>                                                    com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>                                     at
>>                                                    com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>                                     at
>>                                                    com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>                                     at
>>                                                    com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                                     at
>>                              sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>                                     at
>>                                                    com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>                                     at
>>                                                                  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>                                     at
>>                                                    com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                                     at
>>                                                    sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>                                     at
>>                                                                  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>                                     at
>>                                                                  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>                                     at
>>        java.lang.Thread.run(Thread.java:662)
>>                                     Caused by:
>>                                                           org.apache.tuscany.sca.core.factory.ObjectCreationException:
>>                                     Exception invoking injector - null
>>                                     at
>>                                                                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>>                                     at
>>                                                                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>>                                     ... 27 more
>>                                     Caused by:
>>        java.lang.NullPointerException
>>                                     at
>>                                                                  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>>                                     at
>>                                                                  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>>                                     at
>>                                                                  org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>>                                     at
>>                                                                  org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>>                                     at
>>                                                                  org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>>                                     at
>>                                                                  org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>>                                     at
>>                                                                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>>                                     ... 28 more
>>                                     10-jan-2011 1:39:26
>>                                                                  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>>                                     processRequest
>>                                     SEVERE: The server sent HTTP status
>>        code
>>                       500: Internal
>>                              Server Error
>>                                                           com.sun.xml.internal.ws.client.ClientTransportException: The
>>                                     server sent HTTP status code 500:
>>        Internal
>>                       Server Error
>>                                     at
>>                                                                  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>>                                     at
>>                                                    com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>                                     at
>>                                                    com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>                                     at
>>                                                    com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>                                     at
>>                                                    com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>                                     at
>>                              com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>>                                     at
>>                                                                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>>                                     at
>>                                                                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>>                                     at
>>                                                                  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>                                     at
>>                                                                  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>>                                     at
>>                                                                  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>>                                     at
>>                                                                  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>>                                     at
>>                                                                  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>>                                     at
>>                                                                  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>>                                     at $Proxy50.interpret(Unknown Source)
>>                                     at
>>                                                                  org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>>                                     at
>>                       sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>                              Method)
>>                                     at
>>                                                                  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>                                     at
>>                                                                  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>                                     at
>>                       java.lang.reflect.Method.invoke(Method.java:597)
>>                                     at
>>                                                                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>>                                     at
>>                                                                  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>                                     at
>>                                                                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>                                     at
>>                                                                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>                                     at
>>                                                                  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>                                     at
>>                                                                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>                                     at
>>                                                                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>                                     at
>>                                                    com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>                                     at
>>                                                    com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>                                     at
>>                                                    com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>                                     at
>>                                                    com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>                                     at
>>                                                                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>                                     at
>>                                                    com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                                     at
>>                              sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>                                     at
>>                                                    com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>                                     at
>>                                                                  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>                                     at
>>                                                    com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                                     at
>>                                                    sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>                                     at
>>                                                                  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>                                     at
>>                                                                  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>                                     at
>>        java.lang.Thread.run(Thread.java:662)
>>                                            -----------------------------------------
>>                                      Hope you can help me. (?)
>>                                     Kind Regards
>>                                     Urso
>>                                     2011/1/14 Simon Nash
>>        <nash@apache.org <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>
>>                              <mailto:nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>
>>                              <mailto:nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>>>
>>                                     <mailto:nash@apache.org
>>        <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>
>>        <mailto:nash@apache.org <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>>
>>                              <mailto:nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>>>>
>>                                        Hi Urso,
>>                                        I'm starting to look at your project
>>                       code now.
>>                                        It's important to keep these
>>        threads on
>>                       the Tuscany
>>                              mailing list
>>                                        so that other members of the Tuscany
>>                       community are
>>                              included in
>>                                        the discussion.  The Tuscany mailing
>>                       list archives are an
>>                                     important
>>                                        resource for Tuscany users who are
>>                       experiencing a
>>                              problem and are
>>                                        looking to see if others have
>>        found a
>>                       solution.  If a
>>                              problem is
>>                                        solved by a private message exchange
>>                       instead of on the
>>                              public
>>                                     list,
>>                                        the knowledge of how to solve it is
>>                       confined to one person
>>                                     instead
>>                                        of being shared by the community.
>>                                        The best way to make this happen
>>        would
>>                       be for you to
>>                              resend your
>>                                        recent private emails to the public
>>                       list.  I'll look
>>                              out for them
>>                                        on the public list so that I can
>>                       respond to them there.
>>                                         Simon
>>                                        Urso Wieske wrote:
>>                                            Hi Simon,
>>                                            You'll find in this email the
>>                       zipped file
>>                              containing my
>>                                     sourcecode.
>>                                            Unfortunately, I still have
>>        errors.
>>                                            I changed the member
>>        variable from
>>                       protected to
>>                              private
>>                                     like you
>>                                            suggested.
>>                                            And created Getter and
>>        Setter for
>>                       this member
>>                              variable.
>>                                            (messageInterpreterCallback).
>>                                            I annotated the setter with
>>        @Callback.
>>                                            I also removed the URI attribute
>>                       from the
>>                                     callback/binding.ws
>>        <http://binding.ws> <http://binding.ws>
>>                       <http://binding.ws> <http://binding.ws>
>>                                            <http://binding.ws>
>>                       <http://binding.ws> element of the
>>                                     service
>>                                            according to your
>>        suggestion. Still
>>                       problems.... :-(
>>                                            I have zipped my source. It's an
>>                       Eclipse project.
>>                                            I appreciate the fact that
>>        you are
>>                       willing to
>>                              verify this
>>                                     issue.
>>                                            If you have any questions
>>        about the
>>                       code, just let
>>                              me know.
>>                                            Please checkout also if my
>>        POM is
>>                       well specified with
>>                                     regard to
>>                                            dependencies. Do I have the
>>        proper
>>                       dependencies. I
>>                              am using
>>                                            Tuscany 2.0 Beta1.
>>                                            Kind Regards
>>                                            Urso
>>                                            2011/1/10 Simon Nash
>>                       <nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>
>>                              <mailto:nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>>
>>                                     <mailto:nash@apache.org
>>        <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>
>>        <mailto:nash@apache.org <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>>>
>>                              <mailto:nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>
>>                                     <mailto:nash@apache.org
>>        <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>
>>        <mailto:nash@apache.org <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>>>>
>>                                            <mailto:nash@apache.org
>>        <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>
>>        <mailto:nash@apache.org <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>>
>>                              <mailto:nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>>
>>                                     <mailto:nash@apache.org
>>        <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>
>>        <mailto:nash@apache.org <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>>
>>                              <mailto:nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>>>>>
>>                                               Urso Wieske wrote:
>>                                                   Hi Simon,
>>                                                   I adapted my code as you
>>                       suggested. It
>>                              seems like the
>>                                            error has
>>                                                   dissappeared, but I
>>        got new
>>                       ones. Well I
>>                              removed the
>>                                            setter and
>>                                                   getter of
>>                       messageInterpreterCallback from
>>                                                          MessageInterpreterImpl. Now my
>>                                     MessageInterpreterImpl class
>>                                                   contains only the
>>        instance
>>                       variable
>>                                            messageInterpreterCallback .
>>                                                   I have made it a
>>        protected
>>                       variable.
>>                                               According to the SCA 1.1
>>        specs,
>>                       this variable
>>                              should
>>                                     be private
>>                                               in order to avoid having it
>>                       treated as a reference.
>>                                      Can you try
>>                                               changing this and see if it
>>                       makes any difference?
>>                                                   I get a HTTP Internal
>>        Server
>>                       ( error 500).
>>                                                   I am still missing
>>                       something.SCA runtime is
>>                              supposed
>>                                                   "automatically" inject my
>>                       callback instance
>>                              in the
>>                                                          messageInterpreterCallback
>>                       member variable of
>>                                                          MessageInterpreterImpl. The
>>                              MessageInterpreterImpl
>>                                     needs
>>                                            to have
>>                                                   a reference to some
>>        callback
>>                       instance.
>>                                                   I can;t seem to solve
>>        this
>>                       problem.
>>                                                >From the stack trace it
>>        seems
>>                       that the thread
>>                              message
>>                                            context doesn't
>>                                               contain the callback
>>        endpoint.
>>                        I'm not sure what
>>                                     could cause
>>                                            this.
>>                                               However I noticed a
>>        problem in
>>                       your composite that
>>                                     would be worth
>>                                               fixing, and it's just
>>        possible
>>                       that this might be
>>                                     related to the
>>                                               problem that you're seeing.
>>                                               The problem is that you have
>>                       specified a
>>                              callback URI
>>                                     for the
>>                                               MessageInterpreter service in
>>                                     MessageInterpreterComponent, as
>>                                            follows:
>>                                                <service
>>        name="MessageInterpreter">
>>                                                  <interface.java
>>                                            interface="org.acme.logix.MessageInterpreter"
>>                                                                                                        callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>                                                  <binding.ws
>>        <http://binding.ws>
>>                       <http://binding.ws> <http://binding.ws>
>>                              <http://binding.ws> <http://binding.ws>
>>                                     <http://binding.ws>
>>                                                                                                 uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>                                                  <callback>
>>                                                    <binding.ws
>>        <http://binding.ws>
>>                       <http://binding.ws> <http://binding.ws>
>>                              <http://binding.ws>
>>                                     <http://binding.ws> <http://binding.ws>
>>                                                                                   uri="http://localhost:8084/Client/MessageInterpreterCallback"/>
>>                                                  </callback>
>>                                                </service>
>>                                               There shouldn't be any
>>        callback
>>                       URI in the service
>>                                            definition, because
>>                                               this information is
>>        provided at
>>                       runtime by the
>>                              client
>>                                            invocation.  So
>>                                               you should change the
>>        above to:
>>                                                <service
>>        name="MessageInterpreter">
>>                                                  <interface.java
>>                                            interface="org.acme.logix.MessageInterpreter"
>>                                                                                                        callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>                                                  <binding.ws
>>        <http://binding.ws>
>>                       <http://binding.ws> <http://binding.ws>
>>                              <http://binding.ws> <http://binding.ws>
>>                                     <http://binding.ws>
>>                                                                                                 uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>                                                  <callback>
>>                                                    <binding.ws/
>>        <http://binding.ws/>
>>                       <http://binding.ws/> <http://binding.ws/>
>>                              <http://binding.ws/>
>>                                     <http://binding.ws/>
>>        <http://binding.ws/>>
>>                                                  </callback>
>>                                                </service>
>>                                               If neither of these suggested
>>                       changes fixes the
>>                                     problem, please
>>                                               post the complete
>>        application as
>>                       a zip file.
>>                                                Simon
>>                                                   This is the error....
>>                                                                         ---------------------------------------
>>                                                   SEVERE: Exception
>>        invoking
>>                       injector - null
>>                                                                         org.oasisopen.sca.ServiceRuntimeException:
>>                                     Exception invoking
>>                                                   injector - null
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>                                                   at
>>                                                                                com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>                                                   at
>>                                                                         com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>                                                   at
>>                                                                         com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>                                                   at
>>                                                                                com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>                                                   at
>>                                                                         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                                                   at
>>                                                           sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>                                                   at
>>                                                                         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>                                                   at
>>                                                                                                     sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>                                                   at
>>                                                                         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                                                   at
>>                                                                                sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>                                                   at
>>                                                                                                     java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>                                                   at
>>                                                                                                     java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>                                                   at
>>                       java.lang.Thread.run(Thread.java:662)
>>                                                   Caused by:
>>                                                                                       org.apache.tuscany.sca.core.factory.ObjectCreationException:
>>                                                   Exception invoking
>>        injector
>>                       - null
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>>                                                   ... 27 more
>>                                                   Caused by:
>>                       java.lang.NullPointerException
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>>                                                   ... 28 more
>>                                                   10-jan-2011 1:39:26
>>                                                                                                     com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>>                                                   processRequest
>>                                                   SEVERE: The server
>>        sent HTTP
>>                       status code
>>                              500: Internal
>>                                            Server Error
>>                                                                                       com.sun.xml.internal.ws.client.ClientTransportException: The
>>                                                   server sent HTTP
>>        status code
>>                       500: Internal
>>                              Server
>>                                     Error
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>>                                                   at
>>                                                                                com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>                                                   at
>>                                                                         com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>                                                   at
>>                                                                         com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>                                                   at
>>                                                                                com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>                                                   at
>>                                                           com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>>                                                   at
>>                       $Proxy50.interpret(Unknown Source)
>>                                                   at
>>                                                                                                     org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>>                                                   at
>>                                     sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>                                            Method)
>>                                                   at
>>                                                                                                     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>                                                   at
>>                                                                                                     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>                                                   at
>>                                     java.lang.reflect.Method.invoke(Method.java:597)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>                                                   at
>>                                                                                                     org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>                                                   at
>>                                                                                com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>                                                   at
>>                                                                         com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>                                                   at
>>                                                                         com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>                                                   at
>>                                                                                com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>                                                   at
>>                                                                                                     com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>                                                   at
>>                                                                         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                                                   at
>>                                                           sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>                                                   at
>>                                                                         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>                                                   at
>>                                                                                                     sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>                                                   at
>>                                                                         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                                                   at
>>                                                                                sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>                                                   at
>>                                                                                                     java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>                                                   at
>>                                                                                                     java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>                                                   at
>>                       java.lang.Thread.run(Thread.java:662)
>>                                                                         -----------------------------------------
>>                                                    Hope you can help
>>        me. (?)
>>                                                   Kind Regards
>>                                                   Urso
>>                                                   2011/1/9 Simon Nash
>>                       <nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>
>>                              <mailto:nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>>
>>                                     <mailto:nash@apache.org
>>        <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>
>>        <mailto:nash@apache.org <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>>>
>>                                            <mailto:nash@apache.org
>>        <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>
>>        <mailto:nash@apache.org <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>>
>>                              <mailto:nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>>>
>>                                     <mailto:nash@apache.org
>>        <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>
>>        <mailto:nash@apache.org <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>>
>>                              <mailto:nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>>
>>                                            <mailto:nash@apache.org
>>        <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>
>>        <mailto:nash@apache.org <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>>
>>                              <mailto:nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>>>>
>>                                                          <mailto:nash@apache.org <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>
>>                              <mailto:nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>
>>                              <mailto:nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>>>
>>                                     <mailto:nash@apache.org
>>        <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>
>>        <mailto:nash@apache.org <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>>
>>                              <mailto:nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>>>
>>                                            <mailto:nash@apache.org
>>        <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>
>>        <mailto:nash@apache.org <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>>
>>                              <mailto:nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>>
>>                                     <mailto:nash@apache.org
>>        <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>
>>        <mailto:nash@apache.org <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>>
>>                              <mailto:nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>>>>>>
>>                                                      Urso Wieske wrote:
>>                                                          Hi
>>                                                          I am evaluating
>>                       Tuscany 2.0 Beta1 and am
>>                                     trying to
>>                                            learn more
>>                                                          about Callbacks
>>                       (Bi-Directional
>>                              interface)
>>                                     of SCA
>>                                            1.1. I
>>                                                          downloaded the
>>                       Tuscany Sample files and
>>                                     started to
>>                                                   explore the
>>                                                          callback
>>                       implementations with webservice
>>                                     binding,
>>                                            i.e. the
>>                                                          Search and
>>                       SearchCallback interfaces.
>>                                                          It took me a while
>>                       before I realized
>>                              that the
>>                                            Tuscany SCA
>>                                                          Samples were
>>        based on
>>                       SCA v1.0.          Tuscany
>>                                     2.0 Beta1 is
>>                                                   based on
>>                                                          the SCA v1.1
>>        specs.
>>                                                          After studying the
>>                       sample sources, I
>>                              have
>>                                     written
>>                                            my own
>>                                                   callback.
>>                                                          Unfortunately,
>>        I kept
>>                       on getting a
>>                              runtime
>>                                            exception after I
>>                                                          installed and
>>        deployed my
>>                              contribution. By the
>>                                            way, I am
>>                                                   using
>>                                                          Eclipse and
>>        the maven
>>                       tuscany plugin.
>>                                                          I can't find the
>>                       problem and hope if
>>                                     someone can
>>                                            point me
>>                                                   in the
>>                                                          right direction.
>>                                                          This is the error
>>                       (printed on my
>>                              console) I am
>>                                            getting when I
>>                                                          try to run my
>>        program:
>>                                                          [ERROR] Failed to
>>                       execute goal
>>                                                                                                                                  org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>>                                                          (default-cli) on
>>                       project handler-agent:
>>                                     Execution
>>                                                   default-cli of
>>                                                          goal
>>                                                                                                                                  org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>>                                                          failed:
>>                                            org.oasisopen.sca.ServiceRuntimeException:
>>                                                   [Composite:
>>                                                                                              {http://docs.oasis-open.org/ns/opencsa/sca/200912},
>>                                                   Component:
>>                                                                                MessageInterpreterComponent] -
>>                              [ASM60033] No
>>                                            targets for
>>                                                          reference:
>>        Composite =
>>                                                                                              {http://docs.oasis-open.org/ns/opencsa/sca/200912}
>>                                                   Reference =
>>                                                                                messageInterpreterCallback -> [Help 1]
>>                                                          I suspect that
>>        I am
>>                       doing something
>>                              wrong
>>                                     in the
>>                                                   composite file.
>>                                                          I can't
>>        imagine I did
>>                       something wrong in
>>                                     the java
>>                                                   sources. (See
>>                                                          below for the
>>        sources.)
>>                                                      Because the
>>                       MessageInterpreterImpl class
>>                              doesn't
>>                                            contain any
>>                                                      @Reference or
>>                                                      @Property annotations,
>>                       SCA creates implicit
>>                                     references for
>>                                                   all public
>>                                                      setter methods in this
>>                       class whose type is a
>>                                     remotable SCA
>>                                                      interface, and
>>                                                      also for all public or
>>                       protected fields
>>                              in this
>>                                     class
>>                                            whose
>>                                                   type is a
>>                                                      remotable SCA
>>        interface.
>>                                                      There is a public
>>        setter
>>                       method
>>                                                                         setMessageInterpreterCallback() and a
>>                                                      protected field
>>                              messageInterpreterCallback, so SCA
>>                                            defines a
>>                                                   reference
>>                                                      named
>>                       messageInterpreterCallback.  This
>>                                     reference doesn't
>>                                                   have a target
>>                                                      configured in the
>>                       composite, hence the error
>>                                     message.
>>                                                      To fix the
>>        problem, you
>>                       need to remove
>>                              the setter
>>                                            method (or
>>                                                   make it
>>                                                      protected) and
>>        change the
>>                       field from
>>                              protected
>>                                     to private.
>>                                                       Simon
>>                                                          Kind Regards,
>>                                                          Urso
>>                                                                 --------------------
>>                       THE SERVICE
>>                              Interface With
>>                                            Callback
>>                                                          Interface
>>        association
>>                       ----------
>>                                                          /**
>>                                                           *  */
>>                                                          package
>>        org.acme.logix;
>>                                                          import
>>                       org.acme.logix.message.Message;
>>                                                          import
>>                              org.oasisopen.sca.annotation.Callback;
>>                                                          import
>>                              org.oasisopen.sca.annotation.OneWay;
>>                                                          import
>>                              org.oasisopen.sca.annotation.Remotable;
>>                                                          /**
>>                                                           *  *
>>                                                           */
>>                                                          @Remotable
>>                                                                                       @Callback(MessageInterpreterCallback.class)
>>                                                          public interface
>>                       MessageInterpreter {
>>                                                          @OneWay
>>                                                          void
>>                       interpret(Message msg);
>>                                                          }
>>                                                          /**
>>                                                           *  */
>>                                                          package
>>        org.acme.logix;
>>                                                          import
>>                              org.oasisopen.sca.annotation.OneWay;
>>                                                          import
>>                              org.oasisopen.sca.annotation.Remotable;
>>                                                          /**
>>                                                           *  *
>>                                                           */
>>                                                          @Remotable
>>                                                          public interface
>>                              MessageInterpreterCallback {
>>                                                          void
>>                       onInterpret(Interpretation ipr);
>>                                                          }
>>                                                          ---------- THE
>>        CLIENT
>>                       implementing
>>                              the callback
>>                                            interface
>>                                                          ------------
>>                                                          /**
>>                                                           *  */
>>                                                          package
>>        org.acme.logix;
>>                                                          import
>>                       org.acme.logix.message.Message;
>>                                                          import
>>                              org.oasisopen.sca.annotation.Reference;
>>                                                          /**
>>                                                           *  */
>>                                                          public class
>>                       LogisticCenterImpl
>>                              implements
>>                                            LogisticCenter,
>>                                                                                MessageInterpreterCallback {
>>                                                          private
>>        AuditService
>>                       auditService;
>>                                                          @Reference
>>                                                          protected
>>                       MessageInterpreter
>>                                     messageInterpreter;
>>                                                          /* (non-Javadoc)
>>                                                          * @see
>>                                                                                                                                  org.acme.logix.LogisticCenter#processMessage(org.acme.logix.message.Message)
>>                                                          */
>>                                                          public void
>>                       processMessage(Message
>>                              message) {
>>                                                                                System.out.println("Processing
>>                              message with
>>                                            payload " +
>>                                                                 message.getPayload() );
>>                                                                                auditService.logSentMessage(message);
>>                                                                                messageInterpreter.interpret(message);
>>                                                          }
>>                                                          /**
>>                                                          * @return the
>>                       auditService
>>                                                          */
>>                                                          public
>>        AuditService
>>                       getAuditService() {
>>                                                          return
>>        auditService;
>>                                                          }
>>                                                          /**
>>                                                          * @param
>>        auditService the
>>                              auditService to set
>>                                                          */
>>                                                          @Reference
>>                                                          public void
>>                       setAuditService(AuditService
>>                                            auditService) {
>>                                                                 this.auditService =
>>                       auditService;
>>                                                          }
>>                                                          /**
>>                                                          * @param
>>                       messageInterpreter the
>>                                     messageInterpreter
>>                                            to set
>>                                                          */
>>                                                          public void
>>                                            setMessageInterpreter(MessageInterpreter
>>                                                                 messageInterpreter) {
>>                                                                 this.messageInterpreter =
>>                              messageInterpreter;
>>                                                          }
>>                                                          /**
>>                                                          * @return the
>>                       messageInterpreter
>>                                                          */
>>                                                          public
>>        MessageInterpreter
>>                                     getMessageInterpreter() {
>>                                                          return
>>                       messageInterpreter;
>>                                                          }
>>                                                                 /**
>>                                                                 *  THE
>>                       CALLBACK method of
>>                                            MessageInterpreterCallback
>>                                                          interface
>>                                                                 */
>>                                                          public void
>>                              onInterpret(Interpretation ipr) {
>>                                                                                System.out.println("Message has been
>>                                     interpreted.");
>>                                                          }
>>                                                          }
>>                                                          ---------THE
>>        SERVICE
>>                       WHICH IS CALLED
>>                              BY THE
>>                                     CLIENT
>>                                            THROUGH
>>                                                          WEBSERVICE BINDING
>>                       ---------
>>                                                          /**
>>                                                           *  */
>>                                                          package
>>        org.acme.logix;
>>                                                          import
>>                       org.acme.logix.message.Message;
>>                                                          import
>>                       org.oasisopen.sca.RequestContext;
>>                                                          import
>>                              org.oasisopen.sca.ServiceReference;
>>                                                          import
>>                              org.oasisopen.sca.annotation.Callback;
>>                                                          import
>>                              org.oasisopen.sca.annotation.Context;
>>                                                          import
>>                              org.oasisopen.sca.annotation.Reference;
>>                                                          import
>>                              org.oasisopen.sca.annotation.Service;
>>                                                          /**
>>                                                           *  *
>>                                                           */
>>                                                          public class
>>                       MessageInterpreterImpl
>>                              implements
>>                                                   MessageInterpreter{
>>                                                          @Callback
>>                                                          protected
>>                       MessageInterpreterCallback
>>                                                          messageInterpreterCallback;
>>                                                          /* (non-Javadoc)
>>                                                          * @see
>>                                                                                                                                  org.acme.logix.MessageInterpreter#interpret(org.acme.logix.message.Message)
>>                                                          */
>>                                                          public void
>>                       interpret(Message msg) {
>>                                                                                System.out.println("The message is being
>>                                            interpreted..");
>>                                                          Interpretation
>>        ipr = new
>>                              Interpretation();
>>                                                                                       messageInterpreterCallback.onInterpret(ipr);
>>                                                          }
>>                                                          /**
>>                                                          * @return the
>>                       messageInterpreterCallback
>>                                                          */
>>                                                          public
>>                       MessageInterpreterCallback
>>                                                                         getMessageInterpreterCallback() {
>>                                                          return
>>                       messageInterpreterCallback;
>>                                                          }
>>                                                          /**
>>                                                          * @param
>>                       messageInterpreterCallback the
>>                                                                                messageInterpreterCallback to set
>>                                                          */
>>                                                          public void
>>                              setMessageInterpreterCallback(
>>                                                                                MessageInterpreterCallback
>>                                            messageInterpreterCallback) {
>>                                                                                this.messageInterpreterCallback =
>>                                            messageInterpreterCallback;
>>                                                          }
>>                                                          }
>>                                                          ---- THE COMPOSITE
>>                       -----------
>>                                                          <composite
>>                                                                                       xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
>>                                                                                                 targetNamespace="http://logistix"
>>                                                                                                 xmlns:logistix="http://logistix"
>>                                                                                          name="AfnemerLogisticCenter">
>>                                                             <component
>>                                     name="AfnemerHandlingAgentComponent">
>>                                                                 <implementation.java
>>                                                                         class="org.acme.logix.HandlingAgentImpl"/>
>>                                                                          <reference
>>                              name="logisticCenter" >
>>                                                                         <binding.ws <http://binding.ws>
>>                       <http://binding.ws>
>>                              <http://binding.ws> <http://binding.ws>
>>                                     <http://binding.ws>
>>                                            <http://binding.ws>
>>                                                   <http://binding.ws>
>>                       <http://binding.ws>
>>                                                                                                                                  uri="http://127.0.0.1:8087/AfnemerHandlingAgentComponent"/>
>>                                                                          </reference>
>>                               <reference
>>                                            name="auditService"
>>                                                                                target="AuditServiceComponent"/>                                                            </component>
>>                                                             <component
>>                                     name="AfnemerLogisticCenterComponent">
>>                                                                                       <implementation.java
>>                                                                                       class="org.acme.logix.LogisticCenterImpl"/>
>>                                                                 <reference
>>                              name="messageInterpreter">
>>                                                          <interface.java
>>                                                                                interface="org.acme.logix.MessageInterpreter"                                                                                                                                                               callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>                                                          <binding.ws
>>        <http://binding.ws>
>>                       <http://binding.ws> <http://binding.ws>
>>                              <http://binding.ws>
>>                                     <http://binding.ws>
>>                                            <http://binding.ws>
>>        <http://binding.ws>
>>                                                   <http://binding.ws>
>>                                                                                                                                  uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>                                                          <callback >
>>                                                          <binding.ws
>>        <http://binding.ws>
>>                       <http://binding.ws> <http://binding.ws>
>>                              <http://binding.ws>
>>                                     <http://binding.ws>
>>                                            <http://binding.ws>
>>        <http://binding.ws>
>>                                                   <http://binding.ws>
>>                                                                                                            uri="http://localhost:8084/Client/MessageInterpreterCallback
>>                                                                                                            <http://localhost:8081/Client/MessageInterpreterCallback>"
>>                       />
>>                                                          </callback>
>>                                                          </reference>
>>                                                                 <reference
>>                              name="auditService">                                                                               <binding.jms
>>                                                                                                                                  initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>>                                                                                jndiURL="tcp://localhost:61616">
>>                                                            <destination
>>                              jndiName="AuditServiceQueue" />
>>                                                                   </binding.jms>                        </reference>
>>                                                                         </component>
>>                                                                 <component
>>                                     name="MessageInterpreterComponent">
>>                                                                     <implementation.java
>>                                                                                       class="org.acme.logix.MessageInterpreterImpl"/>
>>                                                                  <service
>>                              name="MessageInterpreter">
>>                                                          <interface.java
>>                                                                  interface="org.acme.logix.MessageInterpreter"
>>                                                                                                                                                      callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>                                                          <binding.ws
>>        <http://binding.ws>
>>                       <http://binding.ws> <http://binding.ws>
>>                              <http://binding.ws>
>>                                     <http://binding.ws>
>>                                            <http://binding.ws>
>>        <http://binding.ws>
>>                                                   <http://binding.ws>
>>                                                                                                                                   uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>                                                          <callback>
>>                                                          <binding.ws
>>        <http://binding.ws>
>>                       <http://binding.ws> <http://binding.ws>
>>                              <http://binding.ws>
>>                                     <http://binding.ws>
>>                                            <http://binding.ws>
>>        <http://binding.ws>
>>                                                   <http://binding.ws>
>>                                                                                                            uri="http://localhost:8084/Client/MessageInterpreterCallback
>>                                                                                                            <http://localhost:8081/Client/MessageInterpreterCallback>"/>
>>                                                          </callback>
>>                                                          </service>
>>                                                             </component>
>>                                                             <component
>>                              name="AuditServiceComponent">
>>                                                                                       <implementation.java
>>                                                                                       class="org.acme.logix.AuditServiceImpl"/>
>>                                                                                <service
>>                              name="AuditService">
>>                                                                            <binding.jms
>>                                                                                                                                  initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>>                                                                                jndiURL="tcp://localhost:61616">
>>                                                            <destination
>>                              jndiName="AuditServiceQueue" />
>>                                                          </binding.jms>
>>                               </service>
>>                                                             </component>
>>                                                             </composite>
> 

Re: Callback and Tuscany 2.0 Samples

Posted by Simon Nash <na...@apache.org>.
Urso Wieske wrote:
> Simon,
> 
> Checkout my POM.
> 
> I had also to remove two dependencies you suggested me to add originally.
> I kept my base-runtime dependency by the way.
>
Hi Urso,
I tried this pom but I get an error when running the maven Junit test
and a different error when running maven-tuscany-plugin.

As you have got a setup now that's working for you, I don't think
there's any need for me to debug this further.

   Simon

> -------------------- START ---------------
> <project xmlns="http://maven.apache.org/POM/4.0.0" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
> <modelVersion>4.0.0</modelVersion>
> 
> <groupId>org.acme.logix</groupId>
> <artifactId>handler-agent</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> <packaging>jar</packaging>
> <parent>
> 
>        <groupId>org.apache.tuscany.sca</groupId>
>        <artifactId>tuscany-sca</artifactId>
> 
>        <version>2.0-Beta1</version>
>     </parent>
> <name>handler-agent</name>
> <url>http://maven.apache.org</url>
> 
> <properties>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> </properties>
> 
> 
>    <repositories>
>        <repository>
>            <id>apache.staging</id>
>            <url>https://repository.apache.org/content/groups/staging</url>
>        </repository>
>    </repositories>
> 
> 
> <build>
> <finalName>afnemer-handling-agent-contribution</finalName>
> <plugins>
>  
> <plugin>
> <groupId>org.apache.tuscany.maven.plugins</groupId>
> <artifactId>maven-tuscany-plugin</artifactId>
> <version>2.0-Beta1</version>
> <dependencies>
> <dependency>
> <groupId>org.apache.tuscany.sca</groupId>
> <artifactId>tuscany-binding-jms-runtime</artifactId>
> <version>2.0-Beta1</version>
> </dependency>
> <!-- These two dependencies below are added in the context of the m2 
> plugin. -->
> <dependency>
>    <groupId>org.apache.tuscany.sca</groupId>
>     <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>     <version>2.0-Beta1</version>
> </dependency>
> <dependency>
>     <groupId>org.apache.tuscany.sca</groupId>
>     <artifactId>tuscany-host-jetty</artifactId>
>     <version>2.0-Beta1</version>
> </dependency>
> 
> <dependency>
> <groupId>org.apache.activemq</groupId>
> <artifactId>activemq-all</artifactId>
> <version>5.3.0</version>
> <scope>runtime</scope>
> </dependency>
> </dependencies>
> </plugin>
>  
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-compiler-plugin</artifactId>
> <version>2.3.2</version>
> <configuration>
> <source>1.6</source>
> <target>1.6</target>
> </configuration>
> </plugin>
> </plugins>
> </build>
> <dependencies>
> <dependency>
> <groupId>org.apache.tuscany.sca</groupId>
> <artifactId>tuscany-feature-api</artifactId>
> <type>pom</type>
> <version>2.0-Beta1</version>
> </dependency>
>  
> <dependency>
> <groupId>org.apache.tuscany.sca</groupId>
> <artifactId>tuscany-base-runtime</artifactId>
> <version>2.0-Beta1</version>
> </dependency>
> <!-- THESE Dependencies are introduced because of flaw
> in the jaxws tuscany runtime implementation with respect to
> callback injection. The base runtime depenedency s replaced
> by the 4 dependencies below. 
>  
> --> 
> <dependency>
>    <groupId>org.apache.tuscany.sca</groupId>
>      <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>      <version>2.0-Beta1</version>
>   </dependency>
> 
> <dependency>
>     <groupId>org.apache.tuscany.sca</groupId>
>     <artifactId>tuscany-host-jetty</artifactId>
>     <version>2.0-Beta1</version>
> </dependency>
>  
> <!-- I Had to remove the two dependencies below, because of error at 
> runtime. -->
> <!--
> <dependency>
>     <groupId>org.apache.tuscany.sca</groupId>
>     <artifactId>tuscany-node-impl</artifactId>
>     <version>2.0-Beta1</version>
> </dependency>
> <dependency>
>     <groupId>org.apache.tuscany.sca</groupId>
>     <artifactId>tuscany-implementation-java-runtime</artifactId>
>     <version>2.0-Beta1</version>
> </dependency>
> -->
>  
> <dependency>
> <groupId>org.apache.tuscany.sca</groupId>
> <artifactId>tuscany-binding-jms-runtime</artifactId>
> <version>2.0-Beta1</version>
> </dependency>
> 
> <dependency>
> <groupId>org.apache.activemq</groupId>
> <artifactId>activemq-all</artifactId>
> <version>5.3.0</version>
> <scope>runtime</scope>
> </dependency>
> 
> <dependency>
> <groupId>junit</groupId>
> <artifactId>junit</artifactId>
> <version>4.8.1</version>
> <scope>test</scope>
> </dependency>
> </dependencies>
> </project>
> 
> ------------------- END ------------------ 
> 
> Kind Regards
> Urso
> 
> 2011/1/16 Simon Nash <nash@apache.org <ma...@apache.org>>
> 
>     Urso Wieske wrote:
> 
>         Simon,
> 
>         I added the dependencies AS PART OF the maven plugin dependency
>         element. (Dependencies element enclosed  in the
>         build/plugins/plugin element).
>         Then it should work!
> 
>     Hi Urso,
>     I've tried just about every possible combination of dependencies in the
>     build/plugin element, and I get errors every time.  What combination are
>     you using?
> 
>      Simon
> 
> 
>         Kind regards,
>         Urso
> 
>         2011/1/16 Urso Wieske <uwieske@gmail.com
>         <ma...@gmail.com> <mailto:uwieske@gmail.com
>         <ma...@gmail.com>>>
> 
>            Nope, I was mislead.  The maven plugin does not work. Only the
>            Testclass is working.
> 
>            Kind regards
>            Urso
> 
>            2011/1/16 Urso Wieske <uwieske@gmail.com
>         <ma...@gmail.com> <mailto:uwieske@gmail.com
>         <ma...@gmail.com>>>
> 
>                Hi Simon,
> 
>                I have been studying the source code around SCA
>         binding.ws <http://binding.ws>
>                <http://binding.ws> extension.
>                As you mentioned earlier, the Tuscany SCA runtime  uses by
>                default de reference implementation of JAX-WS binding.
>                In the resource of binding-ws-runtime-jaxws-ri at the path
>              
>          META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory:
> 
>              
>          org.apache.tuscany.sca.binding.ws.jaxws.ri.JAXWSBindingProviderFactory;model=org.apache.tuscany.sca.binding.ws.WebServiceBinding
> 
>                you can indeed see that the Factory
>         JAXWSBindingProviderFactory
>                is used as default.
> 
>                I believe -I have not digged into the code yet- that the
>                reference implementation is overridden as soon as the SCA
>                runtime finds an alternative binding.ws
>         <http://binding.ws> <http://binding.ws>
>                implementation on the classpath.         I check this by
>         just adding the Axis2 extension to my dependency
>                set and I the runtime appears switch automatically to Axis2.
> 
>                I manage to run my code with the maven plugin. I removed
>                                  <dependency>
>                    <groupId>org.apache.tuscany.sca</groupId>
>                    <artifactId>tuscany-node-impl</artifactId>
>                    <version>2.0-Beta1</version>
>                </dependency>
>                <dependency>
>                    <groupId>org.apache.tuscany.sca</groupId>
>                  
>          <artifactId>tuscany-implementation-java-runtime</artifactId>
>                    <version>2.0-Beta1</version>
>                </dependency>
> 
>                from my dependencyset and ran my code succesfully.      
>           I don't understand the "negative" effect of these two
>                dependencies on my code.
> 
>                Maybe you have some clarification for this?
> 
> 
>                Kind Regards,
>                Urso
>                2011/1/15 Simon Nash <nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>>
> 
>                    Urso Wieske wrote:
> 
>                        Hi Simon,
> 
>                        Could you send me a copy of your POM which you
>         have used
>                        /adapted?
>                        Also which public repositories are you using to
>         download
>                        your Tuscany 2.0 Beta1 dependencies?
>                        (I have initially googled for a oublic maven
>         repository
>                        where I could donwload the Tuscany v2 Beta1
>         dependencies.)
> 
>                        I replaced my base runtime for the 4 dependencies you
>                        have stated, but I get runtime exceptions due to
>         other
>                        causes. Most probably I should have other
>         dependencies
>                        too which you have not mentioned.
> 
>                        Kind regards.
>                        Urso
> 
>                    Hi Urso,
>                    My pom and JUnit test case are attached below.  The
>                    repository URL
>                    is included in the pom.
> 
>                     Simon
> 
>                    ----- begin pom -----
> 
>                    <project xmlns="http://maven.apache.org/POM/4.0.0"
>                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>                                      
>         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>                    http://maven.apache.org/xsd/maven-4.0.0.xsd">
>                       <modelVersion>4.0.0</modelVersion>
>                       <parent>
>                           <groupId>org.apache.tuscany.sca</groupId>
>                           <artifactId>tuscany-sca</artifactId>
>                           <version>2.0-Beta1</version>
>                       </parent>
>                       <groupId>org.acme.logix</groupId>
>                       <artifactId>handler-agent</artifactId>
>                       <version>0.0.1-SNAPSHOT</version>
>                       <packaging>jar</packaging>
> 
>                       <name>handler-agent</name>
>                       <url>http://maven.apache.org</url>
> 
>                       <properties>
>                                    
>          <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>                       </properties>
> 
>                       <repositories>
>                           <repository>
>                               <id>apache.staging</id>
>                                        
>          <url>https://repository.apache.org/content/groups/staging</url>
>                           </repository>
>                       </repositories>
> 
>                       <build>
>                                    
>          <finalName>afnemer-handling-agent-contribution</finalName>
>                           <plugins>
>                               <plugin>
>                                            
>          <groupId>org.apache.tuscany.maven.plugins</groupId>
>                                  
>         <artifactId>maven-tuscany-plugin</artifactId>
>                                   <version>2.0-Beta1</version>
>                                   <dependencies>
>                                       <dependency>
>                                          
>         <groupId>org.apache.tuscany.sca</groupId>
>                                                    
>          <artifactId>tuscany-binding-jms-runtime</artifactId>
>                                           <version>2.0-Beta1</version>
>                                       </dependency>
> 
>                                       <dependency>
>                                          
>         <groupId>org.apache.activemq</groupId>
>                                          
>         <artifactId>activemq-all</artifactId>
>                                           <version>5.3.0</version>
>                                           <scope>runtime</scope>
>                                       </dependency>
>                                   </dependencies>
>                               </plugin>
>                               <plugin>
>                                  
>         <groupId>org.apache.maven.plugins</groupId>
>                                  
>         <artifactId>maven-compiler-plugin</artifactId>
>                                   <version>2.3.2</version>
>                                   <configuration>
>                                       <source>1.6</source>
>                                       <target>1.6</target>
>                                   </configuration>
>                               </plugin>
>                           </plugins>
>                       </build>
>                       <dependencies>
>                           <dependency>
>                               <groupId>org.apache.tuscany.sca</groupId>
>                               <artifactId>tuscany-feature-api</artifactId>
>                               <type>pom</type>
>                               <version>2.0-Beta1</version>
>                           </dependency>
> 
>                           <dependency>
>                               <groupId>org.apache.tuscany.sca</groupId>
>                              
>         <artifactId>tuscany-binding-jms-runtime</artifactId>
>                               <version>2.0-Beta1</version>
>                           </dependency>
> 
>                           <dependency>
>                               <groupId>org.apache.activemq</groupId>
>                               <artifactId>activemq-all</artifactId>
>                               <version>5.3.0</version>
>                               <scope>runtime</scope>
>                           </dependency>
> 
>                          <dependency>
>                               <groupId>org.apache.tuscany.sca</groupId>
>                                        
>          <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>                               <version>2.0-Beta1</version>
>                          </dependency>
> 
>                           <dependency>
>                               <groupId>org.apache.tuscany.sca</groupId>
>                               <artifactId>tuscany-host-jetty</artifactId>
>                               <version>2.0-Beta1</version>
>                           </dependency>
> 
>                           <dependency>
>                               <groupId>org.apache.tuscany.sca</groupId>
>                               <artifactId>tuscany-node-impl</artifactId>
>                               <version>2.0-Beta1</version>
>                           </dependency>
> 
>                           <dependency>
>                               <groupId>org.apache.tuscany.sca</groupId>
>                                        
>          <artifactId>tuscany-implementation-java-runtime</artifactId>
>                               <version>2.0-Beta1</version>
>                           </dependency>
> 
>                           <dependency>
>                               <groupId>junit</groupId>
>                               <artifactId>junit</artifactId>
>                               <version>4.8.1</version>
>                               <scope>test</scope>
>                           </dependency>
>                       </dependencies>
>                    </project>
> 
>                    ----- begin test case -----
> 
>                    package acme;
> 
>                    import org.apache.activemq.broker.BrokerService;
>                    import org.apache.tuscany.sca.node.Contribution;
>                    import org.apache.tuscany.sca.node.Node;
>                    import org.apache.tuscany.sca.node.NodeFactory;
>                    import org.junit.Test;
> 
>                    public class CallbackTestCase {
> 
>                       @Test
>                       public void testSayHello() throws Exception {
> 
>                           // Start the JMS broker
>                           BrokerService jmsBroker = new BrokerService();
>                           jmsBroker.setPersistent(false);
>                           jmsBroker.setUseJmx(false);
>                           jmsBroker.addConnector("tcp://localhost:61616");
>                           jmsBroker.start();
> 
>                           // Start the Tuscany runtime with this module
>         as the
>                    contribution
>                           System.out.println("starting Tuscany runtime");
>                           Node node =
>         NodeFactory.newInstance().createNode(new
>                    Contribution("c1", "target/classes"));
>                           System.out.println("Tuscany runtime started");
> 
>                           // Start the Tuscany node. This also runs the
>                    @EagerInit test method.
>                           node.start();
>                           System.out.println("Tuscany node started");
> 
>                           // Stop the Tuscany runtime
>                           node.stop();
> 
>                           // Stop the JMS broker
>                           jmsBroker.stop();
>                       }
> 
>                    }
> 
>                    ----- end test case -----
> 
>                     > 2011/1/15 Simon Nash <nash@apache.org
>         <ma...@apache.org>
>                    <mailto:nash@apache.org <ma...@apache.org>>
>         <mailto:nash@apache.org <ma...@apache.org>
>                    <mailto:nash@apache.org <ma...@apache.org>>>>
> 
> 
>                           Urso Wieske wrote:
> 
>                               Hi Simon,
> 
>                               Thanks for the quick response.
>                               That's a pitty that maven-tuscany-plugin
>         is not
>                        behaving
>                               accordingly. It's a great instrument to use
>                        within my IDE
>                               (Eclipse). I'll submit an issue at the Tuscany
>                        projectsite. I
>                               will also dig into the "maven-tuscany-plugin"
>                        problem to figure
>                               out what is the cause of this deviation.
> 
>                           Hi Urso,
>                           I agree.  It should be possible to use
>                        maven-tuscany-plugin and
>                           replace things in the base runtime by alternative
>                        implementations.
>                           Maybe there is a way to do this, but I
>         couldn't find one.
> 
>                            Simon
> 
>                               Kind Regards
>                               Urso
> 
> 
>                               2011/1/15 Simon Nash <nash@apache.org
>         <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>         <mailto:nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>>
>                               <mailto:nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>>>
> 
>                                  Urso Wieske wrote:
> 
>                                      Hi Simon,
> 
>                                      I have uploaded my sources as a
>         zipped file.
> 
>                                  Hi Urso,
>                                  This problem is caused by a bug in Tuscany.
>                         Please raise a JIRA
>                                  so that we can track and fix the
>         problem.  In
>                        the meantime, I can
>                                  suggest a partial workaround.
> 
>                                  The injection failure only happens if
>         Tuscany
>                        is using the
>                                  tuscany-binding-ws-runtime-jaxws module
>         as the
>                        runtime
>                               implementation
>                                  for <binding.ws <http://binding.ws>
>         <http://binding.ws>
>                        <http://binding.ws> <http://binding.ws>>.  It
>                               doesn't happen if
>                                  tuscany-binding-ws-runtime-axis2
>                                  is used instead of
>                        tuscany-binding-ws-runtime-jaxws.  This
>                               implies that
>                                  the problem is caused by a bug in the
>         -jaxws
>                        version.
> 
>                                  By default, Tuscany uses the -jaxws
>         version.
>                         To get Tuscany
>                               to use
>                                  the -axis2 version instead, you need to
>         do special
>                               configuration in
>                                  the pom.xml file.
> 
>                                  Unfortunately I couldn't find a way to make
>                        this change when
>                               using
>                                  maven-tuscany-plugin to run the
>         application.
>                         This is because
>                                  maven-tuscany-plugin has a dependency on
>                        tuscany-base-runtime.
>                                  The tuscany-base-runtime jar contains the
>                        -jaxws version and
>                               seems
>                                  to always use it even if the -axis2
>         version is
>                        declared as an
>                                  additional dependency.
> 
>                                  I did find a way to get Tuscany to use the
>                        -axis2 version
>                               when not
>                                  using maven-tuscany-plugin.  If you replace
>                        this dependency:
>                                   <dependency>
>                                      
>         <groupId>org.apache.tuscany.sca</groupId>
>                                      
>         <artifactId>tuscany-base-runtime</artifactId>
>                                       <version>2.0-Beta1</version>
>                                   </dependency>
> 
>                                  by the following four dependencies:
>                                   <dependency>
>                                      
>         <groupId>org.apache.tuscany.sca</groupId>
>                                                    
>          <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>                                       <version>2.0-Beta1</version>
>                                   </dependency>
> 
>                                   <dependency>
>                                      
>         <groupId>org.apache.tuscany.sca</groupId>
>                                      
>         <artifactId>tuscany-host-jetty</artifactId>
>                                       <version>2.0-Beta1</version>
>                                   </dependency>
> 
>                                   <dependency>
>                                      
>         <groupId>org.apache.tuscany.sca</groupId>
>                                      
>         <artifactId>tuscany-node-impl</artifactId>
>                                       <version>2.0-Beta1</version>
>                                   </dependency>
> 
>                                   <dependency>
>                                      
>         <groupId>org.apache.tuscany.sca</groupId>
>                                                    
>          <artifactId>tuscany-implementation-java-runtime</artifactId>
>                                       <version>2.0-Beta1</version>
>                                   </dependency>
> 
>                                  then the application runs successfully.  I
>                        used a maven JUnit
>                               test
>                                  to verify this.
> 
>                                   Simon
> 
>                                      Hi Simon,
> 
>                                      I adapted my code as you suggested. It
>                        seems like the
>                               error has
>                                      dissappeared, but I got new ones.
>         Well I
>                        removed the
>                               setter and
>                                      getter of
>         messageInterpreterCallback from
>                                      MessageInterpreterImpl. Now my
>                        MessageInterpreterImpl class
>                                      contains only the instance variable
>                               messageInterpreterCallback .
>                                      I have made it a protected variable.
> 
>                                      I get a HTTP Internal Server (
>         error 500).
>                                      I am still missing something.SCA
>         runtime
>                        is supposed
>                                      "automatically" inject my callback
>                        instance in the
>                                      messageInterpreterCallback member
>         variable of
>                                      MessageInterpreterImpl. The
>                        MessageInterpreterImpl needs
>                               to have
>                                      a reference to some callback instance.
>                                      I can;t seem to solve this problem.
> 
>                                      This is the error....
>                                      ---------------------------------------
>                                      SEVERE: Exception invoking injector
>         - null
>                                    
>          org.oasisopen.sca.ServiceRuntimeException:
>                        Exception invoking
>                                      injector - null
>                                      at
>                                                          
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>                                      at
>                                                          
>          org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                                      at
>                                                          
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                                      at
>                                                          
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                                      at
>                                                          
>          org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                                      at
>                                                          
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                                      at
>                                                          
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                                      at
>                                            
>          com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                                      at
>                                            
>          com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                                      at
>                                            
>          com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                                      at
>                                            
>          com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                                      at
>                                            
>          com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                                      at
>                      
>          sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                                      at
>                                            
>          com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                                      at
>                                                          
>          sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                                      at
>                                            
>          com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                                      at
>                                            
>          sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                                      at
>                                                          
>          java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                                      at
>                                                          
>          java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                                      at
>         java.lang.Thread.run(Thread.java:662)
>                                      Caused by:
>                                                    
>         org.apache.tuscany.sca.core.factory.ObjectCreationException:
>                                      Exception invoking injector - null
>                                      at
>                                                          
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>                                      at
>                                                          
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>                                      ... 27 more
>                                      Caused by:
>         java.lang.NullPointerException
>                                      at
>                                                          
>          org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>                                      at
>                                                          
>          org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>                                      at
>                                                          
>          org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>                                      at
>                                                          
>          org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>                                      at
>                                                          
>          org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>                                      at
>                                                          
>          org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>                                      at
>                                                          
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>                                      ... 28 more
>                                      10-jan-2011 1:39:26
>                                                          
>          com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>                                      processRequest
>                                      SEVERE: The server sent HTTP status
>         code
>                        500: Internal
>                               Server Error
>                                                    
>         com.sun.xml.internal.ws.client.ClientTransportException: The
>                                      server sent HTTP status code 500:
>         Internal
>                        Server Error
>                                      at
>                                                          
>          com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>                                      at
>                                            
>          com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                                      at
>                                            
>          com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                                      at
>                                            
>          com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                                      at
>                                            
>          com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                                      at
>                      
>          com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>                                      at
>                                                          
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>                                      at
>                                                          
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>                                      at
>                                                          
>          org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                                      at
>                                                          
>          org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>                                      at
>                                                          
>          org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>                                      at
>                                                          
>          org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>                                      at
>                                                          
>          org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>                                      at
>                                                          
>          org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>                                      at $Proxy50.interpret(Unknown Source)
>                                      at
>                                                          
>          org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>                                      at
>                        sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>                               Method)
>                                      at
>                                                          
>          sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>                                      at
>                                                          
>          sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>                                      at
>                        java.lang.reflect.Method.invoke(Method.java:597)
>                                      at
>                                                          
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>                                      at
>                                                          
>          org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                                      at
>                                                          
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                                      at
>                                                          
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                                      at
>                                                          
>          org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                                      at
>                                                          
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                                      at
>                                                          
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                                      at
>                                            
>          com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                                      at
>                                            
>          com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                                      at
>                                            
>          com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                                      at
>                                            
>          com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                                      at
>                                                          
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                                      at
>                                            
>          com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                                      at
>                      
>          sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                                      at
>                                            
>          com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                                      at
>                                                          
>          sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                                      at
>                                            
>          com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                                      at
>                                            
>          sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                                      at
>                                                          
>          java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                                      at
>                                                          
>          java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                                      at
>         java.lang.Thread.run(Thread.java:662)
>                                    
>          -----------------------------------------
>                                       Hope you can help me. (?)
> 
>                                      Kind Regards
>                                      Urso
> 
> 
> 
> 
>                                      2011/1/14 Simon Nash
>         <nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>                               <mailto:nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>
>                               <mailto:nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>>>
>                                      <mailto:nash@apache.org
>         <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>         <mailto:nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>>
>                               <mailto:nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>>>>
> 
> 
>                                         Hi Urso,
>                                         I'm starting to look at your project
>                        code now.
> 
>                                         It's important to keep these
>         threads on
>                        the Tuscany
>                               mailing list
>                                         so that other members of the Tuscany
>                        community are
>                               included in
>                                         the discussion.  The Tuscany mailing
>                        list archives are an
>                                      important
>                                         resource for Tuscany users who are
>                        experiencing a
>                               problem and are
>                                         looking to see if others have
>         found a
>                        solution.  If a
>                               problem is
>                                         solved by a private message exchange
>                        instead of on the
>                               public
>                                      list,
>                                         the knowledge of how to solve it is
>                        confined to one person
>                                      instead
>                                         of being shared by the community.
> 
>                                         The best way to make this happen
>         would
>                        be for you to
>                               resend your
>                                         recent private emails to the public
>                        list.  I'll look
>                               out for them
>                                         on the public list so that I can
>                        respond to them there.
> 
>                                          Simon
> 
>                                         Urso Wieske wrote:
> 
>                                             Hi Simon,
> 
>                                             You'll find in this email the
>                        zipped file
>                               containing my
>                                      sourcecode.
> 
>                                             Unfortunately, I still have
>         errors.
>                                             I changed the member
>         variable from
>                        protected to
>                               private
>                                      like you
>                                             suggested.
>                                             And created Getter and
>         Setter for
>                        this member
>                               variable.
>                                             (messageInterpreterCallback).
>                                             I annotated the setter with
>         @Callback.
>                                             I also removed the URI attribute
>                        from the
>                                      callback/binding.ws
>         <http://binding.ws> <http://binding.ws>
>                        <http://binding.ws> <http://binding.ws>
>                                             <http://binding.ws>
>                        <http://binding.ws> element of the
>                                      service
> 
>                                             according to your
>         suggestion. Still
>                        problems.... :-(
> 
> 
>                                             I have zipped my source. It's an
>                        Eclipse project.
> 
>                                             I appreciate the fact that
>         you are
>                        willing to
>                               verify this
>                                      issue.
>                                             If you have any questions
>         about the
>                        code, just let
>                               me know.
> 
>                                             Please checkout also if my
>         POM is
>                        well specified with
>                                      regard to
>                                             dependencies. Do I have the
>         proper
>                        dependencies. I
>                               am using
>                                             Tuscany 2.0 Beta1.
> 
>                                             Kind Regards
>                                             Urso
> 
> 
>                                             2011/1/10 Simon Nash
>                        <nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>
>                               <mailto:nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>>
>                                      <mailto:nash@apache.org
>         <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>         <mailto:nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>>>
>                               <mailto:nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>
>                                      <mailto:nash@apache.org
>         <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>         <mailto:nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>>>>
>                                             <mailto:nash@apache.org
>         <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>         <mailto:nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>>
>                               <mailto:nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>>
>                                      <mailto:nash@apache.org
>         <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>         <mailto:nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>>
>                               <mailto:nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>>>>>
> 
> 
>                                                Urso Wieske wrote:
> 
>                                                    Hi Simon,
> 
>                                                    I adapted my code as you
>                        suggested. It
>                               seems like the
>                                             error has
>                                                    dissappeared, but I
>         got new
>                        ones. Well I
>                               removed the
>                                             setter and
>                                                    getter of
>                        messageInterpreterCallback from
>                                                  
>          MessageInterpreterImpl. Now my
>                                      MessageInterpreterImpl class
>                                                    contains only the
>         instance
>                        variable
>                                             messageInterpreterCallback .
>                                                    I have made it a
>         protected
>                        variable.
> 
>                                                According to the SCA 1.1
>         specs,
>                        this variable
>                               should
>                                      be private
>                                                in order to avoid having it
>                        treated as a reference.
>                                       Can you try
>                                                changing this and see if it
>                        makes any difference?
> 
> 
>                                                    I get a HTTP Internal
>         Server
>                        ( error 500).
>                                                    I am still missing
>                        something.SCA runtime is
>                               supposed
>                                                    "automatically" inject my
>                        callback instance
>                               in the
>                                                  
>          messageInterpreterCallback
>                        member variable of
>                                                  
>          MessageInterpreterImpl. The
>                               MessageInterpreterImpl
>                                      needs
>                                             to have
>                                                    a reference to some
>         callback
>                        instance.
>                                                    I can;t seem to solve
>         this
>                        problem.
> 
>                                                 >From the stack trace it
>         seems
>                        that the thread
>                               message
>                                             context doesn't
>                                                contain the callback
>         endpoint.
>                         I'm not sure what
>                                      could cause
>                                             this.
>                                                However I noticed a
>         problem in
>                        your composite that
>                                      would be worth
>                                                fixing, and it's just
>         possible
>                        that this might be
>                                      related to the
>                                                problem that you're seeing.
> 
>                                                The problem is that you have
>                        specified a
>                               callback URI
>                                      for the
>                                                MessageInterpreter service in
>                                      MessageInterpreterComponent, as
>                                             follows:
> 
>                                                 <service
>         name="MessageInterpreter">
>                                                   <interface.java
>                                    
>          interface="org.acme.logix.MessageInterpreter"
>                                                                        
>                          
>         callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>                                                   <binding.ws
>         <http://binding.ws>
>                        <http://binding.ws> <http://binding.ws>
>                               <http://binding.ws> <http://binding.ws>
>                                      <http://binding.ws>
> 
> 
>                                                                        
>                  
>          uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                                                   <callback>
>                                                     <binding.ws
>         <http://binding.ws>
>                        <http://binding.ws> <http://binding.ws>
>                               <http://binding.ws>
>                                      <http://binding.ws> <http://binding.ws>
>                                                                        
>             uri="http://localhost:8084/Client/MessageInterpreterCallback"/>
>                                                   </callback>
>                                                 </service>
> 
>                                                There shouldn't be any
>         callback
>                        URI in the service
>                                             definition, because
>                                                this information is
>         provided at
>                        runtime by the
>                               client
>                                             invocation.  So
>                                                you should change the
>         above to:
> 
>                                                 <service
>         name="MessageInterpreter">
>                                                   <interface.java
>                                    
>          interface="org.acme.logix.MessageInterpreter"
>                                                                        
>                          
>         callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>                                                   <binding.ws
>         <http://binding.ws>
>                        <http://binding.ws> <http://binding.ws>
>                               <http://binding.ws> <http://binding.ws>
>                                      <http://binding.ws>
> 
> 
>                                                                        
>                  
>          uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                                                   <callback>
>                                                     <binding.ws/
>         <http://binding.ws/>
>                        <http://binding.ws/> <http://binding.ws/>
>                               <http://binding.ws/>
>                                      <http://binding.ws/>
>         <http://binding.ws/>>
> 
> 
>                                                   </callback>
>                                                 </service>
> 
>                                                If neither of these suggested
>                        changes fixes the
>                                      problem, please
>                                                post the complete
>         application as
>                        a zip file.
> 
>                                                 Simon
> 
>                                                    This is the error....
>                                                                  
>         ---------------------------------------
>                                                    SEVERE: Exception
>         invoking
>                        injector - null
>                                                                  
>         org.oasisopen.sca.ServiceRuntimeException:
>                                      Exception invoking
>                                                    injector - null
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                                                    at
>                                                                        
>          com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                                                    at
>                                                                  
>         com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                                                    at
>                                                                  
>         com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                                                    at
>                                                                        
>          com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                                                    at
>                                                                  
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                                                    at
>                                                    
>         sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                                                    at
>                                                                  
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                                                    at
>                                                                        
>                      
>          sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                                                    at
>                                                                  
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                                                    at
>                                                                        
>          sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                                                    at
>                                                                        
>                      
>          java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                                                    at
>                                                                        
>                      
>          java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                                                    at
>                        java.lang.Thread.run(Thread.java:662)
>                                                    Caused by:
>                                                                        
>                 org.apache.tuscany.sca.core.factory.ObjectCreationException:
>                                                    Exception invoking
>         injector
>                        - null
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>                                                    ... 27 more
>                                                    Caused by:
>                        java.lang.NullPointerException
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>                                                    ... 28 more
>                                                    10-jan-2011 1:39:26
>                                                                        
>                      
>          com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>                                                    processRequest
>                                                    SEVERE: The server
>         sent HTTP
>                        status code
>                               500: Internal
>                                             Server Error
>                                                                        
>                 com.sun.xml.internal.ws.client.ClientTransportException: The
>                                                    server sent HTTP
>         status code
>                        500: Internal
>                               Server
>                                      Error
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>                                                    at
>                                                                        
>          com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                                                    at
>                                                                  
>         com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                                                    at
>                                                                  
>         com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                                                    at
>                                                                        
>          com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                                                    at
>                                                    
>         com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>                                                    at
>                        $Proxy50.interpret(Unknown Source)
>                                                    at
>                                                                        
>                      
>          org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>                                                    at
>                              
>         sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>                                             Method)
>                                                    at
>                                                                        
>                      
>          sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>                                                    at
>                                                                        
>                      
>          sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>                                                    at
>                              
>         java.lang.reflect.Method.invoke(Method.java:597)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                                                    at
>                                                                        
>                      
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                                                    at
>                                                                        
>          com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                                                    at
>                                                                  
>         com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                                                    at
>                                                                  
>         com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                                                    at
>                                                                        
>          com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                                                    at
>                                                                        
>                      
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                                                    at
>                                                                  
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                                                    at
>                                                    
>         sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                                                    at
>                                                                  
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                                                    at
>                                                                        
>                      
>          sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                                                    at
>                                                                  
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                                                    at
>                                                                        
>          sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                                                    at
>                                                                        
>                      
>          java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                                                    at
>                                                                        
>                      
>          java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                                                    at
>                        java.lang.Thread.run(Thread.java:662)
>                                                                  
>         -----------------------------------------
>                                                     Hope you can help
>         me. (?)
> 
>                                                    Kind Regards
>                                                    Urso
> 
>                                                    2011/1/9 Simon Nash
>                        <nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>
>                               <mailto:nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>>
>                                      <mailto:nash@apache.org
>         <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>         <mailto:nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>>>
>                                             <mailto:nash@apache.org
>         <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>         <mailto:nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>>
>                               <mailto:nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>>>
>                                      <mailto:nash@apache.org
>         <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>         <mailto:nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>>
>                               <mailto:nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>>
>                                             <mailto:nash@apache.org
>         <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>         <mailto:nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>>
>                               <mailto:nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>>>>
>                                                  
>          <mailto:nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>                               <mailto:nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>
>                               <mailto:nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>>>
>                                      <mailto:nash@apache.org
>         <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>         <mailto:nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>>
>                               <mailto:nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>>>
>                                             <mailto:nash@apache.org
>         <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>         <mailto:nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>>
>                               <mailto:nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>>
>                                      <mailto:nash@apache.org
>         <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>         <mailto:nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>>
>                               <mailto:nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>>>>>>
> 
> 
> 
>                                                       Urso Wieske wrote:
> 
>                                                           Hi
>                                                           I am evaluating
>                        Tuscany 2.0 Beta1 and am
>                                      trying to
>                                             learn more
>                                                           about Callbacks
>                        (Bi-Directional
>                               interface)
>                                      of SCA
>                                             1.1. I
>                                                           downloaded the
>                        Tuscany Sample files and
>                                      started to
>                                                    explore the
>                                                           callback
>                        implementations with webservice
>                                      binding,
>                                             i.e. the
>                                                           Search and
>                        SearchCallback interfaces.
>                                                           It took me a while
>                        before I realized
>                               that the
>                                             Tuscany SCA
>                                                           Samples were
>         based on
>                        SCA v1.0.          Tuscany
>                                      2.0 Beta1 is
>                                                    based on
>                                                           the SCA v1.1
>         specs.
>                                                           After studying the
>                        sample sources, I
>                               have
>                                      written
>                                             my own
>                                                    callback.
> 
>                                                           Unfortunately,
>         I kept
>                        on getting a
>                               runtime
>                                             exception after I
>                                                           installed and
>         deployed my
>                               contribution. By the
>                                             way, I am
>                                                    using
>                                                           Eclipse and
>         the maven
>                        tuscany plugin.
> 
>                                                           I can't find the
>                        problem and hope if
>                                      someone can
>                                             point me
>                                                    in the
>                                                           right direction.
> 
>                                                           This is the error
>                        (printed on my
>                               console) I am
>                                             getting when I
>                                                           try to run my
>         program:
>                                                           [ERROR] Failed to
>                        execute goal
>                                                                        
>                                                    
>         org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>                                                           (default-cli) on
>                        project handler-agent:
>                                      Execution
>                                                    default-cli of
>                                                           goal
>                                                                        
>                                                    
>         org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>                                                           failed:
>                                    
>          org.oasisopen.sca.ServiceRuntimeException:
>                                                    [Composite:
>                                                                        
>                        {http://docs.oasis-open.org/ns/opencsa/sca/200912},
>                                                    Component:
>                                                                        
>          MessageInterpreterComponent] -
>                               [ASM60033] No
>                                             targets for
>                                                           reference:
>         Composite =
>                                                                        
>                        {http://docs.oasis-open.org/ns/opencsa/sca/200912}
>                                                    Reference =
>                                                                        
>          messageInterpreterCallback -> [Help 1]
> 
>                                                           I suspect that
>         I am
>                        doing something
>                               wrong
>                                      in the
>                                                    composite file.
>                                                           I can't
>         imagine I did
>                        something wrong in
>                                      the java
>                                                    sources. (See
>                                                           below for the
>         sources.)
> 
>                                                       Because the
>                        MessageInterpreterImpl class
>                               doesn't
>                                             contain any
>                                                       @Reference or
>                                                       @Property annotations,
>                        SCA creates implicit
>                                      references for
>                                                    all public
>                                                       setter methods in this
>                        class whose type is a
>                                      remotable SCA
>                                                       interface, and
>                                                       also for all public or
>                        protected fields
>                               in this
>                                      class
>                                             whose
>                                                    type is a
>                                                       remotable SCA
>         interface.
> 
>                                                       There is a public
>         setter
>                        method
>                                                                  
>         setMessageInterpreterCallback() and a
>                                                       protected field
>                               messageInterpreterCallback, so SCA
>                                             defines a
>                                                    reference
>                                                       named
>                        messageInterpreterCallback.  This
>                                      reference doesn't
>                                                    have a target
>                                                       configured in the
>                        composite, hence the error
>                                      message.
> 
>                                                       To fix the
>         problem, you
>                        need to remove
>                               the setter
>                                             method (or
>                                                    make it
>                                                       protected) and
>         change the
>                        field from
>                               protected
>                                      to private.
> 
>                                                        Simon
> 
> 
>                                                           Kind Regards,
> 
>                                                           Urso
> 
> 
>                                                          
>         --------------------
>                        THE SERVICE
>                               Interface With
>                                             Callback
>                                                           Interface
>         association
>                        ----------
>                                                           /**
>                                                            *  */
>                                                           package
>         org.acme.logix;
> 
>                                                           import
>                        org.acme.logix.message.Message;
>                                                           import
>                               org.oasisopen.sca.annotation.Callback;
>                                                           import
>                               org.oasisopen.sca.annotation.OneWay;
>                                                           import
>                               org.oasisopen.sca.annotation.Remotable;
> 
>                                                           /**
>                                                            *  *
>                                                            */
>                                                           @Remotable
>                                                                        
>                 @Callback(MessageInterpreterCallback.class)
>                                                           public interface
>                        MessageInterpreter {
> 
>                                                           @OneWay
>                                                           void
>                        interpret(Message msg);
>                                                           }
> 
> 
>                                                           /**
>                                                            *  */
>                                                           package
>         org.acme.logix;
> 
>                                                           import
>                               org.oasisopen.sca.annotation.OneWay;
>                                                           import
>                               org.oasisopen.sca.annotation.Remotable;
> 
>                                                           /**
>                                                            *  *
>                                                            */
>                                                           @Remotable
>                                                           public interface
>                               MessageInterpreterCallback {
>                                                           void
>                        onInterpret(Interpretation ipr);
>                                                           }
> 
> 
>                                                           ---------- THE
>         CLIENT
>                        implementing
>                               the callback
>                                             interface
>                                                           ------------
> 
>                                                           /**
>                                                            *  */
>                                                           package
>         org.acme.logix;
> 
>                                                           import
>                        org.acme.logix.message.Message;
>                                                           import
>                               org.oasisopen.sca.annotation.Reference;
> 
>                                                           /**
>                                                            *  */
>                                                           public class
>                        LogisticCenterImpl
>                               implements
>                                             LogisticCenter,
>                                                                        
>          MessageInterpreterCallback {
>                                                           private
>         AuditService
>                        auditService;
>                                                           @Reference
>                                                           protected
>                        MessageInterpreter
>                                      messageInterpreter;
> 
>                                                           /* (non-Javadoc)
>                                                           * @see
>                                                                        
>                                                    
>         org.acme.logix.LogisticCenter#processMessage(org.acme.logix.message.Message)
>                                                           */
>                                                           public void
>                        processMessage(Message
>                               message) {
>                                                                        
>          System.out.println("Processing
>                               message with
>                                             payload " +
>                                                          
>         message.getPayload() );
>                                                                        
>          auditService.logSentMessage(message);
>                                                                        
>          messageInterpreter.interpret(message);
>                                                           }
> 
>                                                           /**
>                                                           * @return the
>                        auditService
>                                                           */
>                                                           public
>         AuditService
>                        getAuditService() {
>                                                           return
>         auditService;
>                                                           }
> 
>                                                           /**
>                                                           * @param
>         auditService the
>                               auditService to set
>                                                           */
>                                                           @Reference
>                                                           public void
>                        setAuditService(AuditService
>                                             auditService) {
>                                                          
>         this.auditService =
>                        auditService;
>                                                           }
> 
>                                                           /**
>                                                           * @param
>                        messageInterpreter the
>                                      messageInterpreter
>                                             to set
>                                                           */
>                                                           public void
>                                    
>          setMessageInterpreter(MessageInterpreter
>                                                          
>         messageInterpreter) {
>                                                          
>         this.messageInterpreter =
>                               messageInterpreter;
>                                                           }
> 
>                                                           /**
>                                                           * @return the
>                        messageInterpreter
>                                                           */
>                                                           public
>         MessageInterpreter
>                                      getMessageInterpreter() {
>                                                           return
>                        messageInterpreter;
>                                                           }
> 
> 
>                                                                  /**
>                                                                  *  THE
>                        CALLBACK method of
>                                             MessageInterpreterCallback
>                                                           interface
>                                                                  */
>                                                           public void
>                               onInterpret(Interpretation ipr) {
>                                                                        
>          System.out.println("Message has been
>                                      interpreted.");
>                                                           }
> 
>                                                           }
> 
> 
>                                                           ---------THE
>         SERVICE
>                        WHICH IS CALLED
>                               BY THE
>                                      CLIENT
>                                             THROUGH
>                                                           WEBSERVICE BINDING
>                        ---------
> 
>                                                           /**
>                                                            *  */
>                                                           package
>         org.acme.logix;
> 
>                                                           import
>                        org.acme.logix.message.Message;
>                                                           import
>                        org.oasisopen.sca.RequestContext;
>                                                           import
>                               org.oasisopen.sca.ServiceReference;
>                                                           import
>                               org.oasisopen.sca.annotation.Callback;
>                                                           import
>                               org.oasisopen.sca.annotation.Context;
>                                                           import
>                               org.oasisopen.sca.annotation.Reference;
>                                                           import
>                               org.oasisopen.sca.annotation.Service;
> 
>                                                           /**
>                                                            *  *
>                                                            */
>                                                           public class
>                        MessageInterpreterImpl
>                               implements
>                                                    MessageInterpreter{
> 
>                                                           @Callback
>                                                           protected
>                        MessageInterpreterCallback
>                                                  
>          messageInterpreterCallback;
>                                                           /* (non-Javadoc)
>                                                           * @see
>                                                                        
>                                                    
>         org.acme.logix.MessageInterpreter#interpret(org.acme.logix.message.Message)
>                                                           */
>                                                           public void
>                        interpret(Message msg) {
>                                                                        
>          System.out.println("The message is being
>                                             interpreted..");
>                                                           Interpretation
>         ipr = new
>                               Interpretation();
>                                                                        
>                 messageInterpreterCallback.onInterpret(ipr);
>                                                           }
> 
> 
> 
>                                                           /**
>                                                           * @return the
>                        messageInterpreterCallback
>                                                           */
>                                                           public
>                        MessageInterpreterCallback
>                                                                  
>         getMessageInterpreterCallback() {
>                                                           return
>                        messageInterpreterCallback;
>                                                           }
> 
> 
> 
>                                                           /**
>                                                           * @param
>                        messageInterpreterCallback the
>                                                                        
>          messageInterpreterCallback to set
>                                                           */
>                                                           public void
>                               setMessageInterpreterCallback(
>                                                                        
>          MessageInterpreterCallback
>                                             messageInterpreterCallback) {
>                                                                        
>          this.messageInterpreterCallback =
>                                             messageInterpreterCallback;
>                                                           }
>                                                           }
> 
> 
> 
> 
> 
>                                                           ---- THE COMPOSITE
>                        -----------
> 
> 
> 
>                                                           <composite
>                                                                        
>                 xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
>                                                                        
>                           targetNamespace="http://logistix"
>                                                                        
>                           xmlns:logistix="http://logistix"
>                                                                        
>                    name="AfnemerLogisticCenter">
> 
>                                                              <component
>                                      name="AfnemerHandlingAgentComponent">
>                                                          
>         <implementation.java
>                                                                  
>         class="org.acme.logix.HandlingAgentImpl"/>
>                                                                  
>          <reference
>                               name="logisticCenter" >
>                                                                  
>         <binding.ws <http://binding.ws>
>                        <http://binding.ws>
>                               <http://binding.ws> <http://binding.ws>
>                                      <http://binding.ws>
>                                             <http://binding.ws>
>                                                    <http://binding.ws>
>                        <http://binding.ws>
> 
>                                                                        
>                                                    
>         uri="http://127.0.0.1:8087/AfnemerHandlingAgentComponent"/>
>                                                                  
>          </reference>
>                                <reference
>                                             name="auditService"
>                                                                        
>          target="AuditServiceComponent"/>                              
>                               </component>
> 
> 
> 
>                                                              <component
>                                      name="AfnemerLogisticCenterComponent">
>                                                                        
>                 <implementation.java
>                                                                        
>                 class="org.acme.logix.LogisticCenterImpl"/>
>                                                                  <reference
>                               name="messageInterpreter">
>                                                           <interface.java
>                                                                        
>          interface="org.acme.logix.MessageInterpreter"                  
>                                                                        
>                                                              
>          callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
> 
>                                                           <binding.ws
>         <http://binding.ws>
>                        <http://binding.ws> <http://binding.ws>
>                               <http://binding.ws>
>                                      <http://binding.ws>
>                                             <http://binding.ws>
>         <http://binding.ws>
>                                                    <http://binding.ws>
> 
>                                                                        
>                                                    
>         uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                                                           <callback >
>                                                           <binding.ws
>         <http://binding.ws>
>                        <http://binding.ws> <http://binding.ws>
>                               <http://binding.ws>
>                                      <http://binding.ws>
>                                             <http://binding.ws>
>         <http://binding.ws>
>                                                    <http://binding.ws>
> 
>                                                                        
>                              
>         uri="http://localhost:8084/Client/MessageInterpreterCallback
>                                                                        
>                              
>         <http://localhost:8081/Client/MessageInterpreterCallback>"
>                        />
> 
>                                                           </callback>
>                                                           </reference>
>                                                                  <reference
>                               name="auditService">                      
>                                                          <binding.jms
>                                                                        
>                                                    
>         initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>                                                                        
>          jndiURL="tcp://localhost:61616">
>                                                             <destination
>                               jndiName="AuditServiceQueue" />
>                                                            
>         </binding.jms>                        </reference>
>                                                                  
>         </component>
>                                                                  <component
>                                      name="MessageInterpreterComponent">
>                                                              
>         <implementation.java
>                                                                        
>                 class="org.acme.logix.MessageInterpreterImpl"/>
>                                                                   <service
>                               name="MessageInterpreter">
>                                                           <interface.java
>                                                          
>          interface="org.acme.logix.MessageInterpreter"
>                                                                        
>                                                                        
>         callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>                                                           <binding.ws
>         <http://binding.ws>
>                        <http://binding.ws> <http://binding.ws>
>                               <http://binding.ws>
>                                      <http://binding.ws>
>                                             <http://binding.ws>
>         <http://binding.ws>
>                                                    <http://binding.ws>
> 
>                                                                        
>                                                    
>          uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                                                           <callback>
>                                                           <binding.ws
>         <http://binding.ws>
>                        <http://binding.ws> <http://binding.ws>
>                               <http://binding.ws>
>                                      <http://binding.ws>
>                                             <http://binding.ws>
>         <http://binding.ws>
>                                                    <http://binding.ws>
> 
>                                                                        
>                              
>         uri="http://localhost:8084/Client/MessageInterpreterCallback
>                                                                        
>                              
>         <http://localhost:8081/Client/MessageInterpreterCallback>"/>
> 
>                                                           </callback>
>                                                           </service>
>                                                              </component>
> 
> 
>                                                              <component
>                               name="AuditServiceComponent">
>                                                                        
>                 <implementation.java
>                                                                        
>                 class="org.acme.logix.AuditServiceImpl"/>
>                                                                        
>          <service
>                               name="AuditService">
>                                                                    
>          <binding.jms
>                                                                        
>                                                    
>         initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>                                                                        
>          jndiURL="tcp://localhost:61616">
>                                                             <destination
>                               jndiName="AuditServiceQueue" />
>                                                           </binding.jms>
>                                </service>
>                                                              </component>
>                                                              </composite>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 


Re: Callback and Tuscany 2.0 Samples

Posted by Urso Wieske <uw...@gmail.com>.
Simon,

Checkout my POM.

I had also to remove two dependencies you suggested me to add originally.
I kept my base-runtime dependency by the way.

-------------------- START ---------------
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.acme.logix</groupId>
<artifactId>handler-agent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<parent>

       <groupId>org.apache.tuscany.sca</groupId>
       <artifactId>tuscany-sca</artifactId>

       <version>2.0-Beta1</version>
    </parent>
<name>handler-agent</name>
<url>http://maven.apache.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>


   <repositories>
       <repository>
           <id>apache.staging</id>
           <url>https://repository.apache.org/content/groups/staging</url>
       </repository>
   </repositories>


<build>
<finalName>afnemer-handling-agent-contribution</finalName>
<plugins>

<plugin>
<groupId>org.apache.tuscany.maven.plugins</groupId>
<artifactId>maven-tuscany-plugin</artifactId>
<version>2.0-Beta1</version>
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-binding-jms-runtime</artifactId>
<version>2.0-Beta1</version>
</dependency>
 <!-- These two dependencies below are added in the context of the m2
plugin. -->
<dependency>
    <groupId>org.apache.tuscany.sca</groupId>
     <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
     <version>2.0-Beta1</version>
 </dependency>
 <dependency>
     <groupId>org.apache.tuscany.sca</groupId>
     <artifactId>tuscany-host-jetty</artifactId>
     <version>2.0-Beta1</version>
</dependency>

<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId>
<version>5.3.0</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-feature-api</artifactId>
<type>pom</type>
<version>2.0-Beta1</version>
</dependency>

<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-base-runtime</artifactId>
<version>2.0-Beta1</version>
</dependency>
 <!-- THESE Dependencies are introduced because of flaw
 in the jaxws tuscany runtime implementation with respect to
 callback injection. The base runtime depenedency s replaced
 by the 4 dependencies below.

-->
 <dependency>
    <groupId>org.apache.tuscany.sca</groupId>
     <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
     <version>2.0-Beta1</version>
  </dependency>

 <dependency>
     <groupId>org.apache.tuscany.sca</groupId>
     <artifactId>tuscany-host-jetty</artifactId>
     <version>2.0-Beta1</version>
 </dependency>

 <!-- I Had to remove the two dependencies below, because of error at
runtime. -->
<!--
 <dependency>
     <groupId>org.apache.tuscany.sca</groupId>
     <artifactId>tuscany-node-impl</artifactId>
     <version>2.0-Beta1</version>
 </dependency>
 <dependency>
     <groupId>org.apache.tuscany.sca</groupId>
     <artifactId>tuscany-implementation-java-runtime</artifactId>
     <version>2.0-Beta1</version>
 </dependency>
-->

 <dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-binding-jms-runtime</artifactId>
<version>2.0-Beta1</version>
</dependency>

<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId>
<version>5.3.0</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

------------------- END ------------------

Kind Regards
Urso

2011/1/16 Simon Nash <na...@apache.org>

> Urso Wieske wrote:
>
>> Simon,
>>
>> I added the dependencies AS PART OF the maven plugin dependency element.
>> (Dependencies element enclosed  in the build/plugins/plugin element).
>> Then it should work!
>>
>>  Hi Urso,
> I've tried just about every possible combination of dependencies in the
> build/plugin element, and I get errors every time.  What combination are
> you using?
>
>  Simon
>
>
>> Kind regards,
>> Urso
>>
>> 2011/1/16 Urso Wieske <uwieske@gmail.com <ma...@gmail.com>>
>>
>>    Nope, I was mislead.  The maven plugin does not work. Only the
>>    Testclass is working.
>>
>>    Kind regards
>>    Urso
>>
>>    2011/1/16 Urso Wieske <uwieske@gmail.com <ma...@gmail.com>>
>>
>>        Hi Simon,
>>
>>        I have been studying the source code around SCA binding.ws
>>        <http://binding.ws> extension.
>>        As you mentioned earlier, the Tuscany SCA runtime  uses by
>>        default de reference implementation of JAX-WS binding.
>>        In the resource of binding-ws-runtime-jaxws-ri at the path
>>
>>  META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory:
>>
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.ri.JAXWSBindingProviderFactory;model=org.apache.tuscany.sca.binding.ws.WebServiceBinding
>>
>>        you can indeed see that the Factory JAXWSBindingProviderFactory
>>        is used as default.
>>
>>        I believe -I have not digged into the code yet- that the
>>        reference implementation is overridden as soon as the SCA
>>        runtime finds an alternative binding.ws <http://binding.ws>
>>        implementation on the classpath.         I check this by just
>> adding the Axis2 extension to my dependency
>>        set and I the runtime appears switch automatically to Axis2.
>>
>>        I manage to run my code with the maven plugin. I removed
>>                <dependency>
>>            <groupId>org.apache.tuscany.sca</groupId>
>>            <artifactId>tuscany-node-impl</artifactId>
>>            <version>2.0-Beta1</version>
>>        </dependency>
>>        <dependency>
>>            <groupId>org.apache.tuscany.sca</groupId>
>>            <artifactId>tuscany-implementation-java-runtime</artifactId>
>>            <version>2.0-Beta1</version>
>>        </dependency>
>>
>>        from my dependencyset and ran my code succesfully.         I don't
>> understand the "negative" effect of these two
>>        dependencies on my code.
>>
>>        Maybe you have some clarification for this?
>>
>>
>>        Kind Regards,
>>        Urso
>>        2011/1/15 Simon Nash <nash@apache.org <ma...@apache.org>>
>>
>>            Urso Wieske wrote:
>>
>>                Hi Simon,
>>
>>                Could you send me a copy of your POM which you have used
>>                /adapted?
>>                Also which public repositories are you using to download
>>                your Tuscany 2.0 Beta1 dependencies?
>>                (I have initially googled for a oublic maven repository
>>                where I could donwload the Tuscany v2 Beta1 dependencies.)
>>
>>                I replaced my base runtime for the 4 dependencies you
>>                have stated, but I get runtime exceptions due to other
>>                causes. Most probably I should have other dependencies
>>                too which you have not mentioned.
>>
>>                Kind regards.
>>                Urso
>>
>>            Hi Urso,
>>            My pom and JUnit test case are attached below.  The
>>            repository URL
>>            is included in the pom.
>>
>>             Simon
>>
>>            ----- begin pom -----
>>
>>            <project xmlns="http://maven.apache.org/POM/4.0.0"
>>            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>                               xsi:schemaLocation="
>> http://maven.apache.org/POM/4.0.0
>>            http://maven.apache.org/xsd/maven-4.0.0.xsd">
>>               <modelVersion>4.0.0</modelVersion>
>>               <parent>
>>                   <groupId>org.apache.tuscany.sca</groupId>
>>                   <artifactId>tuscany-sca</artifactId>
>>                   <version>2.0-Beta1</version>
>>               </parent>
>>               <groupId>org.acme.logix</groupId>
>>               <artifactId>handler-agent</artifactId>
>>               <version>0.0.1-SNAPSHOT</version>
>>               <packaging>jar</packaging>
>>
>>               <name>handler-agent</name>
>>               <url>http://maven.apache.org</url>
>>
>>               <properties>
>>
>>  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>>               </properties>
>>
>>               <repositories>
>>                   <repository>
>>                       <id>apache.staging</id>
>>                                  <url>
>> https://repository.apache.org/content/groups/staging</url>
>>                   </repository>
>>               </repositories>
>>
>>               <build>
>>
>>  <finalName>afnemer-handling-agent-contribution</finalName>
>>                   <plugins>
>>                       <plugin>
>>
>>  <groupId>org.apache.tuscany.maven.plugins</groupId>
>>                           <artifactId>maven-tuscany-plugin</artifactId>
>>                           <version>2.0-Beta1</version>
>>                           <dependencies>
>>                               <dependency>
>>
>> <groupId>org.apache.tuscany.sca</groupId>
>>
>>  <artifactId>tuscany-binding-jms-runtime</artifactId>
>>                                   <version>2.0-Beta1</version>
>>                               </dependency>
>>
>>                               <dependency>
>>                                   <groupId>org.apache.activemq</groupId>
>>                                   <artifactId>activemq-all</artifactId>
>>                                   <version>5.3.0</version>
>>                                   <scope>runtime</scope>
>>                               </dependency>
>>                           </dependencies>
>>                       </plugin>
>>                       <plugin>
>>                           <groupId>org.apache.maven.plugins</groupId>
>>                           <artifactId>maven-compiler-plugin</artifactId>
>>                           <version>2.3.2</version>
>>                           <configuration>
>>                               <source>1.6</source>
>>                               <target>1.6</target>
>>                           </configuration>
>>                       </plugin>
>>                   </plugins>
>>               </build>
>>               <dependencies>
>>                   <dependency>
>>                       <groupId>org.apache.tuscany.sca</groupId>
>>                       <artifactId>tuscany-feature-api</artifactId>
>>                       <type>pom</type>
>>                       <version>2.0-Beta1</version>
>>                   </dependency>
>>
>>                   <dependency>
>>                       <groupId>org.apache.tuscany.sca</groupId>
>>                       <artifactId>tuscany-binding-jms-runtime</artifactId>
>>                       <version>2.0-Beta1</version>
>>                   </dependency>
>>
>>                   <dependency>
>>                       <groupId>org.apache.activemq</groupId>
>>                       <artifactId>activemq-all</artifactId>
>>                       <version>5.3.0</version>
>>                       <scope>runtime</scope>
>>                   </dependency>
>>
>>                  <dependency>
>>                       <groupId>org.apache.tuscany.sca</groupId>
>>
>>  <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>>                       <version>2.0-Beta1</version>
>>                  </dependency>
>>
>>                   <dependency>
>>                       <groupId>org.apache.tuscany.sca</groupId>
>>                       <artifactId>tuscany-host-jetty</artifactId>
>>                       <version>2.0-Beta1</version>
>>                   </dependency>
>>
>>                   <dependency>
>>                       <groupId>org.apache.tuscany.sca</groupId>
>>                       <artifactId>tuscany-node-impl</artifactId>
>>                       <version>2.0-Beta1</version>
>>                   </dependency>
>>
>>                   <dependency>
>>                       <groupId>org.apache.tuscany.sca</groupId>
>>
>>  <artifactId>tuscany-implementation-java-runtime</artifactId>
>>                       <version>2.0-Beta1</version>
>>                   </dependency>
>>
>>                   <dependency>
>>                       <groupId>junit</groupId>
>>                       <artifactId>junit</artifactId>
>>                       <version>4.8.1</version>
>>                       <scope>test</scope>
>>                   </dependency>
>>               </dependencies>
>>            </project>
>>
>>            ----- begin test case -----
>>
>>            package acme;
>>
>>            import org.apache.activemq.broker.BrokerService;
>>            import org.apache.tuscany.sca.node.Contribution;
>>            import org.apache.tuscany.sca.node.Node;
>>            import org.apache.tuscany.sca.node.NodeFactory;
>>            import org.junit.Test;
>>
>>            public class CallbackTestCase {
>>
>>               @Test
>>               public void testSayHello() throws Exception {
>>
>>                   // Start the JMS broker
>>                   BrokerService jmsBroker = new BrokerService();
>>                   jmsBroker.setPersistent(false);
>>                   jmsBroker.setUseJmx(false);
>>                   jmsBroker.addConnector("tcp://localhost:61616");
>>                   jmsBroker.start();
>>
>>                   // Start the Tuscany runtime with this module as the
>>            contribution
>>                   System.out.println("starting Tuscany runtime");
>>                   Node node = NodeFactory.newInstance().createNode(new
>>            Contribution("c1", "target/classes"));
>>                   System.out.println("Tuscany runtime started");
>>
>>                   // Start the Tuscany node. This also runs the
>>            @EagerInit test method.
>>                   node.start();
>>                   System.out.println("Tuscany node started");
>>
>>                   // Stop the Tuscany runtime
>>                   node.stop();
>>
>>                   // Stop the JMS broker
>>                   jmsBroker.stop();
>>               }
>>
>>            }
>>
>>            ----- end test case -----
>>
>>             > 2011/1/15 Simon Nash <nash@apache.org
>>            <ma...@apache.org> <mailto:nash@apache.org
>>            <ma...@apache.org>>>
>>
>>
>>                   Urso Wieske wrote:
>>
>>                       Hi Simon,
>>
>>                       Thanks for the quick response.
>>                       That's a pitty that maven-tuscany-plugin is not
>>                behaving
>>                       accordingly. It's a great instrument to use
>>                within my IDE
>>                       (Eclipse). I'll submit an issue at the Tuscany
>>                projectsite. I
>>                       will also dig into the "maven-tuscany-plugin"
>>                problem to figure
>>                       out what is the cause of this deviation.
>>
>>                   Hi Urso,
>>                   I agree.  It should be possible to use
>>                maven-tuscany-plugin and
>>                   replace things in the base runtime by alternative
>>                implementations.
>>                   Maybe there is a way to do this, but I couldn't find
>> one.
>>
>>                    Simon
>>
>>                       Kind Regards
>>                       Urso
>>
>>
>>                       2011/1/15 Simon Nash <nash@apache.org
>>                <ma...@apache.org> <mailto:nash@apache.org
>>                <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>                <mailto:nash@apache.org <ma...@apache.org>>>>
>>
>>                          Urso Wieske wrote:
>>
>>                              Hi Simon,
>>
>>                              I have uploaded my sources as a zipped file.
>>
>>                          Hi Urso,
>>                          This problem is caused by a bug in Tuscany.
>>                 Please raise a JIRA
>>                          so that we can track and fix the problem.  In
>>                the meantime, I can
>>                          suggest a partial workaround.
>>
>>                          The injection failure only happens if Tuscany
>>                is using the
>>                          tuscany-binding-ws-runtime-jaxws module as the
>>                runtime
>>                       implementation
>>                          for <binding.ws <http://binding.ws>
>>                <http://binding.ws> <http://binding.ws>>.  It
>>                       doesn't happen if
>>                          tuscany-binding-ws-runtime-axis2
>>                          is used instead of
>>                tuscany-binding-ws-runtime-jaxws.  This
>>                       implies that
>>                          the problem is caused by a bug in the -jaxws
>>                version.
>>
>>                          By default, Tuscany uses the -jaxws version.
>>                 To get Tuscany
>>                       to use
>>                          the -axis2 version instead, you need to do
>> special
>>                       configuration in
>>                          the pom.xml file.
>>
>>                          Unfortunately I couldn't find a way to make
>>                this change when
>>                       using
>>                          maven-tuscany-plugin to run the application.
>>                 This is because
>>                          maven-tuscany-plugin has a dependency on
>>                tuscany-base-runtime.
>>                          The tuscany-base-runtime jar contains the
>>                -jaxws version and
>>                       seems
>>                          to always use it even if the -axis2 version is
>>                declared as an
>>                          additional dependency.
>>
>>                          I did find a way to get Tuscany to use the
>>                -axis2 version
>>                       when not
>>                          using maven-tuscany-plugin.  If you replace
>>                this dependency:
>>                           <dependency>
>>                               <groupId>org.apache.tuscany.sca</groupId>
>>
>> <artifactId>tuscany-base-runtime</artifactId>
>>                               <version>2.0-Beta1</version>
>>                           </dependency>
>>
>>                          by the following four dependencies:
>>                           <dependency>
>>                               <groupId>org.apache.tuscany.sca</groupId>
>>
>>  <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>>                               <version>2.0-Beta1</version>
>>                           </dependency>
>>
>>                           <dependency>
>>                               <groupId>org.apache.tuscany.sca</groupId>
>>                               <artifactId>tuscany-host-jetty</artifactId>
>>                               <version>2.0-Beta1</version>
>>                           </dependency>
>>
>>                           <dependency>
>>                               <groupId>org.apache.tuscany.sca</groupId>
>>                               <artifactId>tuscany-node-impl</artifactId>
>>                               <version>2.0-Beta1</version>
>>                           </dependency>
>>
>>                           <dependency>
>>                               <groupId>org.apache.tuscany.sca</groupId>
>>
>>  <artifactId>tuscany-implementation-java-runtime</artifactId>
>>                               <version>2.0-Beta1</version>
>>                           </dependency>
>>
>>                          then the application runs successfully.  I
>>                used a maven JUnit
>>                       test
>>                          to verify this.
>>
>>                           Simon
>>
>>                              Hi Simon,
>>
>>                              I adapted my code as you suggested. It
>>                seems like the
>>                       error has
>>                              dissappeared, but I got new ones. Well I
>>                removed the
>>                       setter and
>>                              getter of messageInterpreterCallback from
>>                              MessageInterpreterImpl. Now my
>>                MessageInterpreterImpl class
>>                              contains only the instance variable
>>                       messageInterpreterCallback .
>>                              I have made it a protected variable.
>>
>>                              I get a HTTP Internal Server ( error 500).
>>                              I am still missing something.SCA runtime
>>                is supposed
>>                              "automatically" inject my callback
>>                instance in the
>>                              messageInterpreterCallback member variable of
>>                              MessageInterpreterImpl. The
>>                MessageInterpreterImpl needs
>>                       to have
>>                              a reference to some callback instance.
>>                              I can;t seem to solve this problem.
>>
>>                              This is the error....
>>                              ---------------------------------------
>>                              SEVERE: Exception invoking injector - null
>>                              org.oasisopen.sca.ServiceRuntimeException:
>>                Exception invoking
>>                              injector - null
>>                              at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>>                              at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>                              at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>                              at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>                              at
>>
>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>                              at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>                              at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>                              at
>>
>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>                              at
>>
>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>                              at
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>                              at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>                              at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>                              at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>                              at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>                              at
>>
>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>                              at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>                              at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>                              at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>                              at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>                              at
>>
>>  com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                              at
>>                sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>                              at
>>
>>  com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>                              at
>>
>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>                              at
>>
>>  com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                              at
>>
>>  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>                              at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>                              at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>                              at java.lang.Thread.run(Thread.java:662)
>>                              Caused by:
>>
>> org.apache.tuscany.sca.core.factory.ObjectCreationException:
>>                              Exception invoking injector - null
>>                              at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>>                              at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>>                              ... 27 more
>>                              Caused by: java.lang.NullPointerException
>>                              at
>>
>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>>                              at
>>
>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>>                              at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>>                              at
>>
>>  org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>>                              at
>>
>>  org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>>                              at
>>
>>  org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>>                              at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>>                              ... 28 more
>>                              10-jan-2011 1:39:26
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>>                              processRequest
>>                              SEVERE: The server sent HTTP status code
>>                500: Internal
>>                       Server Error
>>
>> com.sun.xml.internal.ws.client.ClientTransportException: The
>>                              server sent HTTP status code 500: Internal
>>                Server Error
>>                              at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>>                              at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>>                              at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>>                              at
>>
>>  com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>>                              at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>                              at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>                              at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>                              at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>                              at
>>                com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>>                              at
>>
>>  com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>>                              at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>>                              at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>>                              at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>                              at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>>                              at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>>                              at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>>                              at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>>                              at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>>                              at $Proxy50.interpret(Unknown Source)
>>                              at
>>
>>  org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>>                              at
>>                sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>                       Method)
>>                              at
>>
>>  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>                              at
>>
>>  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>                              at
>>                java.lang.reflect.Method.invoke(Method.java:597)
>>                              at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>>                              at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>                              at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>                              at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>                              at
>>
>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>                              at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>                              at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>                              at
>>
>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>                              at
>>
>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>                              at
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>                              at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>                              at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>                              at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>                              at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>                              at
>>
>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>                              at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>                              at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>                              at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>                              at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>                              at
>>
>>  com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                              at
>>                sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>                              at
>>
>>  com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>                              at
>>
>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>                              at
>>
>>  com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                              at
>>
>>  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>                              at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>                              at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>                              at java.lang.Thread.run(Thread.java:662)
>>                              -----------------------------------------
>>                               Hope you can help me. (?)
>>
>>                              Kind Regards
>>                              Urso
>>
>>
>>
>>
>>                              2011/1/14 Simon Nash <nash@apache.org
>>                <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>
>>                <mailto:nash@apache.org <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>>
>>                              <mailto:nash@apache.org
>>                <ma...@apache.org> <mailto:nash@apache.org
>>                <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>                <mailto:nash@apache.org <ma...@apache.org>>>>>
>>
>>
>>                                 Hi Urso,
>>                                 I'm starting to look at your project
>>                code now.
>>
>>                                 It's important to keep these threads on
>>                the Tuscany
>>                       mailing list
>>                                 so that other members of the Tuscany
>>                community are
>>                       included in
>>                                 the discussion.  The Tuscany mailing
>>                list archives are an
>>                              important
>>                                 resource for Tuscany users who are
>>                experiencing a
>>                       problem and are
>>                                 looking to see if others have found a
>>                solution.  If a
>>                       problem is
>>                                 solved by a private message exchange
>>                instead of on the
>>                       public
>>                              list,
>>                                 the knowledge of how to solve it is
>>                confined to one person
>>                              instead
>>                                 of being shared by the community.
>>
>>                                 The best way to make this happen would
>>                be for you to
>>                       resend your
>>                                 recent private emails to the public
>>                list.  I'll look
>>                       out for them
>>                                 on the public list so that I can
>>                respond to them there.
>>
>>                                  Simon
>>
>>                                 Urso Wieske wrote:
>>
>>                                     Hi Simon,
>>
>>                                     You'll find in this email the
>>                zipped file
>>                       containing my
>>                              sourcecode.
>>
>>                                     Unfortunately, I still have errors.
>>                                     I changed the member variable from
>>                protected to
>>                       private
>>                              like you
>>                                     suggested.
>>                                     And created Getter and Setter for
>>                this member
>>                       variable.
>>                                     (messageInterpreterCallback).
>>                                     I annotated the setter with @Callback.
>>                                     I also removed the URI attribute
>>                from the
>>                              callback/binding.ws <http://binding.ws>
>>                <http://binding.ws> <http://binding.ws>
>>                                     <http://binding.ws>
>>                <http://binding.ws> element of the
>>                              service
>>
>>                                     according to your suggestion. Still
>>                problems.... :-(
>>
>>
>>                                     I have zipped my source. It's an
>>                Eclipse project.
>>
>>                                     I appreciate the fact that you are
>>                willing to
>>                       verify this
>>                              issue.
>>                                     If you have any questions about the
>>                code, just let
>>                       me know.
>>
>>                                     Please checkout also if my POM is
>>                well specified with
>>                              regard to
>>                                     dependencies. Do I have the proper
>>                dependencies. I
>>                       am using
>>                                     Tuscany 2.0 Beta1.
>>
>>                                     Kind Regards
>>                                     Urso
>>
>>
>>                                     2011/1/10 Simon Nash
>>                <nash@apache.org <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>
>>                              <mailto:nash@apache.org
>>                <ma...@apache.org> <mailto:nash@apache.org
>>                <ma...@apache.org>>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>                <mailto:nash@apache.org <ma...@apache.org>>
>>                              <mailto:nash@apache.org
>>                <ma...@apache.org> <mailto:nash@apache.org
>>                <ma...@apache.org>>>>
>>                                     <mailto:nash@apache.org
>>                <ma...@apache.org> <mailto:nash@apache.org
>>                <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>                <mailto:nash@apache.org <ma...@apache.org>>>
>>                              <mailto:nash@apache.org
>>                <ma...@apache.org> <mailto:nash@apache.org
>>                <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>                <mailto:nash@apache.org <ma...@apache.org>>>>>>
>>
>>
>>                                        Urso Wieske wrote:
>>
>>                                            Hi Simon,
>>
>>                                            I adapted my code as you
>>                suggested. It
>>                       seems like the
>>                                     error has
>>                                            dissappeared, but I got new
>>                ones. Well I
>>                       removed the
>>                                     setter and
>>                                            getter of
>>                messageInterpreterCallback from
>>                                            MessageInterpreterImpl. Now my
>>                              MessageInterpreterImpl class
>>                                            contains only the instance
>>                variable
>>                                     messageInterpreterCallback .
>>                                            I have made it a protected
>>                variable.
>>
>>                                        According to the SCA 1.1 specs,
>>                this variable
>>                       should
>>                              be private
>>                                        in order to avoid having it
>>                treated as a reference.
>>                               Can you try
>>                                        changing this and see if it
>>                makes any difference?
>>
>>
>>                                            I get a HTTP Internal Server
>>                ( error 500).
>>                                            I am still missing
>>                something.SCA runtime is
>>                       supposed
>>                                            "automatically" inject my
>>                callback instance
>>                       in the
>>                                            messageInterpreterCallback
>>                member variable of
>>                                            MessageInterpreterImpl. The
>>                       MessageInterpreterImpl
>>                              needs
>>                                     to have
>>                                            a reference to some callback
>>                instance.
>>                                            I can;t seem to solve this
>>                problem.
>>
>>                                         >From the stack trace it seems
>>                that the thread
>>                       message
>>                                     context doesn't
>>                                        contain the callback endpoint.
>>                 I'm not sure what
>>                              could cause
>>                                     this.
>>                                        However I noticed a problem in
>>                your composite that
>>                              would be worth
>>                                        fixing, and it's just possible
>>                that this might be
>>                              related to the
>>                                        problem that you're seeing.
>>
>>                                        The problem is that you have
>>                specified a
>>                       callback URI
>>                              for the
>>                                        MessageInterpreter service in
>>                              MessageInterpreterComponent, as
>>                                     follows:
>>
>>                                         <service
>> name="MessageInterpreter">
>>                                           <interface.java
>>                              interface="org.acme.logix.MessageInterpreter"
>>
>>         callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>                                           <binding.ws
>>                <http://binding.ws> <http://binding.ws>
>>                       <http://binding.ws> <http://binding.ws>
>>                              <http://binding.ws>
>>
>>
>>
>>  uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>                                           <callback>
>>                                             <binding.ws
>>                <http://binding.ws> <http://binding.ws>
>>                       <http://binding.ws>
>>                              <http://binding.ws> <http://binding.ws>
>>                                                                     uri="
>> http://localhost:8084/Client/MessageInterpreterCallback"/>
>>                                           </callback>
>>                                         </service>
>>
>>                                        There shouldn't be any callback
>>                URI in the service
>>                                     definition, because
>>                                        this information is provided at
>>                runtime by the
>>                       client
>>                                     invocation.  So
>>                                        you should change the above to:
>>
>>                                         <service
>> name="MessageInterpreter">
>>                                           <interface.java
>>                              interface="org.acme.logix.MessageInterpreter"
>>
>>         callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>                                           <binding.ws
>>                <http://binding.ws> <http://binding.ws>
>>                       <http://binding.ws> <http://binding.ws>
>>                              <http://binding.ws>
>>
>>
>>
>>  uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>                                           <callback>
>>                                             <binding.ws/
>>                <http://binding.ws/> <http://binding.ws/>
>>                       <http://binding.ws/>
>>                              <http://binding.ws/> <http://binding.ws/>>
>>
>>
>>                                           </callback>
>>                                         </service>
>>
>>                                        If neither of these suggested
>>                changes fixes the
>>                              problem, please
>>                                        post the complete application as
>>                a zip file.
>>
>>                                         Simon
>>
>>                                            This is the error....
>>
>> ---------------------------------------
>>                                            SEVERE: Exception invoking
>>                injector - null
>>
>> org.oasisopen.sca.ServiceRuntimeException:
>>                              Exception invoking
>>                                            injector - null
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>                                            at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>                                            at
>>
>> com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>                                            at
>>
>> com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>                                            at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>                                            at
>>
>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                                            at
>>
>> sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>                                            at
>>
>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>                                            at
>>
>>
>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>                                            at
>>
>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                                            at
>>
>>  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>                                            at
>>
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>                                            at
>>
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>                                            at
>>                java.lang.Thread.run(Thread.java:662)
>>                                            Caused by:
>>
>> org.apache.tuscany.sca.core.factory.ObjectCreationException:
>>                                            Exception invoking injector
>>                - null
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>>                                            ... 27 more
>>                                            Caused by:
>>                java.lang.NullPointerException
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>>                                            ... 28 more
>>                                            10-jan-2011 1:39:26
>>
>>      com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>>                                            processRequest
>>                                            SEVERE: The server sent HTTP
>>                status code
>>                       500: Internal
>>                                     Server Error
>>
>> com.sun.xml.internal.ws.client.ClientTransportException: The
>>                                            server sent HTTP status code
>>                500: Internal
>>                       Server
>>                              Error
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>>                                            at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>                                            at
>>
>> com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>                                            at
>>
>> com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>                                            at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>                                            at
>>
>> com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>>                                            at
>>                $Proxy50.interpret(Unknown Source)
>>                                            at
>>
>>
>>  org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>>                                            at
>>                       sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>                                     Method)
>>                                            at
>>
>>
>>  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>                                            at
>>
>>
>>  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>                                            at
>>                       java.lang.reflect.Method.invoke(Method.java:597)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>                                            at
>>
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>                                            at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>                                            at
>>
>> com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>                                            at
>>
>> com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>                                            at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>                                            at
>>
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>                                            at
>>
>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                                            at
>>
>> sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>                                            at
>>
>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>                                            at
>>
>>
>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>                                            at
>>
>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                                            at
>>
>>  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>                                            at
>>
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>                                            at
>>
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>                                            at
>>                java.lang.Thread.run(Thread.java:662)
>>
>> -----------------------------------------
>>                                             Hope you can help me. (?)
>>
>>                                            Kind Regards
>>                                            Urso
>>
>>                                            2011/1/9 Simon Nash
>>                <nash@apache.org <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>
>>                              <mailto:nash@apache.org
>>                <ma...@apache.org> <mailto:nash@apache.org
>>                <ma...@apache.org>>>
>>                                     <mailto:nash@apache.org
>>                <ma...@apache.org> <mailto:nash@apache.org
>>                <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>                <mailto:nash@apache.org <ma...@apache.org>>>>
>>                              <mailto:nash@apache.org
>>                <ma...@apache.org> <mailto:nash@apache.org
>>                <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>                <mailto:nash@apache.org <ma...@apache.org>>>
>>                                     <mailto:nash@apache.org
>>                <ma...@apache.org> <mailto:nash@apache.org
>>                <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>                <mailto:nash@apache.org <ma...@apache.org>>>>>
>>                                            <mailto:nash@apache.org
>>                <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>
>>                <mailto:nash@apache.org <ma...@apache.org>
>>                       <mailto:nash@apache.org <ma...@apache.org>>>
>>                              <mailto:nash@apache.org
>>                <ma...@apache.org> <mailto:nash@apache.org
>>                <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>                <mailto:nash@apache.org <ma...@apache.org>>>>
>>                                     <mailto:nash@apache.org
>>                <ma...@apache.org> <mailto:nash@apache.org
>>                <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>                <mailto:nash@apache.org <ma...@apache.org>>>
>>                              <mailto:nash@apache.org
>>                <ma...@apache.org> <mailto:nash@apache.org
>>                <ma...@apache.org>>
>>                       <mailto:nash@apache.org <ma...@apache.org>
>>                <mailto:nash@apache.org <ma...@apache.org>>>>>>>
>>
>>
>>
>>                                               Urso Wieske wrote:
>>
>>                                                   Hi
>>                                                   I am evaluating
>>                Tuscany 2.0 Beta1 and am
>>                              trying to
>>                                     learn more
>>                                                   about Callbacks
>>                (Bi-Directional
>>                       interface)
>>                              of SCA
>>                                     1.1. I
>>                                                   downloaded the
>>                Tuscany Sample files and
>>                              started to
>>                                            explore the
>>                                                   callback
>>                implementations with webservice
>>                              binding,
>>                                     i.e. the
>>                                                   Search and
>>                SearchCallback interfaces.
>>                                                   It took me a while
>>                before I realized
>>                       that the
>>                                     Tuscany SCA
>>                                                   Samples were based on
>>                SCA v1.0.          Tuscany
>>                              2.0 Beta1 is
>>                                            based on
>>                                                   the SCA v1.1 specs.
>>                                                   After studying the
>>                sample sources, I
>>                       have
>>                              written
>>                                     my own
>>                                            callback.
>>
>>                                                   Unfortunately, I kept
>>                on getting a
>>                       runtime
>>                                     exception after I
>>                                                   installed and deployed
>> my
>>                       contribution. By the
>>                                     way, I am
>>                                            using
>>                                                   Eclipse and the maven
>>                tuscany plugin.
>>
>>                                                   I can't find the
>>                problem and hope if
>>                              someone can
>>                                     point me
>>                                            in the
>>                                                   right direction.
>>
>>                                                   This is the error
>>                (printed on my
>>                       console) I am
>>                                     getting when I
>>                                                   try to run my program:
>>                                                   [ERROR] Failed to
>>                execute goal
>>
>>
>> org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>>                                                   (default-cli) on
>>                project handler-agent:
>>                              Execution
>>                                            default-cli of
>>                                                   goal
>>
>>
>> org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>>                                                   failed:
>>                              org.oasisopen.sca.ServiceRuntimeException:
>>                                            [Composite:
>>
>>      {http://docs.oasis-open.org/ns/opencsa/sca/200912},
>>                                            Component:
>>
>>  MessageInterpreterComponent] -
>>                       [ASM60033] No
>>                                     targets for
>>                                                   reference: Composite =
>>
>>      {http://docs.oasis-open.org/ns/opencsa/sca/200912}
>>                                            Reference =
>>
>>  messageInterpreterCallback -> [Help 1]
>>
>>                                                   I suspect that I am
>>                doing something
>>                       wrong
>>                              in the
>>                                            composite file.
>>                                                   I can't imagine I did
>>                something wrong in
>>                              the java
>>                                            sources. (See
>>                                                   below for the sources.)
>>
>>                                               Because the
>>                MessageInterpreterImpl class
>>                       doesn't
>>                                     contain any
>>                                               @Reference or
>>                                               @Property annotations,
>>                SCA creates implicit
>>                              references for
>>                                            all public
>>                                               setter methods in this
>>                class whose type is a
>>                              remotable SCA
>>                                               interface, and
>>                                               also for all public or
>>                protected fields
>>                       in this
>>                              class
>>                                     whose
>>                                            type is a
>>                                               remotable SCA interface.
>>
>>                                               There is a public setter
>>                method
>>
>> setMessageInterpreterCallback() and a
>>                                               protected field
>>                       messageInterpreterCallback, so SCA
>>                                     defines a
>>                                            reference
>>                                               named
>>                messageInterpreterCallback.  This
>>                              reference doesn't
>>                                            have a target
>>                                               configured in the
>>                composite, hence the error
>>                              message.
>>
>>                                               To fix the problem, you
>>                need to remove
>>                       the setter
>>                                     method (or
>>                                            make it
>>                                               protected) and change the
>>                field from
>>                       protected
>>                              to private.
>>
>>                                                Simon
>>
>>
>>                                                   Kind Regards,
>>
>>                                                   Urso
>>
>>
>>                                                   --------------------
>>                THE SERVICE
>>                       Interface With
>>                                     Callback
>>                                                   Interface association
>>                ----------
>>                                                   /**
>>                                                    *  */
>>                                                   package org.acme.logix;
>>
>>                                                   import
>>                org.acme.logix.message.Message;
>>                                                   import
>>                       org.oasisopen.sca.annotation.Callback;
>>                                                   import
>>                       org.oasisopen.sca.annotation.OneWay;
>>                                                   import
>>                       org.oasisopen.sca.annotation.Remotable;
>>
>>                                                   /**
>>                                                    *  *
>>                                                    */
>>                                                   @Remotable
>>
>> @Callback(MessageInterpreterCallback.class)
>>                                                   public interface
>>                MessageInterpreter {
>>
>>                                                   @OneWay
>>                                                   void
>>                interpret(Message msg);
>>                                                   }
>>
>>
>>                                                   /**
>>                                                    *  */
>>                                                   package org.acme.logix;
>>
>>                                                   import
>>                       org.oasisopen.sca.annotation.OneWay;
>>                                                   import
>>                       org.oasisopen.sca.annotation.Remotable;
>>
>>                                                   /**
>>                                                    *  *
>>                                                    */
>>                                                   @Remotable
>>                                                   public interface
>>                       MessageInterpreterCallback {
>>                                                   void
>>                onInterpret(Interpretation ipr);
>>                                                   }
>>
>>
>>                                                   ---------- THE CLIENT
>>                implementing
>>                       the callback
>>                                     interface
>>                                                   ------------
>>
>>                                                   /**
>>                                                    *  */
>>                                                   package org.acme.logix;
>>
>>                                                   import
>>                org.acme.logix.message.Message;
>>                                                   import
>>                       org.oasisopen.sca.annotation.Reference;
>>
>>                                                   /**
>>                                                    *  */
>>                                                   public class
>>                LogisticCenterImpl
>>                       implements
>>                                     LogisticCenter,
>>
>>  MessageInterpreterCallback {
>>                                                   private AuditService
>>                auditService;
>>                                                   @Reference
>>                                                   protected
>>                MessageInterpreter
>>                              messageInterpreter;
>>
>>                                                   /* (non-Javadoc)
>>                                                   * @see
>>
>>
>> org.acme.logix.LogisticCenter#processMessage(org.acme.logix.message.Message)
>>                                                   */
>>                                                   public void
>>                processMessage(Message
>>                       message) {
>>
>>  System.out.println("Processing
>>                       message with
>>                                     payload " +
>>                                                   message.getPayload() );
>>
>>  auditService.logSentMessage(message);
>>
>>  messageInterpreter.interpret(message);
>>                                                   }
>>
>>                                                   /**
>>                                                   * @return the
>>                auditService
>>                                                   */
>>                                                   public AuditService
>>                getAuditService() {
>>                                                   return auditService;
>>                                                   }
>>
>>                                                   /**
>>                                                   * @param auditService
>> the
>>                       auditService to set
>>                                                   */
>>                                                   @Reference
>>                                                   public void
>>                setAuditService(AuditService
>>                                     auditService) {
>>                                                   this.auditService =
>>                auditService;
>>                                                   }
>>
>>                                                   /**
>>                                                   * @param
>>                messageInterpreter the
>>                              messageInterpreter
>>                                     to set
>>                                                   */
>>                                                   public void
>>                              setMessageInterpreter(MessageInterpreter
>>                                                   messageInterpreter) {
>>                                                   this.messageInterpreter
>> =
>>                       messageInterpreter;
>>                                                   }
>>
>>                                                   /**
>>                                                   * @return the
>>                messageInterpreter
>>                                                   */
>>                                                   public
>> MessageInterpreter
>>                              getMessageInterpreter() {
>>                                                   return
>>                messageInterpreter;
>>                                                   }
>>
>>
>>                                                          /**
>>                                                          *  THE
>>                CALLBACK method of
>>                                     MessageInterpreterCallback
>>                                                   interface
>>                                                          */
>>                                                   public void
>>                       onInterpret(Interpretation ipr) {
>>
>>  System.out.println("Message has been
>>                              interpreted.");
>>                                                   }
>>
>>                                                   }
>>
>>
>>                                                   ---------THE SERVICE
>>                WHICH IS CALLED
>>                       BY THE
>>                              CLIENT
>>                                     THROUGH
>>                                                   WEBSERVICE BINDING
>>                ---------
>>
>>                                                   /**
>>                                                    *  */
>>                                                   package org.acme.logix;
>>
>>                                                   import
>>                org.acme.logix.message.Message;
>>                                                   import
>>                org.oasisopen.sca.RequestContext;
>>                                                   import
>>                       org.oasisopen.sca.ServiceReference;
>>                                                   import
>>                       org.oasisopen.sca.annotation.Callback;
>>                                                   import
>>                       org.oasisopen.sca.annotation.Context;
>>                                                   import
>>                       org.oasisopen.sca.annotation.Reference;
>>                                                   import
>>                       org.oasisopen.sca.annotation.Service;
>>
>>                                                   /**
>>                                                    *  *
>>                                                    */
>>                                                   public class
>>                MessageInterpreterImpl
>>                       implements
>>                                            MessageInterpreter{
>>
>>                                                   @Callback
>>                                                   protected
>>                MessageInterpreterCallback
>>                                            messageInterpreterCallback;
>>                                                   /* (non-Javadoc)
>>                                                   * @see
>>
>>
>> org.acme.logix.MessageInterpreter#interpret(org.acme.logix.message.Message)
>>                                                   */
>>                                                   public void
>>                interpret(Message msg) {
>>
>>  System.out.println("The message is being
>>                                     interpreted..");
>>                                                   Interpretation ipr = new
>>                       Interpretation();
>>
>> messageInterpreterCallback.onInterpret(ipr);
>>                                                   }
>>
>>
>>
>>                                                   /**
>>                                                   * @return the
>>                messageInterpreterCallback
>>                                                   */
>>                                                   public
>>                MessageInterpreterCallback
>>
>> getMessageInterpreterCallback() {
>>                                                   return
>>                messageInterpreterCallback;
>>                                                   }
>>
>>
>>
>>                                                   /**
>>                                                   * @param
>>                messageInterpreterCallback the
>>
>>  messageInterpreterCallback to set
>>                                                   */
>>                                                   public void
>>                       setMessageInterpreterCallback(
>>
>>  MessageInterpreterCallback
>>                                     messageInterpreterCallback) {
>>
>>  this.messageInterpreterCallback =
>>                                     messageInterpreterCallback;
>>                                                   }
>>                                                   }
>>
>>
>>
>>
>>
>>                                                   ---- THE COMPOSITE
>>                -----------
>>
>>
>>
>>                                                   <composite
>>
>> xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
>>
>>         targetNamespace="http://logistix"
>>
>>         xmlns:logistix="http://logistix"
>>
>>  name="AfnemerLogisticCenter">
>>
>>                                                      <component
>>                              name="AfnemerHandlingAgentComponent">
>>                                                   <implementation.java
>>
>> class="org.acme.logix.HandlingAgentImpl"/>
>>                                                            <reference
>>                       name="logisticCenter" >
>>                                                           <binding.ws
>>                <http://binding.ws>
>>                       <http://binding.ws> <http://binding.ws>
>>                              <http://binding.ws>
>>                                     <http://binding.ws>
>>                                            <http://binding.ws>
>>                <http://binding.ws>
>>
>>
>>                                   uri="
>> http://127.0.0.1:8087/AfnemerHandlingAgentComponent"/>
>>                                                            </reference>
>>                        <reference
>>                                     name="auditService"
>>
>>  target="AuditServiceComponent"/>
>>           </component>
>>
>>
>>
>>                                                      <component
>>                              name="AfnemerLogisticCenterComponent">
>>
>> <implementation.java
>>
>> class="org.acme.logix.LogisticCenterImpl"/>
>>                                                          <reference
>>                       name="messageInterpreter">
>>                                                   <interface.java
>>
>>  interface="org.acme.logix.MessageInterpreter"
>>
>>
>>  callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>
>>                                                   <binding.ws
>>                <http://binding.ws> <http://binding.ws>
>>                       <http://binding.ws>
>>                              <http://binding.ws>
>>                                     <http://binding.ws> <
>> http://binding.ws>
>>                                            <http://binding.ws>
>>
>>
>>                                   uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>                                                   <callback >
>>                                                   <binding.ws
>>                <http://binding.ws> <http://binding.ws>
>>                       <http://binding.ws>
>>                              <http://binding.ws>
>>                                     <http://binding.ws> <
>> http://binding.ws>
>>                                            <http://binding.ws>
>>
>>
>>             uri="http://localhost:8084/Client/MessageInterpreterCallback
>>
>>             <http://localhost:8081/Client/MessageInterpreterCallback>"
>>                />
>>
>>                                                   </callback>
>>                                                   </reference>
>>                                                          <reference
>>                       name="auditService">
>>                                        <binding.jms
>>
>>
>> initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>>
>>  jndiURL="tcp://localhost:61616">
>>                                                     <destination
>>                       jndiName="AuditServiceQueue" />
>>                                                     </binding.jms>
>>                </reference>
>>                                                           </component>
>>                                                          <component
>>                              name="MessageInterpreterComponent">
>>                                                       <implementation.java
>>
>> class="org.acme.logix.MessageInterpreterImpl"/>
>>                                                           <service
>>                       name="MessageInterpreter">
>>                                                   <interface.java
>>
>>  interface="org.acme.logix.MessageInterpreter"
>>
>>
>> callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>                                                   <binding.ws
>>                <http://binding.ws> <http://binding.ws>
>>                       <http://binding.ws>
>>                              <http://binding.ws>
>>                                     <http://binding.ws> <
>> http://binding.ws>
>>                                            <http://binding.ws>
>>
>>
>>                                    uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>                                                   <callback>
>>                                                   <binding.ws
>>                <http://binding.ws> <http://binding.ws>
>>                       <http://binding.ws>
>>                              <http://binding.ws>
>>                                     <http://binding.ws> <
>> http://binding.ws>
>>                                            <http://binding.ws>
>>
>>
>>             uri="http://localhost:8084/Client/MessageInterpreterCallback
>>
>>             <http://localhost:8081/Client/MessageInterpreterCallback>"/>
>>
>>                                                   </callback>
>>                                                   </service>
>>                                                      </component>
>>
>>
>>                                                      <component
>>                       name="AuditServiceComponent">
>>
>> <implementation.java
>>
>> class="org.acme.logix.AuditServiceImpl"/>
>>                                                                  <service
>>                       name="AuditService">
>>                                                              <binding.jms
>>
>>
>> initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>>
>>  jndiURL="tcp://localhost:61616">
>>                                                     <destination
>>                       jndiName="AuditServiceQueue" />
>>                                                   </binding.jms>
>>              </service>
>>                                                      </component>
>>                                                      </composite>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>

Re: Callback and Tuscany 2.0 Samples

Posted by Simon Nash <na...@apache.org>.
Urso Wieske wrote:
> Simon,
> 
> I added the dependencies AS PART OF the maven plugin dependency element. 
> (Dependencies element enclosed  in the build/plugins/plugin element).
> Then it should work!
> 
Hi Urso,
I've tried just about every possible combination of dependencies in the
build/plugin element, and I get errors every time.  What combination are
you using?

   Simon

> 
> Kind regards,
> Urso
> 
> 2011/1/16 Urso Wieske <uwieske@gmail.com <ma...@gmail.com>>
> 
>     Nope, I was mislead.  The maven plugin does not work. Only the
>     Testclass is working.
> 
>     Kind regards
>     Urso
> 
>     2011/1/16 Urso Wieske <uwieske@gmail.com <ma...@gmail.com>>
> 
>         Hi Simon,
> 
>         I have been studying the source code around SCA binding.ws
>         <http://binding.ws> extension.
>         As you mentioned earlier, the Tuscany SCA runtime  uses by
>         default de reference implementation of JAX-WS binding. 
> 
>         In the resource of binding-ws-runtime-jaxws-ri at the path
>         META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory:
> 
>         org.apache.tuscany.sca.binding.ws.jaxws.ri.JAXWSBindingProviderFactory;model=org.apache.tuscany.sca.binding.ws.WebServiceBinding
> 
>         you can indeed see that the Factory JAXWSBindingProviderFactory
>         is used as default.
> 
>         I believe -I have not digged into the code yet- that the
>         reference implementation is overridden as soon as the SCA
>         runtime finds an alternative binding.ws <http://binding.ws>
>         implementation on the classpath. 
>         I check this by just adding the Axis2 extension to my dependency
>         set and I the runtime appears switch automatically to Axis2.
> 
>         I manage to run my code with the maven plugin. I removed 
>                          <dependency>
>             <groupId>org.apache.tuscany.sca</groupId>
>             <artifactId>tuscany-node-impl</artifactId>
>             <version>2.0-Beta1</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.tuscany.sca</groupId>
>             <artifactId>tuscany-implementation-java-runtime</artifactId>
>             <version>2.0-Beta1</version>
>         </dependency>
> 
>         from my dependencyset and ran my code succesfully. 
>         I don't understand the "negative" effect of these two
>         dependencies on my code.
> 
>         Maybe you have some clarification for this?
> 
> 
>         Kind Regards,
>         Urso 
> 
>         2011/1/15 Simon Nash <nash@apache.org <ma...@apache.org>>
> 
>             Urso Wieske wrote:
> 
>                 Hi Simon,
> 
>                 Could you send me a copy of your POM which you have used
>                 /adapted?
>                 Also which public repositories are you using to download
>                 your Tuscany 2.0 Beta1 dependencies?
>                 (I have initially googled for a oublic maven repository
>                 where I could donwload the Tuscany v2 Beta1 dependencies.)
> 
>                 I replaced my base runtime for the 4 dependencies you
>                 have stated, but I get runtime exceptions due to other
>                 causes. Most probably I should have other dependencies
>                 too which you have not mentioned.
> 
>                 Kind regards.
>                 Urso
> 
>             Hi Urso,
>             My pom and JUnit test case are attached below.  The
>             repository URL
>             is included in the pom.
> 
>              Simon
> 
>             ----- begin pom -----
> 
>             <project xmlns="http://maven.apache.org/POM/4.0.0"
>             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>                    
>             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>             http://maven.apache.org/xsd/maven-4.0.0.xsd">
>                <modelVersion>4.0.0</modelVersion>
>                <parent>
>                    <groupId>org.apache.tuscany.sca</groupId>
>                    <artifactId>tuscany-sca</artifactId>
>                    <version>2.0-Beta1</version>
>                </parent>
>                <groupId>org.acme.logix</groupId>
>                <artifactId>handler-agent</artifactId>
>                <version>0.0.1-SNAPSHOT</version>
>                <packaging>jar</packaging>
> 
>                <name>handler-agent</name>
>                <url>http://maven.apache.org</url>
> 
>                <properties>
>                  
>              <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>                </properties>
> 
>                <repositories>
>                    <repository>
>                        <id>apache.staging</id>
>                      
>              <url>https://repository.apache.org/content/groups/staging</url>
>                    </repository>
>                </repositories>
> 
>                <build>
>                  
>              <finalName>afnemer-handling-agent-contribution</finalName>
>                    <plugins>
>                        <plugin>
>                          
>              <groupId>org.apache.tuscany.maven.plugins</groupId>
>                            <artifactId>maven-tuscany-plugin</artifactId>
>                            <version>2.0-Beta1</version>
>                            <dependencies>
>                                <dependency>
>                                    <groupId>org.apache.tuscany.sca</groupId>
>                                  
>              <artifactId>tuscany-binding-jms-runtime</artifactId>
>                                    <version>2.0-Beta1</version>
>                                </dependency>
> 
>                                <dependency>
>                                    <groupId>org.apache.activemq</groupId>
>                                    <artifactId>activemq-all</artifactId>
>                                    <version>5.3.0</version>
>                                    <scope>runtime</scope>
>                                </dependency>
>                            </dependencies>
>                        </plugin>
>                        <plugin>
>                            <groupId>org.apache.maven.plugins</groupId>
>                            <artifactId>maven-compiler-plugin</artifactId>
>                            <version>2.3.2</version>
>                            <configuration>
>                                <source>1.6</source>
>                                <target>1.6</target>
>                            </configuration>
>                        </plugin>
>                    </plugins>
>                </build>
>                <dependencies>
>                    <dependency>
>                        <groupId>org.apache.tuscany.sca</groupId>
>                        <artifactId>tuscany-feature-api</artifactId>
>                        <type>pom</type>
>                        <version>2.0-Beta1</version>
>                    </dependency>
> 
>                    <dependency>
>                        <groupId>org.apache.tuscany.sca</groupId>
>                        <artifactId>tuscany-binding-jms-runtime</artifactId>
>                        <version>2.0-Beta1</version>
>                    </dependency>
> 
>                    <dependency>
>                        <groupId>org.apache.activemq</groupId>
>                        <artifactId>activemq-all</artifactId>
>                        <version>5.3.0</version>
>                        <scope>runtime</scope>
>                    </dependency>
> 
>                   <dependency>
>                        <groupId>org.apache.tuscany.sca</groupId>
>                      
>              <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>                        <version>2.0-Beta1</version>
>                   </dependency>
> 
>                    <dependency>
>                        <groupId>org.apache.tuscany.sca</groupId>
>                        <artifactId>tuscany-host-jetty</artifactId>
>                        <version>2.0-Beta1</version>
>                    </dependency>
> 
>                    <dependency>
>                        <groupId>org.apache.tuscany.sca</groupId>
>                        <artifactId>tuscany-node-impl</artifactId>
>                        <version>2.0-Beta1</version>
>                    </dependency>
> 
>                    <dependency>
>                        <groupId>org.apache.tuscany.sca</groupId>
>                      
>              <artifactId>tuscany-implementation-java-runtime</artifactId>
>                        <version>2.0-Beta1</version>
>                    </dependency>
> 
>                    <dependency>
>                        <groupId>junit</groupId>
>                        <artifactId>junit</artifactId>
>                        <version>4.8.1</version>
>                        <scope>test</scope>
>                    </dependency>
>                </dependencies>
>             </project>
> 
>             ----- begin test case -----
> 
>             package acme;
> 
>             import org.apache.activemq.broker.BrokerService;
>             import org.apache.tuscany.sca.node.Contribution;
>             import org.apache.tuscany.sca.node.Node;
>             import org.apache.tuscany.sca.node.NodeFactory;
>             import org.junit.Test;
> 
>             public class CallbackTestCase {
> 
>                @Test
>                public void testSayHello() throws Exception {
> 
>                    // Start the JMS broker
>                    BrokerService jmsBroker = new BrokerService();
>                    jmsBroker.setPersistent(false);
>                    jmsBroker.setUseJmx(false);
>                    jmsBroker.addConnector("tcp://localhost:61616");
>                    jmsBroker.start();
> 
>                    // Start the Tuscany runtime with this module as the
>             contribution
>                    System.out.println("starting Tuscany runtime");
>                    Node node = NodeFactory.newInstance().createNode(new
>             Contribution("c1", "target/classes"));
>                    System.out.println("Tuscany runtime started");
> 
>                    // Start the Tuscany node. This also runs the
>             @EagerInit test method.
>                    node.start();
>                    System.out.println("Tuscany node started");
> 
>                    // Stop the Tuscany runtime
>                    node.stop();
> 
>                    // Stop the JMS broker
>                    jmsBroker.stop();
>                }
> 
>             }
> 
>             ----- end test case -----
> 
>              > 2011/1/15 Simon Nash <nash@apache.org
>             <ma...@apache.org> <mailto:nash@apache.org
>             <ma...@apache.org>>>
> 
> 
>                    Urso Wieske wrote:
> 
>                        Hi Simon,
> 
>                        Thanks for the quick response.
>                        That's a pitty that maven-tuscany-plugin is not
>                 behaving
>                        accordingly. It's a great instrument to use
>                 within my IDE
>                        (Eclipse). I'll submit an issue at the Tuscany
>                 projectsite. I
>                        will also dig into the "maven-tuscany-plugin"
>                 problem to figure
>                        out what is the cause of this deviation.
> 
>                    Hi Urso,
>                    I agree.  It should be possible to use
>                 maven-tuscany-plugin and
>                    replace things in the base runtime by alternative
>                 implementations.
>                    Maybe there is a way to do this, but I couldn't find one.
> 
>                     Simon
> 
>                        Kind Regards
>                        Urso
> 
> 
>                        2011/1/15 Simon Nash <nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>>
> 
>                           Urso Wieske wrote:
> 
>                               Hi Simon,
> 
>                               I have uploaded my sources as a zipped file.
> 
>                           Hi Urso,
>                           This problem is caused by a bug in Tuscany.
>                  Please raise a JIRA
>                           so that we can track and fix the problem.  In
>                 the meantime, I can
>                           suggest a partial workaround.
> 
>                           The injection failure only happens if Tuscany
>                 is using the
>                           tuscany-binding-ws-runtime-jaxws module as the
>                 runtime
>                        implementation
>                           for <binding.ws <http://binding.ws>
>                 <http://binding.ws> <http://binding.ws>>.  It
>                        doesn't happen if
>                           tuscany-binding-ws-runtime-axis2
>                           is used instead of
>                 tuscany-binding-ws-runtime-jaxws.  This
>                        implies that
>                           the problem is caused by a bug in the -jaxws
>                 version.
> 
>                           By default, Tuscany uses the -jaxws version.
>                  To get Tuscany
>                        to use
>                           the -axis2 version instead, you need to do special
>                        configuration in
>                           the pom.xml file.
> 
>                           Unfortunately I couldn't find a way to make
>                 this change when
>                        using
>                           maven-tuscany-plugin to run the application.
>                  This is because
>                           maven-tuscany-plugin has a dependency on
>                 tuscany-base-runtime.
>                           The tuscany-base-runtime jar contains the
>                 -jaxws version and
>                        seems
>                           to always use it even if the -axis2 version is
>                 declared as an
>                           additional dependency.
> 
>                           I did find a way to get Tuscany to use the
>                 -axis2 version
>                        when not
>                           using maven-tuscany-plugin.  If you replace
>                 this dependency:
>                            <dependency>
>                                <groupId>org.apache.tuscany.sca</groupId>
>                                <artifactId>tuscany-base-runtime</artifactId>
>                                <version>2.0-Beta1</version>
>                            </dependency>
> 
>                           by the following four dependencies:
>                            <dependency>
>                                <groupId>org.apache.tuscany.sca</groupId>
>                              
>                  <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>                                <version>2.0-Beta1</version>
>                            </dependency>
> 
>                            <dependency>
>                                <groupId>org.apache.tuscany.sca</groupId>
>                                <artifactId>tuscany-host-jetty</artifactId>
>                                <version>2.0-Beta1</version>
>                            </dependency>
> 
>                            <dependency>
>                                <groupId>org.apache.tuscany.sca</groupId>
>                                <artifactId>tuscany-node-impl</artifactId>
>                                <version>2.0-Beta1</version>
>                            </dependency>
> 
>                            <dependency>
>                                <groupId>org.apache.tuscany.sca</groupId>
>                              
>                  <artifactId>tuscany-implementation-java-runtime</artifactId>
>                                <version>2.0-Beta1</version>
>                            </dependency>
> 
>                           then the application runs successfully.  I
>                 used a maven JUnit
>                        test
>                           to verify this.
> 
>                            Simon
> 
>                               Hi Simon,
> 
>                               I adapted my code as you suggested. It
>                 seems like the
>                        error has
>                               dissappeared, but I got new ones. Well I
>                 removed the
>                        setter and
>                               getter of messageInterpreterCallback from
>                               MessageInterpreterImpl. Now my
>                 MessageInterpreterImpl class
>                               contains only the instance variable
>                        messageInterpreterCallback .
>                               I have made it a protected variable.
> 
>                               I get a HTTP Internal Server ( error 500).
>                               I am still missing something.SCA runtime
>                 is supposed
>                               "automatically" inject my callback
>                 instance in the
>                               messageInterpreterCallback member variable of
>                               MessageInterpreterImpl. The
>                 MessageInterpreterImpl needs
>                        to have
>                               a reference to some callback instance.
>                               I can;t seem to solve this problem.
> 
>                               This is the error....
>                               ---------------------------------------
>                               SEVERE: Exception invoking injector - null
>                               org.oasisopen.sca.ServiceRuntimeException:
>                 Exception invoking
>                               injector - null
>                               at
>                                    
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                               at
>                                    
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                               at
>                                    
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                               at
>                                    
>                  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                               at
>                                    
>                  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                               at
>                                    
>                  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                               at
>                                    
>                  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                               at
>                      
>                  com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                               at
>                 sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                               at
>                      
>                  com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                               at
>                                    
>                  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                               at
>                      
>                  com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                               at
>                      
>                  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                               at
>                                    
>                  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                               at
>                                    
>                  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                               at java.lang.Thread.run(Thread.java:662)
>                               Caused by:
>                              
>                 org.apache.tuscany.sca.core.factory.ObjectCreationException:
>                               Exception invoking injector - null
>                               at
>                                    
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>                               at
>                                    
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>                               ... 27 more
>                               Caused by: java.lang.NullPointerException
>                               at
>                                    
>                  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>                               at
>                                    
>                  org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>                               at
>                                    
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>                               ... 28 more
>                               10-jan-2011 1:39:26
>                                    
>                  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>                               processRequest
>                               SEVERE: The server sent HTTP status code
>                 500: Internal
>                        Server Error
>                              
>                 com.sun.xml.internal.ws.client.ClientTransportException: The
>                               server sent HTTP status code 500: Internal
>                 Server Error
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                               at
>                 com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>                               at
>                                    
>                  com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>                               at
>                                    
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>                               at
>                                    
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>                               at $Proxy50.interpret(Unknown Source)
>                               at
>                                    
>                  org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>                               at
>                 sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>                        Method)
>                               at
>                                    
>                  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>                               at
>                                    
>                  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>                               at
>                 java.lang.reflect.Method.invoke(Method.java:597)
>                               at
>                                    
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                               at
>                                    
>                  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                               at
>                                    
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                               at
>                                    
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                               at
>                                    
>                  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                               at
>                                    
>                  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                               at
>                                    
>                  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                               at
>                      
>                  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                               at
>                                    
>                  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                               at
>                                    
>                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                               at
>                      
>                  com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                               at
>                 sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                               at
>                      
>                  com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                               at
>                                    
>                  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                               at
>                      
>                  com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                               at
>                      
>                  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                               at
>                                    
>                  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                               at
>                                    
>                  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                               at java.lang.Thread.run(Thread.java:662)
>                               -----------------------------------------
>                                Hope you can help me. (?)
> 
>                               Kind Regards
>                               Urso
> 
> 
> 
> 
>                               2011/1/14 Simon Nash <nash@apache.org
>                 <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>                 <mailto:nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>>
>                               <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>>>
> 
> 
>                                  Hi Urso,
>                                  I'm starting to look at your project
>                 code now.
> 
>                                  It's important to keep these threads on
>                 the Tuscany
>                        mailing list
>                                  so that other members of the Tuscany
>                 community are
>                        included in
>                                  the discussion.  The Tuscany mailing
>                 list archives are an
>                               important
>                                  resource for Tuscany users who are
>                 experiencing a
>                        problem and are
>                                  looking to see if others have found a
>                 solution.  If a
>                        problem is
>                                  solved by a private message exchange
>                 instead of on the
>                        public
>                               list,
>                                  the knowledge of how to solve it is
>                 confined to one person
>                               instead
>                                  of being shared by the community.
> 
>                                  The best way to make this happen would
>                 be for you to
>                        resend your
>                                  recent private emails to the public
>                 list.  I'll look
>                        out for them
>                                  on the public list so that I can
>                 respond to them there.
> 
>                                   Simon
> 
>                                  Urso Wieske wrote:
> 
>                                      Hi Simon,
> 
>                                      You'll find in this email the
>                 zipped file
>                        containing my
>                               sourcecode.
> 
>                                      Unfortunately, I still have errors.
>                                      I changed the member variable from
>                 protected to
>                        private
>                               like you
>                                      suggested.
>                                      And created Getter and Setter for
>                 this member
>                        variable.
>                                      (messageInterpreterCallback).
>                                      I annotated the setter with @Callback.
>                                      I also removed the URI attribute
>                 from the
>                               callback/binding.ws <http://binding.ws>
>                 <http://binding.ws> <http://binding.ws>
>                                      <http://binding.ws>
>                 <http://binding.ws> element of the
>                               service
> 
>                                      according to your suggestion. Still
>                 problems.... :-(
> 
> 
>                                      I have zipped my source. It's an
>                 Eclipse project.
> 
>                                      I appreciate the fact that you are
>                 willing to
>                        verify this
>                               issue.
>                                      If you have any questions about the
>                 code, just let
>                        me know.
> 
>                                      Please checkout also if my POM is
>                 well specified with
>                               regard to
>                                      dependencies. Do I have the proper
>                 dependencies. I
>                        am using
>                                      Tuscany 2.0 Beta1.
> 
>                                      Kind Regards
>                                      Urso
> 
> 
>                                      2011/1/10 Simon Nash
>                 <nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>                               <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>
>                               <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>>>
>                                      <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>
>                               <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>>>>
> 
> 
>                                         Urso Wieske wrote:
> 
>                                             Hi Simon,
> 
>                                             I adapted my code as you
>                 suggested. It
>                        seems like the
>                                      error has
>                                             dissappeared, but I got new
>                 ones. Well I
>                        removed the
>                                      setter and
>                                             getter of
>                 messageInterpreterCallback from
>                                             MessageInterpreterImpl. Now my
>                               MessageInterpreterImpl class
>                                             contains only the instance
>                 variable
>                                      messageInterpreterCallback .
>                                             I have made it a protected
>                 variable.
> 
>                                         According to the SCA 1.1 specs,
>                 this variable
>                        should
>                               be private
>                                         in order to avoid having it
>                 treated as a reference.
>                                Can you try
>                                         changing this and see if it
>                 makes any difference?
> 
> 
>                                             I get a HTTP Internal Server
>                 ( error 500).
>                                             I am still missing
>                 something.SCA runtime is
>                        supposed
>                                             "automatically" inject my
>                 callback instance
>                        in the
>                                             messageInterpreterCallback
>                 member variable of
>                                             MessageInterpreterImpl. The
>                        MessageInterpreterImpl
>                               needs
>                                      to have
>                                             a reference to some callback
>                 instance.
>                                             I can;t seem to solve this
>                 problem.
> 
>                                          >From the stack trace it seems
>                 that the thread
>                        message
>                                      context doesn't
>                                         contain the callback endpoint.
>                  I'm not sure what
>                               could cause
>                                      this.
>                                         However I noticed a problem in
>                 your composite that
>                               would be worth
>                                         fixing, and it's just possible
>                 that this might be
>                               related to the
>                                         problem that you're seeing.
> 
>                                         The problem is that you have
>                 specified a
>                        callback URI
>                               for the
>                                         MessageInterpreter service in
>                               MessageInterpreterComponent, as
>                                      follows:
> 
>                                          <service name="MessageInterpreter">
>                                            <interface.java
>                               interface="org.acme.logix.MessageInterpreter"
>                                                                    
>                 callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>                                            <binding.ws
>                 <http://binding.ws> <http://binding.ws>
>                        <http://binding.ws> <http://binding.ws>
>                               <http://binding.ws>
> 
> 
>                                                            
>                  uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                                            <callback>
>                                              <binding.ws
>                 <http://binding.ws> <http://binding.ws>
>                        <http://binding.ws>
>                               <http://binding.ws> <http://binding.ws>
>                                                      
>                 uri="http://localhost:8084/Client/MessageInterpreterCallback"/>
>                                            </callback>
>                                          </service>
> 
>                                         There shouldn't be any callback
>                 URI in the service
>                                      definition, because
>                                         this information is provided at
>                 runtime by the
>                        client
>                                      invocation.  So
>                                         you should change the above to:
> 
>                                          <service name="MessageInterpreter">
>                                            <interface.java
>                               interface="org.acme.logix.MessageInterpreter"
>                                                                    
>                 callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>                                            <binding.ws
>                 <http://binding.ws> <http://binding.ws>
>                        <http://binding.ws> <http://binding.ws>
>                               <http://binding.ws>
> 
> 
>                                                            
>                  uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                                            <callback>
>                                              <binding.ws/
>                 <http://binding.ws/> <http://binding.ws/>
>                        <http://binding.ws/>
>                               <http://binding.ws/> <http://binding.ws/>>
> 
> 
>                                            </callback>
>                                          </service>
> 
>                                         If neither of these suggested
>                 changes fixes the
>                               problem, please
>                                         post the complete application as
>                 a zip file.
> 
>                                          Simon
> 
>                                             This is the error....
>                                            
>                 ---------------------------------------
>                                             SEVERE: Exception invoking
>                 injector - null
>                                            
>                 org.oasisopen.sca.ServiceRuntimeException:
>                               Exception invoking
>                                             injector - null
>                                             at
>                                                                
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                                             at
>                                                  
>                  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                                             at
>                                            
>                 com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                                             at
>                                            
>                 com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                                             at
>                                                  
>                  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                                             at
>                                            
>                 com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                                             at
>                              
>                 sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                                             at
>                                            
>                 com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                                             at
>                                                                
>                  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                                             at
>                                            
>                 com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                                             at
>                                                  
>                  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                                             at
>                                                                
>                  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                                             at
>                                                                
>                  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                                             at
>                 java.lang.Thread.run(Thread.java:662)
>                                             Caused by:
>                                                          
>                 org.apache.tuscany.sca.core.factory.ObjectCreationException:
>                                             Exception invoking injector
>                 - null
>                                             at
>                                                                
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>                                             ... 27 more
>                                             Caused by:
>                 java.lang.NullPointerException
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>                                             ... 28 more
>                                             10-jan-2011 1:39:26
>                                                                
>                  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>                                             processRequest
>                                             SEVERE: The server sent HTTP
>                 status code
>                        500: Internal
>                                      Server Error
>                                                          
>                 com.sun.xml.internal.ws.client.ClientTransportException: The
>                                             server sent HTTP status code
>                 500: Internal
>                        Server
>                               Error
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>                                             at
>                                                  
>                  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                                             at
>                                            
>                 com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                                             at
>                                            
>                 com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                                             at
>                                                  
>                  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                                             at
>                              
>                 com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>                                             at
>                 $Proxy50.interpret(Unknown Source)
>                                             at
>                                                                
>                  org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>                                             at
>                        sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>                                      Method)
>                                             at
>                                                                
>                  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>                                             at
>                                                                
>                  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>                                             at
>                        java.lang.reflect.Method.invoke(Method.java:597)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                                             at
>                                                                
>                  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                                             at
>                                                  
>                  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                                             at
>                                            
>                 com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                                             at
>                                            
>                 com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                                             at
>                                                  
>                  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                                             at
>                                                                
>                  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                                             at
>                                            
>                 com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                                             at
>                              
>                 sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                                             at
>                                            
>                 com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                                             at
>                                                                
>                  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                                             at
>                                            
>                 com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                                             at
>                                                  
>                  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                                             at
>                                                                
>                  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                                             at
>                                                                
>                  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                                             at
>                 java.lang.Thread.run(Thread.java:662)
>                                            
>                 -----------------------------------------
>                                              Hope you can help me. (?)
> 
>                                             Kind Regards
>                                             Urso
> 
>                                             2011/1/9 Simon Nash
>                 <nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>                               <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>>
>                                      <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>>
>                               <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>
>                                      <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>>>
>                                             <mailto:nash@apache.org
>                 <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>
>                 <mailto:nash@apache.org <ma...@apache.org>
>                        <mailto:nash@apache.org <ma...@apache.org>>>
>                               <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>>
>                                      <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>
>                               <mailto:nash@apache.org
>                 <ma...@apache.org> <mailto:nash@apache.org
>                 <ma...@apache.org>>
>                        <mailto:nash@apache.org <ma...@apache.org>
>                 <mailto:nash@apache.org <ma...@apache.org>>>>>>>
> 
> 
> 
>                                                Urso Wieske wrote:
> 
>                                                    Hi
>                                                    I am evaluating
>                 Tuscany 2.0 Beta1 and am
>                               trying to
>                                      learn more
>                                                    about Callbacks
>                 (Bi-Directional
>                        interface)
>                               of SCA
>                                      1.1. I
>                                                    downloaded the
>                 Tuscany Sample files and
>                               started to
>                                             explore the
>                                                    callback
>                 implementations with webservice
>                               binding,
>                                      i.e. the
>                                                    Search and
>                 SearchCallback interfaces.
>                                                    It took me a while
>                 before I realized
>                        that the
>                                      Tuscany SCA
>                                                    Samples were based on
>                 SCA v1.0.          Tuscany
>                               2.0 Beta1 is
>                                             based on
>                                                    the SCA v1.1 specs.
>                                                    After studying the
>                 sample sources, I
>                        have
>                               written
>                                      my own
>                                             callback.
> 
>                                                    Unfortunately, I kept
>                 on getting a
>                        runtime
>                                      exception after I
>                                                    installed and deployed my
>                        contribution. By the
>                                      way, I am
>                                             using
>                                                    Eclipse and the maven
>                 tuscany plugin.
> 
>                                                    I can't find the
>                 problem and hope if
>                               someone can
>                                      point me
>                                             in the
>                                                    right direction.
> 
>                                                    This is the error
>                 (printed on my
>                        console) I am
>                                      getting when I
>                                                    try to run my program:
>                                                    [ERROR] Failed to
>                 execute goal
>                                                                        
>                      
>                  org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>                                                    (default-cli) on
>                 project handler-agent:
>                               Execution
>                                             default-cli of
>                                                    goal
>                                                                        
>                      
>                  org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>                                                    failed:
>                               org.oasisopen.sca.ServiceRuntimeException:
>                                             [Composite:
>                                                                
>                  {http://docs.oasis-open.org/ns/opencsa/sca/200912},
>                                             Component:
>                                                  
>                  MessageInterpreterComponent] -
>                        [ASM60033] No
>                                      targets for
>                                                    reference: Composite =
>                                                                
>                  {http://docs.oasis-open.org/ns/opencsa/sca/200912}
>                                             Reference =
>                                                  
>                  messageInterpreterCallback -> [Help 1]
> 
>                                                    I suspect that I am
>                 doing something
>                        wrong
>                               in the
>                                             composite file.
>                                                    I can't imagine I did
>                 something wrong in
>                               the java
>                                             sources. (See
>                                                    below for the sources.)
> 
>                                                Because the
>                 MessageInterpreterImpl class
>                        doesn't
>                                      contain any
>                                                @Reference or
>                                                @Property annotations,
>                 SCA creates implicit
>                               references for
>                                             all public
>                                                setter methods in this
>                 class whose type is a
>                               remotable SCA
>                                                interface, and
>                                                also for all public or
>                 protected fields
>                        in this
>                               class
>                                      whose
>                                             type is a
>                                                remotable SCA interface.
> 
>                                                There is a public setter
>                 method
>                                            
>                 setMessageInterpreterCallback() and a
>                                                protected field
>                        messageInterpreterCallback, so SCA
>                                      defines a
>                                             reference
>                                                named
>                 messageInterpreterCallback.  This
>                               reference doesn't
>                                             have a target
>                                                configured in the
>                 composite, hence the error
>                               message.
> 
>                                                To fix the problem, you
>                 need to remove
>                        the setter
>                                      method (or
>                                             make it
>                                                protected) and change the
>                 field from
>                        protected
>                               to private.
> 
>                                                 Simon
> 
> 
>                                                    Kind Regards,
> 
>                                                    Urso
> 
> 
>                                                    --------------------
>                 THE SERVICE
>                        Interface With
>                                      Callback
>                                                    Interface association
>                 ----------
>                                                    /**
>                                                     *  */
>                                                    package org.acme.logix;
> 
>                                                    import
>                 org.acme.logix.message.Message;
>                                                    import
>                        org.oasisopen.sca.annotation.Callback;
>                                                    import
>                        org.oasisopen.sca.annotation.OneWay;
>                                                    import
>                        org.oasisopen.sca.annotation.Remotable;
> 
>                                                    /**
>                                                     *  *
>                                                     */
>                                                    @Remotable
>                                                          
>                 @Callback(MessageInterpreterCallback.class)
>                                                    public interface
>                 MessageInterpreter {
> 
>                                                    @OneWay
>                                                    void
>                 interpret(Message msg);
>                                                    }
> 
> 
>                                                    /**
>                                                     *  */
>                                                    package org.acme.logix;
> 
>                                                    import
>                        org.oasisopen.sca.annotation.OneWay;
>                                                    import
>                        org.oasisopen.sca.annotation.Remotable;
> 
>                                                    /**
>                                                     *  *
>                                                     */
>                                                    @Remotable
>                                                    public interface
>                        MessageInterpreterCallback {
>                                                    void
>                 onInterpret(Interpretation ipr);
>                                                    }
> 
> 
>                                                    ---------- THE CLIENT
>                 implementing
>                        the callback
>                                      interface
>                                                    ------------
> 
>                                                    /**
>                                                     *  */
>                                                    package org.acme.logix;
> 
>                                                    import
>                 org.acme.logix.message.Message;
>                                                    import
>                        org.oasisopen.sca.annotation.Reference;
> 
>                                                    /**
>                                                     *  */
>                                                    public class
>                 LogisticCenterImpl
>                        implements
>                                      LogisticCenter,
>                                                  
>                  MessageInterpreterCallback {
>                                                    private AuditService
>                 auditService;
>                                                    @Reference
>                                                    protected
>                 MessageInterpreter
>                               messageInterpreter;
> 
>                                                    /* (non-Javadoc)
>                                                    * @see
>                                                                        
>                      
>                  org.acme.logix.LogisticCenter#processMessage(org.acme.logix.message.Message)
>                                                    */
>                                                    public void
>                 processMessage(Message
>                        message) {
>                                                  
>                  System.out.println("Processing
>                        message with
>                                      payload " +
>                                                    message.getPayload() );
>                                                  
>                  auditService.logSentMessage(message);
>                                                  
>                  messageInterpreter.interpret(message);
>                                                    }
> 
>                                                    /**
>                                                    * @return the
>                 auditService
>                                                    */
>                                                    public AuditService
>                 getAuditService() {
>                                                    return auditService;
>                                                    }
> 
>                                                    /**
>                                                    * @param auditService the
>                        auditService to set
>                                                    */
>                                                    @Reference
>                                                    public void
>                 setAuditService(AuditService
>                                      auditService) {
>                                                    this.auditService =
>                 auditService;
>                                                    }
> 
>                                                    /**
>                                                    * @param
>                 messageInterpreter the
>                               messageInterpreter
>                                      to set
>                                                    */
>                                                    public void
>                               setMessageInterpreter(MessageInterpreter
>                                                    messageInterpreter) {
>                                                    this.messageInterpreter =
>                        messageInterpreter;
>                                                    }
> 
>                                                    /**
>                                                    * @return the
>                 messageInterpreter
>                                                    */
>                                                    public MessageInterpreter
>                               getMessageInterpreter() {
>                                                    return
>                 messageInterpreter;
>                                                    }
> 
> 
>                                                           /**
>                                                           *  THE
>                 CALLBACK method of
>                                      MessageInterpreterCallback
>                                                    interface
>                                                           */
>                                                    public void
>                        onInterpret(Interpretation ipr) {
>                                                  
>                  System.out.println("Message has been
>                               interpreted.");
>                                                    }
> 
>                                                    }
> 
> 
>                                                    ---------THE SERVICE
>                 WHICH IS CALLED
>                        BY THE
>                               CLIENT
>                                      THROUGH
>                                                    WEBSERVICE BINDING
>                 ---------
> 
>                                                    /**
>                                                     *  */
>                                                    package org.acme.logix;
> 
>                                                    import
>                 org.acme.logix.message.Message;
>                                                    import
>                 org.oasisopen.sca.RequestContext;
>                                                    import
>                        org.oasisopen.sca.ServiceReference;
>                                                    import
>                        org.oasisopen.sca.annotation.Callback;
>                                                    import
>                        org.oasisopen.sca.annotation.Context;
>                                                    import
>                        org.oasisopen.sca.annotation.Reference;
>                                                    import
>                        org.oasisopen.sca.annotation.Service;
> 
>                                                    /**
>                                                     *  *
>                                                     */
>                                                    public class
>                 MessageInterpreterImpl
>                        implements
>                                             MessageInterpreter{
> 
>                                                    @Callback
>                                                    protected
>                 MessageInterpreterCallback
>                                             messageInterpreterCallback;
>                                                    /* (non-Javadoc)
>                                                    * @see
>                                                                        
>                      
>                  org.acme.logix.MessageInterpreter#interpret(org.acme.logix.message.Message)
>                                                    */
>                                                    public void
>                 interpret(Message msg) {
>                                                  
>                  System.out.println("The message is being
>                                      interpreted..");
>                                                    Interpretation ipr = new
>                        Interpretation();
>                                                          
>                 messageInterpreterCallback.onInterpret(ipr);
>                                                    }
> 
> 
> 
>                                                    /**
>                                                    * @return the
>                 messageInterpreterCallback
>                                                    */
>                                                    public
>                 MessageInterpreterCallback
>                                            
>                 getMessageInterpreterCallback() {
>                                                    return
>                 messageInterpreterCallback;
>                                                    }
> 
> 
> 
>                                                    /**
>                                                    * @param
>                 messageInterpreterCallback the
>                                                  
>                  messageInterpreterCallback to set
>                                                    */
>                                                    public void
>                        setMessageInterpreterCallback(
>                                                  
>                  MessageInterpreterCallback
>                                      messageInterpreterCallback) {
>                                                  
>                  this.messageInterpreterCallback =
>                                      messageInterpreterCallback;
>                                                    }
>                                                    }
> 
> 
> 
> 
> 
>                                                    ---- THE COMPOSITE
>                 -----------
> 
> 
> 
>                                                    <composite
>                                                          
>                 xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
>                                                                    
>                 targetNamespace="http://logistix"
>                                                                    
>                 xmlns:logistix="http://logistix"
>                                                            
>                  name="AfnemerLogisticCenter">
> 
>                                                       <component
>                               name="AfnemerHandlingAgentComponent">
>                                                    <implementation.java
>                                            
>                 class="org.acme.logix.HandlingAgentImpl"/>
>                                                             <reference
>                        name="logisticCenter" >
>                                                            <binding.ws
>                 <http://binding.ws>
>                        <http://binding.ws> <http://binding.ws>
>                               <http://binding.ws>
>                                      <http://binding.ws>
>                                             <http://binding.ws>
>                 <http://binding.ws>
> 
>                                                                        
>                      
>                  uri="http://127.0.0.1:8087/AfnemerHandlingAgentComponent"/>
>                                                             </reference>
>                         <reference
>                                      name="auditService"
>                                                  
>                  target="AuditServiceComponent"/>                      
>                                </component>
> 
> 
> 
>                                                       <component
>                               name="AfnemerLogisticCenterComponent">
>                                                          
>                 <implementation.java
>                                                          
>                 class="org.acme.logix.LogisticCenterImpl"/>
>                                                           <reference
>                        name="messageInterpreter">
>                                                    <interface.java
>                                                  
>                  interface="org.acme.logix.MessageInterpreter"          
>                                                                        
>                                          
>                 callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
> 
>                                                    <binding.ws
>                 <http://binding.ws> <http://binding.ws>
>                        <http://binding.ws>
>                               <http://binding.ws>
>                                      <http://binding.ws> <http://binding.ws>
>                                             <http://binding.ws>
> 
>                                                                        
>                      
>                  uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                                                    <callback >
>                                                    <binding.ws
>                 <http://binding.ws> <http://binding.ws>
>                        <http://binding.ws>
>                               <http://binding.ws>
>                                      <http://binding.ws> <http://binding.ws>
>                                             <http://binding.ws>
> 
>                                                                        
>                 uri="http://localhost:8084/Client/MessageInterpreterCallback
>                                                                        
>                 <http://localhost:8081/Client/MessageInterpreterCallback>"
>                 />
> 
>                                                    </callback>
>                                                    </reference>
>                                                           <reference
>                        name="auditService">                            
>                                             <binding.jms
>                                                                        
>                      
>                  initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>                                                  
>                  jndiURL="tcp://localhost:61616">
>                                                      <destination
>                        jndiName="AuditServiceQueue" />
>                                                      </binding.jms>    
>                     </reference>
>                                                            </component>
>                                                           <component
>                               name="MessageInterpreterComponent">
>                                                        <implementation.java
>                                                          
>                 class="org.acme.logix.MessageInterpreterImpl"/>
>                                                            <service
>                        name="MessageInterpreter">
>                                                    <interface.java
>                                    
>                  interface="org.acme.logix.MessageInterpreter"
>                                                                        
>                                          
>                  callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>                                                    <binding.ws
>                 <http://binding.ws> <http://binding.ws>
>                        <http://binding.ws>
>                               <http://binding.ws>
>                                      <http://binding.ws> <http://binding.ws>
>                                             <http://binding.ws>
> 
>                                                                        
>                        
>                 uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                                                    <callback>
>                                                    <binding.ws
>                 <http://binding.ws> <http://binding.ws>
>                        <http://binding.ws>
>                               <http://binding.ws>
>                                      <http://binding.ws> <http://binding.ws>
>                                             <http://binding.ws>
> 
>                                                                        
>                 uri="http://localhost:8084/Client/MessageInterpreterCallback
>                                                                        
>                 <http://localhost:8081/Client/MessageInterpreterCallback>"/>
> 
>                                                    </callback>
>                                                    </service>
>                                                       </component>
> 
> 
>                                                       <component
>                        name="AuditServiceComponent">
>                                                          
>                 <implementation.java
>                                                          
>                 class="org.acme.logix.AuditServiceImpl"/>
>                                                                   <service
>                        name="AuditService">
>                                                               <binding.jms
>                                                                        
>                      
>                  initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>                                                  
>                  jndiURL="tcp://localhost:61616">
>                                                      <destination
>                        jndiName="AuditServiceQueue" />
>                                                    </binding.jms>      
>                   </service>
>                                                       </component>
>                                                       </composite>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 


Re: Callback and Tuscany 2.0 Samples

Posted by Urso Wieske <uw...@gmail.com>.
Simon,

I added the dependencies AS PART OF the maven plugin dependency element.
(Dependencies element enclosed  in the build/plugins/plugin element).
Then it should work!


Kind regards,
Urso

2011/1/16 Urso Wieske <uw...@gmail.com>

> Nope, I was mislead.  The maven plugin does not work. Only the Testclass is
> working.
>
> Kind regards
> Urso
>
> 2011/1/16 Urso Wieske <uw...@gmail.com>
>
> Hi Simon,
>>
>> I have been studying the source code around SCA binding.ws extension.
>> As you mentioned earlier, the Tuscany SCA runtime  uses by default de
>> reference implementation of JAX-WS binding.
>>
>> In the resource of binding-ws-runtime-jaxws-ri at the path
>> META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory:
>>
>>
>> org.apache.tuscany.sca.binding.ws.jaxws.ri.JAXWSBindingProviderFactory;model=org.apache.tuscany.sca.binding.ws.WebServiceBinding
>>
>> you can indeed see that the Factory JAXWSBindingProviderFactory is used as
>> default.
>>
>> I believe -I have not digged into the code yet- that the reference
>> implementation is overridden as soon as the SCA runtime finds an alternative
>> binding.ws implementation on the classpath.
>> I check this by just adding the Axis2 extension to my dependency set and I
>> the runtime appears switch automatically to Axis2.
>>
>> I manage to run my code with the maven plugin. I removed
>>                   <dependency>
>>      <groupId>org.apache.tuscany.sca</groupId>
>>      <artifactId>tuscany-node-impl</artifactId>
>>      <version>2.0-Beta1</version>
>>  </dependency>
>>   <dependency>
>>      <groupId>org.apache.tuscany.sca</groupId>
>>      <artifactId>tuscany-implementation-java-runtime</artifactId>
>>      <version>2.0-Beta1</version>
>>  </dependency>
>>
>> from my dependencyset and ran my code succesfully.
>> I don't understand the "negative" effect of these two dependencies on my
>> code.
>>
>> Maybe you have some clarification for this?
>>
>>
>> Kind Regards,
>> Urso
>>
>> 2011/1/15 Simon Nash <na...@apache.org>
>>
>>> Urso Wieske wrote:
>>>
>>>> Hi Simon,
>>>>
>>>> Could you send me a copy of your POM which you have used /adapted?
>>>> Also which public repositories are you using to download your Tuscany
>>>> 2.0 Beta1 dependencies?
>>>> (I have initially googled for a oublic maven repository where I could
>>>> donwload the Tuscany v2 Beta1 dependencies.)
>>>>
>>>> I replaced my base runtime for the 4 dependencies you have stated, but I
>>>> get runtime exceptions due to other causes. Most probably I should have
>>>> other dependencies too which you have not mentioned.
>>>>
>>>> Kind regards.
>>>> Urso
>>>>
>>>>  Hi Urso,
>>> My pom and JUnit test case are attached below.  The repository URL
>>> is included in the pom.
>>>
>>>  Simon
>>>
>>> ----- begin pom -----
>>>
>>> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
>>> http://www.w3.org/2001/XMLSchema-instance"
>>>         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>>>    <modelVersion>4.0.0</modelVersion>
>>>    <parent>
>>>        <groupId>org.apache.tuscany.sca</groupId>
>>>        <artifactId>tuscany-sca</artifactId>
>>>        <version>2.0-Beta1</version>
>>>    </parent>
>>>    <groupId>org.acme.logix</groupId>
>>>    <artifactId>handler-agent</artifactId>
>>>    <version>0.0.1-SNAPSHOT</version>
>>>    <packaging>jar</packaging>
>>>
>>>    <name>handler-agent</name>
>>>    <url>http://maven.apache.org</url>
>>>
>>>    <properties>
>>>        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>>>    </properties>
>>>
>>>    <repositories>
>>>        <repository>
>>>            <id>apache.staging</id>
>>>            <url>https://repository.apache.org/content/groups/staging
>>> </url>
>>>        </repository>
>>>    </repositories>
>>>
>>>    <build>
>>>        <finalName>afnemer-handling-agent-contribution</finalName>
>>>        <plugins>
>>>            <plugin>
>>>                <groupId>org.apache.tuscany.maven.plugins</groupId>
>>>                <artifactId>maven-tuscany-plugin</artifactId>
>>>                <version>2.0-Beta1</version>
>>>                <dependencies>
>>>                    <dependency>
>>>                        <groupId>org.apache.tuscany.sca</groupId>
>>>
>>>  <artifactId>tuscany-binding-jms-runtime</artifactId>
>>>                        <version>2.0-Beta1</version>
>>>                    </dependency>
>>>
>>>                    <dependency>
>>>                        <groupId>org.apache.activemq</groupId>
>>>                        <artifactId>activemq-all</artifactId>
>>>                        <version>5.3.0</version>
>>>                        <scope>runtime</scope>
>>>                    </dependency>
>>>                </dependencies>
>>>            </plugin>
>>>            <plugin>
>>>                <groupId>org.apache.maven.plugins</groupId>
>>>                <artifactId>maven-compiler-plugin</artifactId>
>>>                <version>2.3.2</version>
>>>                <configuration>
>>>                    <source>1.6</source>
>>>                    <target>1.6</target>
>>>                </configuration>
>>>            </plugin>
>>>        </plugins>
>>>    </build>
>>>    <dependencies>
>>>        <dependency>
>>>            <groupId>org.apache.tuscany.sca</groupId>
>>>            <artifactId>tuscany-feature-api</artifactId>
>>>            <type>pom</type>
>>>            <version>2.0-Beta1</version>
>>>        </dependency>
>>>
>>>        <dependency>
>>>            <groupId>org.apache.tuscany.sca</groupId>
>>>            <artifactId>tuscany-binding-jms-runtime</artifactId>
>>>            <version>2.0-Beta1</version>
>>>        </dependency>
>>>
>>>        <dependency>
>>>            <groupId>org.apache.activemq</groupId>
>>>            <artifactId>activemq-all</artifactId>
>>>            <version>5.3.0</version>
>>>            <scope>runtime</scope>
>>>        </dependency>
>>>
>>>       <dependency>
>>>            <groupId>org.apache.tuscany.sca</groupId>
>>>            <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>>>            <version>2.0-Beta1</version>
>>>       </dependency>
>>>
>>>        <dependency>
>>>            <groupId>org.apache.tuscany.sca</groupId>
>>>            <artifactId>tuscany-host-jetty</artifactId>
>>>            <version>2.0-Beta1</version>
>>>        </dependency>
>>>
>>>        <dependency>
>>>            <groupId>org.apache.tuscany.sca</groupId>
>>>            <artifactId>tuscany-node-impl</artifactId>
>>>            <version>2.0-Beta1</version>
>>>        </dependency>
>>>
>>>        <dependency>
>>>            <groupId>org.apache.tuscany.sca</groupId>
>>>            <artifactId>tuscany-implementation-java-runtime</artifactId>
>>>            <version>2.0-Beta1</version>
>>>        </dependency>
>>>
>>>        <dependency>
>>>            <groupId>junit</groupId>
>>>            <artifactId>junit</artifactId>
>>>            <version>4.8.1</version>
>>>            <scope>test</scope>
>>>        </dependency>
>>>    </dependencies>
>>> </project>
>>>
>>> ----- begin test case -----
>>>
>>> package acme;
>>>
>>> import org.apache.activemq.broker.BrokerService;
>>> import org.apache.tuscany.sca.node.Contribution;
>>> import org.apache.tuscany.sca.node.Node;
>>> import org.apache.tuscany.sca.node.NodeFactory;
>>> import org.junit.Test;
>>>
>>> public class CallbackTestCase {
>>>
>>>    @Test
>>>    public void testSayHello() throws Exception {
>>>
>>>        // Start the JMS broker
>>>        BrokerService jmsBroker = new BrokerService();
>>>        jmsBroker.setPersistent(false);
>>>        jmsBroker.setUseJmx(false);
>>>        jmsBroker.addConnector("tcp://localhost:61616");
>>>        jmsBroker.start();
>>>
>>>        // Start the Tuscany runtime with this module as the contribution
>>>        System.out.println("starting Tuscany runtime");
>>>        Node node = NodeFactory.newInstance().createNode(new
>>> Contribution("c1", "target/classes"));
>>>        System.out.println("Tuscany runtime started");
>>>
>>>        // Start the Tuscany node. This also runs the @EagerInit test
>>> method.
>>>        node.start();
>>>        System.out.println("Tuscany node started");
>>>
>>>        // Stop the Tuscany runtime
>>>        node.stop();
>>>
>>>        // Stop the JMS broker
>>>        jmsBroker.stop();
>>>    }
>>>
>>> }
>>>
>>> ----- end test case -----
>>>
>>>  > 2011/1/15 Simon Nash <nash@apache.org <ma...@apache.org>>
>>>
>>>>
>>>>    Urso Wieske wrote:
>>>>
>>>>        Hi Simon,
>>>>
>>>>        Thanks for the quick response.
>>>>        That's a pitty that maven-tuscany-plugin is not behaving
>>>>        accordingly. It's a great instrument to use within my IDE
>>>>        (Eclipse). I'll submit an issue at the Tuscany projectsite. I
>>>>        will also dig into the "maven-tuscany-plugin" problem to figure
>>>>        out what is the cause of this deviation.
>>>>
>>>>    Hi Urso,
>>>>    I agree.  It should be possible to use maven-tuscany-plugin and
>>>>    replace things in the base runtime by alternative implementations.
>>>>    Maybe there is a way to do this, but I couldn't find one.
>>>>
>>>>     Simon
>>>>
>>>>        Kind Regards
>>>>        Urso
>>>>
>>>>
>>>>        2011/1/15 Simon Nash <nash@apache.org <ma...@apache.org>
>>>>        <mailto:nash@apache.org <ma...@apache.org>>>
>>>>
>>>>           Urso Wieske wrote:
>>>>
>>>>               Hi Simon,
>>>>
>>>>               I have uploaded my sources as a zipped file.
>>>>
>>>>           Hi Urso,
>>>>           This problem is caused by a bug in Tuscany.  Please raise a
>>>> JIRA
>>>>           so that we can track and fix the problem.  In the meantime, I
>>>> can
>>>>           suggest a partial workaround.
>>>>
>>>>           The injection failure only happens if Tuscany is using the
>>>>           tuscany-binding-ws-runtime-jaxws module as the runtime
>>>>        implementation
>>>>           for <binding.ws <http://binding.ws> <http://binding.ws>>.  It
>>>>        doesn't happen if
>>>>           tuscany-binding-ws-runtime-axis2
>>>>           is used instead of tuscany-binding-ws-runtime-jaxws.  This
>>>>        implies that
>>>>           the problem is caused by a bug in the -jaxws version.
>>>>
>>>>           By default, Tuscany uses the -jaxws version.  To get Tuscany
>>>>        to use
>>>>           the -axis2 version instead, you need to do special
>>>>        configuration in
>>>>           the pom.xml file.
>>>>
>>>>           Unfortunately I couldn't find a way to make this change when
>>>>        using
>>>>           maven-tuscany-plugin to run the application.  This is because
>>>>           maven-tuscany-plugin has a dependency on tuscany-base-runtime.
>>>>           The tuscany-base-runtime jar contains the -jaxws version and
>>>>        seems
>>>>           to always use it even if the -axis2 version is declared as an
>>>>           additional dependency.
>>>>
>>>>           I did find a way to get Tuscany to use the -axis2 version
>>>>        when not
>>>>           using maven-tuscany-plugin.  If you replace this dependency:
>>>>            <dependency>
>>>>                <groupId>org.apache.tuscany.sca</groupId>
>>>>                <artifactId>tuscany-base-runtime</artifactId>
>>>>                <version>2.0-Beta1</version>
>>>>            </dependency>
>>>>
>>>>           by the following four dependencies:
>>>>            <dependency>
>>>>                <groupId>org.apache.tuscany.sca</groupId>
>>>>                <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>>>>                <version>2.0-Beta1</version>
>>>>            </dependency>
>>>>
>>>>            <dependency>
>>>>                <groupId>org.apache.tuscany.sca</groupId>
>>>>                <artifactId>tuscany-host-jetty</artifactId>
>>>>                <version>2.0-Beta1</version>
>>>>            </dependency>
>>>>
>>>>            <dependency>
>>>>                <groupId>org.apache.tuscany.sca</groupId>
>>>>                <artifactId>tuscany-node-impl</artifactId>
>>>>                <version>2.0-Beta1</version>
>>>>            </dependency>
>>>>
>>>>            <dependency>
>>>>                <groupId>org.apache.tuscany.sca</groupId>
>>>>
>>>>  <artifactId>tuscany-implementation-java-runtime</artifactId>
>>>>                <version>2.0-Beta1</version>
>>>>            </dependency>
>>>>
>>>>           then the application runs successfully.  I used a maven JUnit
>>>>        test
>>>>           to verify this.
>>>>
>>>>            Simon
>>>>
>>>>               Hi Simon,
>>>>
>>>>               I adapted my code as you suggested. It seems like the
>>>>        error has
>>>>               dissappeared, but I got new ones. Well I removed the
>>>>        setter and
>>>>               getter of messageInterpreterCallback from
>>>>               MessageInterpreterImpl. Now my MessageInterpreterImpl
>>>> class
>>>>               contains only the instance variable
>>>>        messageInterpreterCallback .
>>>>               I have made it a protected variable.
>>>>
>>>>               I get a HTTP Internal Server ( error 500).
>>>>               I am still missing something.SCA runtime is supposed
>>>>               "automatically" inject my callback instance in the
>>>>               messageInterpreterCallback member variable of
>>>>               MessageInterpreterImpl. The MessageInterpreterImpl needs
>>>>        to have
>>>>               a reference to some callback instance.
>>>>               I can;t seem to solve this problem.
>>>>
>>>>               This is the error....
>>>>               ---------------------------------------
>>>>               SEVERE: Exception invoking injector - null
>>>>               org.oasisopen.sca.ServiceRuntimeException: Exception
>>>> invoking
>>>>               injector - null
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>>>               at
>>>>        com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>>>               at
>>>>        com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>>>               at
>>>>        com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>>>               at
>>>>        com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>>>               at
>>>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>>>               at
>>>> sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>>>               at
>>>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>>>               at
>>>>
>>>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>>>               at
>>>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>>>               at
>>>>        sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>>>               at
>>>>
>>>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>>>               at
>>>>
>>>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>>>               at java.lang.Thread.run(Thread.java:662)
>>>>               Caused by:
>>>>
>>>> org.apache.tuscany.sca.core.factory.ObjectCreationException:
>>>>               Exception invoking injector - null
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>>>>               ... 27 more
>>>>               Caused by: java.lang.NullPointerException
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>>>>               ... 28 more
>>>>               10-jan-2011 1:39:26
>>>>
>>>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>>>>               processRequest
>>>>               SEVERE: The server sent HTTP status code 500: Internal
>>>>        Server Error
>>>>               com.sun.xml.internal.ws.client.ClientTransportException:
>>>> The
>>>>               server sent HTTP status code 500: Internal Server Error
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>>>>               at
>>>>        com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>>>               at
>>>>        com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>>>               at
>>>>        com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>>>               at
>>>>        com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>>>               at
>>>> com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>>>>               at $Proxy50.interpret(Unknown Source)
>>>>               at
>>>>
>>>>  org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>>>>               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>>        Method)
>>>>               at
>>>>
>>>>  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>               at
>>>>
>>>>  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>               at java.lang.reflect.Method.invoke(Method.java:597)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>>>               at
>>>>
>>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>>>               at
>>>>        com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>>>               at
>>>>        com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>>>               at
>>>>        com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>>>               at
>>>>        com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>>>               at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>>>               at
>>>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>>>               at
>>>> sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>>>               at
>>>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>>>               at
>>>>
>>>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>>>               at
>>>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>>>               at
>>>>        sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>>>               at
>>>>
>>>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>>>               at
>>>>
>>>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>>>               at java.lang.Thread.run(Thread.java:662)
>>>>               -----------------------------------------
>>>>                Hope you can help me. (?)
>>>>
>>>>               Kind Regards
>>>>               Urso
>>>>
>>>>
>>>>
>>>>
>>>>               2011/1/14 Simon Nash <nash@apache.org
>>>>        <ma...@apache.org> <mailto:nash@apache.org
>>>>        <ma...@apache.org>>
>>>>               <mailto:nash@apache.org <ma...@apache.org>
>>>>        <mailto:nash@apache.org <ma...@apache.org>>>>
>>>>
>>>>
>>>>                  Hi Urso,
>>>>                  I'm starting to look at your project code now.
>>>>
>>>>                  It's important to keep these threads on the Tuscany
>>>>        mailing list
>>>>                  so that other members of the Tuscany community are
>>>>        included in
>>>>                  the discussion.  The Tuscany mailing list archives are
>>>> an
>>>>               important
>>>>                  resource for Tuscany users who are experiencing a
>>>>        problem and are
>>>>                  looking to see if others have found a solution.  If a
>>>>        problem is
>>>>                  solved by a private message exchange instead of on the
>>>>        public
>>>>               list,
>>>>                  the knowledge of how to solve it is confined to one
>>>> person
>>>>               instead
>>>>                  of being shared by the community.
>>>>
>>>>                  The best way to make this happen would be for you to
>>>>        resend your
>>>>                  recent private emails to the public list.  I'll look
>>>>        out for them
>>>>                  on the public list so that I can respond to them there.
>>>>
>>>>                   Simon
>>>>
>>>>                  Urso Wieske wrote:
>>>>
>>>>                      Hi Simon,
>>>>
>>>>                      You'll find in this email the zipped file
>>>>        containing my
>>>>               sourcecode.
>>>>
>>>>                      Unfortunately, I still have errors.
>>>>                      I changed the member variable from protected to
>>>>        private
>>>>               like you
>>>>                      suggested.
>>>>                      And created Getter and Setter for this member
>>>>        variable.
>>>>                      (messageInterpreterCallback).
>>>>                      I annotated the setter with @Callback.
>>>>                      I also removed the URI attribute from the
>>>>               callback/binding.ws <http://binding.ws> <
>>>> http://binding.ws>
>>>>                      <http://binding.ws> <http://binding.ws> element of
>>>> the
>>>>               service
>>>>
>>>>                      according to your suggestion. Still problems....
>>>> :-(
>>>>
>>>>
>>>>                      I have zipped my source. It's an Eclipse project.
>>>>
>>>>                      I appreciate the fact that you are willing to
>>>>        verify this
>>>>               issue.
>>>>                      If you have any questions about the code, just let
>>>>        me know.
>>>>
>>>>                      Please checkout also if my POM is well specified
>>>> with
>>>>               regard to
>>>>                      dependencies. Do I have the proper dependencies. I
>>>>        am using
>>>>                      Tuscany 2.0 Beta1.
>>>>
>>>>                      Kind Regards
>>>>                      Urso
>>>>
>>>>
>>>>                      2011/1/10 Simon Nash <nash@apache.org
>>>>        <ma...@apache.org>
>>>>               <mailto:nash@apache.org <ma...@apache.org>>
>>>>        <mailto:nash@apache.org <ma...@apache.org>
>>>>               <mailto:nash@apache.org <ma...@apache.org>>>
>>>>                      <mailto:nash@apache.org <ma...@apache.org>
>>>>        <mailto:nash@apache.org <ma...@apache.org>>
>>>>               <mailto:nash@apache.org <ma...@apache.org>
>>>>        <mailto:nash@apache.org <ma...@apache.org>>>>>
>>>>
>>>>
>>>>                         Urso Wieske wrote:
>>>>
>>>>                             Hi Simon,
>>>>
>>>>                             I adapted my code as you suggested. It
>>>>        seems like the
>>>>                      error has
>>>>                             dissappeared, but I got new ones. Well I
>>>>        removed the
>>>>                      setter and
>>>>                             getter of messageInterpreterCallback from
>>>>                             MessageInterpreterImpl. Now my
>>>>               MessageInterpreterImpl class
>>>>                             contains only the instance variable
>>>>                      messageInterpreterCallback .
>>>>                             I have made it a protected variable.
>>>>
>>>>                         According to the SCA 1.1 specs, this variable
>>>>        should
>>>>               be private
>>>>                         in order to avoid having it treated as a
>>>> reference.
>>>>                Can you try
>>>>                         changing this and see if it makes any
>>>> difference?
>>>>
>>>>
>>>>                             I get a HTTP Internal Server ( error 500).
>>>>                             I am still missing something.SCA runtime is
>>>>        supposed
>>>>                             "automatically" inject my callback instance
>>>>        in the
>>>>                             messageInterpreterCallback member variable
>>>> of
>>>>                             MessageInterpreterImpl. The
>>>>        MessageInterpreterImpl
>>>>               needs
>>>>                      to have
>>>>                             a reference to some callback instance.
>>>>                             I can;t seem to solve this problem.
>>>>
>>>>                          >From the stack trace it seems that the thread
>>>>        message
>>>>                      context doesn't
>>>>                         contain the callback endpoint.  I'm not sure
>>>> what
>>>>               could cause
>>>>                      this.
>>>>                         However I noticed a problem in your composite
>>>> that
>>>>               would be worth
>>>>                         fixing, and it's just possible that this might
>>>> be
>>>>               related to the
>>>>                         problem that you're seeing.
>>>>
>>>>                         The problem is that you have specified a
>>>>        callback URI
>>>>               for the
>>>>                         MessageInterpreter service in
>>>>               MessageInterpreterComponent, as
>>>>                      follows:
>>>>
>>>>                          <service name="MessageInterpreter">
>>>>                            <interface.java
>>>>               interface="org.acme.logix.MessageInterpreter"
>>>>
>>>> callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>>>                            <binding.ws <http://binding.ws>
>>>>        <http://binding.ws> <http://binding.ws>
>>>>               <http://binding.ws>
>>>>
>>>>
>>>>                                              uri="
>>>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>>>                            <callback>
>>>>                              <binding.ws <http://binding.ws>
>>>>        <http://binding.ws>
>>>>               <http://binding.ws> <http://binding.ws>
>>>>                                       uri="
>>>> http://localhost:8084/Client/MessageInterpreterCallback"/>
>>>>                            </callback>
>>>>                          </service>
>>>>
>>>>                         There shouldn't be any callback URI in the
>>>> service
>>>>                      definition, because
>>>>                         this information is provided at runtime by the
>>>>        client
>>>>                      invocation.  So
>>>>                         you should change the above to:
>>>>
>>>>                          <service name="MessageInterpreter">
>>>>                            <interface.java
>>>>               interface="org.acme.logix.MessageInterpreter"
>>>>
>>>> callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>>>                            <binding.ws <http://binding.ws>
>>>>        <http://binding.ws> <http://binding.ws>
>>>>               <http://binding.ws>
>>>>
>>>>
>>>>                                              uri="
>>>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>>>                            <callback>
>>>>                              <binding.ws/ <http://binding.ws/>
>>>>        <http://binding.ws/>
>>>>               <http://binding.ws/> <http://binding.ws/>>
>>>>
>>>>
>>>>                            </callback>
>>>>                          </service>
>>>>
>>>>                         If neither of these suggested changes fixes the
>>>>               problem, please
>>>>                         post the complete application as a zip file.
>>>>
>>>>                          Simon
>>>>
>>>>                             This is the error....
>>>>                             ---------------------------------------
>>>>                             SEVERE: Exception invoking injector - null
>>>>                             org.oasisopen.sca.ServiceRuntimeException:
>>>>               Exception invoking
>>>>                             injector - null
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>>>                             at
>>>>
>>>> com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>>>                             at
>>>>
>>>> com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>>>                             at
>>>>
>>>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>>>                             at
>>>>               sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>>>                             at
>>>>
>>>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>>>                             at
>>>>
>>>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>>>                             at
>>>>
>>>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>>>                             at
>>>>
>>>>  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>>>                             at
>>>>
>>>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>>>                             at
>>>>
>>>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>>>                             at java.lang.Thread.run(Thread.java:662)
>>>>                             Caused by:
>>>>
>>>> org.apache.tuscany.sca.core.factory.ObjectCreationException:
>>>>                             Exception invoking injector - null
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>>>>                             ... 27 more
>>>>                             Caused by: java.lang.NullPointerException
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>>>>                             ... 28 more
>>>>                             10-jan-2011 1:39:26
>>>>
>>>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>>>>                             processRequest
>>>>                             SEVERE: The server sent HTTP status code
>>>>        500: Internal
>>>>                      Server Error
>>>>
>>>> com.sun.xml.internal.ws.client.ClientTransportException: The
>>>>                             server sent HTTP status code 500: Internal
>>>>        Server
>>>>               Error
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>>>                             at
>>>>
>>>> com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>>>                             at
>>>>
>>>> com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>>>                             at
>>>>               com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>>>>                             at $Proxy50.interpret(Unknown Source)
>>>>                             at
>>>>
>>>>  org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>>>>                             at
>>>>        sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>>                      Method)
>>>>                             at
>>>>
>>>>  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>                             at
>>>>
>>>>  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>                             at
>>>>        java.lang.reflect.Method.invoke(Method.java:597)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>>>                             at
>>>>
>>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>>>                             at
>>>>
>>>> com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>>>                             at
>>>>
>>>> com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>>>                             at
>>>>
>>>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>>>                             at
>>>>
>>>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>>>                             at
>>>>               sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>>>                             at
>>>>
>>>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>>>                             at
>>>>
>>>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>>>                             at
>>>>
>>>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>>>                             at
>>>>
>>>>  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>>>                             at
>>>>
>>>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>>>                             at
>>>>
>>>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>>>                             at java.lang.Thread.run(Thread.java:662)
>>>>                             -----------------------------------------
>>>>                              Hope you can help me. (?)
>>>>
>>>>                             Kind Regards
>>>>                             Urso
>>>>
>>>>                             2011/1/9 Simon Nash <nash@apache.org
>>>>        <ma...@apache.org>
>>>>               <mailto:nash@apache.org <ma...@apache.org>>
>>>>                      <mailto:nash@apache.org <ma...@apache.org>
>>>>        <mailto:nash@apache.org <ma...@apache.org>>>
>>>>               <mailto:nash@apache.org <ma...@apache.org>
>>>>        <mailto:nash@apache.org <ma...@apache.org>>
>>>>                      <mailto:nash@apache.org <ma...@apache.org>
>>>>        <mailto:nash@apache.org <ma...@apache.org>>>>
>>>>                             <mailto:nash@apache.org
>>>>        <ma...@apache.org> <mailto:nash@apache.org
>>>>        <ma...@apache.org>>
>>>>               <mailto:nash@apache.org <ma...@apache.org>
>>>>        <mailto:nash@apache.org <ma...@apache.org>>>
>>>>                      <mailto:nash@apache.org <ma...@apache.org>
>>>>        <mailto:nash@apache.org <ma...@apache.org>>
>>>>               <mailto:nash@apache.org <ma...@apache.org>
>>>>        <mailto:nash@apache.org <ma...@apache.org>>>>>>
>>>>
>>>>
>>>>
>>>>                                Urso Wieske wrote:
>>>>
>>>>                                    Hi
>>>>                                    I am evaluating Tuscany 2.0 Beta1 and
>>>> am
>>>>               trying to
>>>>                      learn more
>>>>                                    about Callbacks (Bi-Directional
>>>>        interface)
>>>>               of SCA
>>>>                      1.1. I
>>>>                                    downloaded the Tuscany Sample files
>>>> and
>>>>               started to
>>>>                             explore the
>>>>                                    callback implementations with
>>>> webservice
>>>>               binding,
>>>>                      i.e. the
>>>>                                    Search and SearchCallback interfaces.
>>>>                                    It took me a while before I realized
>>>>        that the
>>>>                      Tuscany SCA
>>>>                                    Samples were based on SCA v1.0.
>>>>    Tuscany
>>>>               2.0 Beta1 is
>>>>                             based on
>>>>                                    the SCA v1.1 specs.
>>>>                                    After studying the sample sources, I
>>>>        have
>>>>               written
>>>>                      my own
>>>>                             callback.
>>>>
>>>>                                    Unfortunately, I kept on getting a
>>>>        runtime
>>>>                      exception after I
>>>>                                    installed and deployed my
>>>>        contribution. By the
>>>>                      way, I am
>>>>                             using
>>>>                                    Eclipse and the maven tuscany plugin.
>>>>
>>>>                                    I can't find the problem and hope if
>>>>               someone can
>>>>                      point me
>>>>                             in the
>>>>                                    right direction.
>>>>
>>>>                                    This is the error (printed on my
>>>>        console) I am
>>>>                      getting when I
>>>>                                    try to run my program:
>>>>                                    [ERROR] Failed to execute goal
>>>>
>>>>  org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>>>>                                    (default-cli) on project
>>>> handler-agent:
>>>>               Execution
>>>>                             default-cli of
>>>>                                    goal
>>>>
>>>>  org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>>>>                                    failed:
>>>>               org.oasisopen.sca.ServiceRuntimeException:
>>>>                             [Composite:
>>>>                                                  {
>>>> http://docs.oasis-open.org/ns/opencsa/sca/200912},
>>>>                             Component:
>>>>                                    MessageInterpreterComponent] -
>>>>        [ASM60033] No
>>>>                      targets for
>>>>                                    reference: Composite =
>>>>                                                  {
>>>> http://docs.oasis-open.org/ns/opencsa/sca/200912}
>>>>                             Reference =
>>>>                                    messageInterpreterCallback -> [Help
>>>> 1]
>>>>
>>>>                                    I suspect that I am doing something
>>>>        wrong
>>>>               in the
>>>>                             composite file.
>>>>                                    I can't imagine I did something wrong
>>>> in
>>>>               the java
>>>>                             sources. (See
>>>>                                    below for the sources.)
>>>>
>>>>                                Because the MessageInterpreterImpl class
>>>>        doesn't
>>>>                      contain any
>>>>                                @Reference or
>>>>                                @Property annotations, SCA creates
>>>> implicit
>>>>               references for
>>>>                             all public
>>>>                                setter methods in this class whose type
>>>> is a
>>>>               remotable SCA
>>>>                                interface, and
>>>>                                also for all public or protected fields
>>>>        in this
>>>>               class
>>>>                      whose
>>>>                             type is a
>>>>                                remotable SCA interface.
>>>>
>>>>                                There is a public setter method
>>>>                             setMessageInterpreterCallback() and a
>>>>                                protected field
>>>>        messageInterpreterCallback, so SCA
>>>>                      defines a
>>>>                             reference
>>>>                                named messageInterpreterCallback.  This
>>>>               reference doesn't
>>>>                             have a target
>>>>                                configured in the composite, hence the
>>>> error
>>>>               message.
>>>>
>>>>                                To fix the problem, you need to remove
>>>>        the setter
>>>>                      method (or
>>>>                             make it
>>>>                                protected) and change the field from
>>>>        protected
>>>>               to private.
>>>>
>>>>                                 Simon
>>>>
>>>>
>>>>                                    Kind Regards,
>>>>
>>>>                                    Urso
>>>>
>>>>
>>>>                                    -------------------- THE SERVICE
>>>>        Interface With
>>>>                      Callback
>>>>                                    Interface association ----------
>>>>                                    /**
>>>>                                     *  */
>>>>                                    package org.acme.logix;
>>>>
>>>>                                    import
>>>> org.acme.logix.message.Message;
>>>>                                    import
>>>>        org.oasisopen.sca.annotation.Callback;
>>>>                                    import
>>>>        org.oasisopen.sca.annotation.OneWay;
>>>>                                    import
>>>>        org.oasisopen.sca.annotation.Remotable;
>>>>
>>>>                                    /**
>>>>                                     *  *
>>>>                                     */
>>>>                                    @Remotable
>>>>
>>>> @Callback(MessageInterpreterCallback.class)
>>>>                                    public interface MessageInterpreter {
>>>>
>>>>                                    @OneWay
>>>>                                    void interpret(Message msg);
>>>>                                    }
>>>>
>>>>
>>>>                                    /**
>>>>                                     *  */
>>>>                                    package org.acme.logix;
>>>>
>>>>                                    import
>>>>        org.oasisopen.sca.annotation.OneWay;
>>>>                                    import
>>>>        org.oasisopen.sca.annotation.Remotable;
>>>>
>>>>                                    /**
>>>>                                     *  *
>>>>                                     */
>>>>                                    @Remotable
>>>>                                    public interface
>>>>        MessageInterpreterCallback {
>>>>                                    void onInterpret(Interpretation ipr);
>>>>                                    }
>>>>
>>>>
>>>>                                    ---------- THE CLIENT implementing
>>>>        the callback
>>>>                      interface
>>>>                                    ------------
>>>>
>>>>                                    /**
>>>>                                     *  */
>>>>                                    package org.acme.logix;
>>>>
>>>>                                    import
>>>> org.acme.logix.message.Message;
>>>>                                    import
>>>>        org.oasisopen.sca.annotation.Reference;
>>>>
>>>>                                    /**
>>>>                                     *  */
>>>>                                    public class LogisticCenterImpl
>>>>        implements
>>>>                      LogisticCenter,
>>>>                                    MessageInterpreterCallback {
>>>>                                    private AuditService auditService;
>>>>                                    @Reference
>>>>                                    protected MessageInterpreter
>>>>               messageInterpreter;
>>>>
>>>>                                    /* (non-Javadoc)
>>>>                                    * @see
>>>>
>>>>  org.acme.logix.LogisticCenter#processMessage(org.acme.logix.message.Message)
>>>>                                    */
>>>>                                    public void processMessage(Message
>>>>        message) {
>>>>                                    System.out.println("Processing
>>>>        message with
>>>>                      payload " +
>>>>                                    message.getPayload() );
>>>>                                    auditService.logSentMessage(message);
>>>>
>>>>  messageInterpreter.interpret(message);
>>>>                                    }
>>>>
>>>>                                    /**
>>>>                                    * @return the auditService
>>>>                                    */
>>>>                                    public AuditService getAuditService()
>>>> {
>>>>                                    return auditService;
>>>>                                    }
>>>>
>>>>                                    /**
>>>>                                    * @param auditService the
>>>>        auditService to set
>>>>                                    */
>>>>                                    @Reference
>>>>                                    public void
>>>> setAuditService(AuditService
>>>>                      auditService) {
>>>>                                    this.auditService = auditService;
>>>>                                    }
>>>>
>>>>                                    /**
>>>>                                    * @param messageInterpreter the
>>>>               messageInterpreter
>>>>                      to set
>>>>                                    */
>>>>                                    public void
>>>>               setMessageInterpreter(MessageInterpreter
>>>>                                    messageInterpreter) {
>>>>                                    this.messageInterpreter =
>>>>        messageInterpreter;
>>>>                                    }
>>>>
>>>>                                    /**
>>>>                                    * @return the messageInterpreter
>>>>                                    */
>>>>                                    public MessageInterpreter
>>>>               getMessageInterpreter() {
>>>>                                    return messageInterpreter;
>>>>                                    }
>>>>
>>>>
>>>>                                           /**
>>>>                                           *  THE CALLBACK method of
>>>>                      MessageInterpreterCallback
>>>>                                    interface
>>>>                                           */
>>>>                                    public void
>>>>        onInterpret(Interpretation ipr) {
>>>>                                    System.out.println("Message has been
>>>>               interpreted.");
>>>>                                    }
>>>>
>>>>                                    }
>>>>
>>>>
>>>>                                    ---------THE SERVICE WHICH IS CALLED
>>>>        BY THE
>>>>               CLIENT
>>>>                      THROUGH
>>>>                                    WEBSERVICE BINDING ---------
>>>>
>>>>                                    /**
>>>>                                     *  */
>>>>                                    package org.acme.logix;
>>>>
>>>>                                    import
>>>> org.acme.logix.message.Message;
>>>>                                    import
>>>> org.oasisopen.sca.RequestContext;
>>>>                                    import
>>>>        org.oasisopen.sca.ServiceReference;
>>>>                                    import
>>>>        org.oasisopen.sca.annotation.Callback;
>>>>                                    import
>>>>        org.oasisopen.sca.annotation.Context;
>>>>                                    import
>>>>        org.oasisopen.sca.annotation.Reference;
>>>>                                    import
>>>>        org.oasisopen.sca.annotation.Service;
>>>>
>>>>                                    /**
>>>>                                     *  *
>>>>                                     */
>>>>                                    public class MessageInterpreterImpl
>>>>        implements
>>>>                             MessageInterpreter{
>>>>
>>>>                                    @Callback
>>>>                                    protected MessageInterpreterCallback
>>>>                             messageInterpreterCallback;
>>>>                                    /* (non-Javadoc)
>>>>                                    * @see
>>>>
>>>>  org.acme.logix.MessageInterpreter#interpret(org.acme.logix.message.Message)
>>>>                                    */
>>>>                                    public void interpret(Message msg) {
>>>>                                    System.out.println("The message is
>>>> being
>>>>                      interpreted..");
>>>>                                    Interpretation ipr = new
>>>>        Interpretation();
>>>>
>>>> messageInterpreterCallback.onInterpret(ipr);
>>>>                                    }
>>>>
>>>>
>>>>
>>>>                                    /**
>>>>                                    * @return the
>>>> messageInterpreterCallback
>>>>                                    */
>>>>                                    public MessageInterpreterCallback
>>>>                             getMessageInterpreterCallback() {
>>>>                                    return messageInterpreterCallback;
>>>>                                    }
>>>>
>>>>
>>>>
>>>>                                    /**
>>>>                                    * @param messageInterpreterCallback
>>>> the
>>>>                                    messageInterpreterCallback to set
>>>>                                    */
>>>>                                    public void
>>>>        setMessageInterpreterCallback(
>>>>                                    MessageInterpreterCallback
>>>>                      messageInterpreterCallback) {
>>>>                                    this.messageInterpreterCallback =
>>>>                      messageInterpreterCallback;
>>>>                                    }
>>>>                                    }
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>                                    ---- THE COMPOSITE -----------
>>>>
>>>>
>>>>
>>>>                                    <composite
>>>>                                           xmlns="
>>>> http://docs.oasis-open.org/ns/opencsa/sca/200912"
>>>>                                                     targetNamespace="
>>>> http://logistix"
>>>>                                                     xmlns:logistix="
>>>> http://logistix"
>>>>
>>>>  name="AfnemerLogisticCenter">
>>>>
>>>>                                       <component
>>>>               name="AfnemerHandlingAgentComponent">
>>>>                                    <implementation.java
>>>>                             class="org.acme.logix.HandlingAgentImpl"/>
>>>>                                             <reference
>>>>        name="logisticCenter" >
>>>>                                            <binding.ws
>>>>        <http://binding.ws> <http://binding.ws>
>>>>               <http://binding.ws>
>>>>                      <http://binding.ws>
>>>>                             <http://binding.ws> <http://binding.ws>
>>>>
>>>>                                                                uri="
>>>> http://127.0.0.1:8087/AfnemerHandlingAgentComponent"/>
>>>>                             </reference>         <reference
>>>>                      name="auditService"
>>>>                                    target="AuditServiceComponent"/>
>>>>                                  </component>
>>>>
>>>>
>>>>
>>>>                                       <component
>>>>               name="AfnemerLogisticCenterComponent">
>>>>                                           <implementation.java
>>>>
>>>> class="org.acme.logix.LogisticCenterImpl"/>
>>>>                                           <reference
>>>>        name="messageInterpreter">
>>>>                                    <interface.java
>>>>
>>>>  interface="org.acme.logix.MessageInterpreter"
>>>>
>>>> callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>>>
>>>>                                    <binding.ws <http://binding.ws>
>>>>        <http://binding.ws>
>>>>               <http://binding.ws>
>>>>                      <http://binding.ws> <http://binding.ws>
>>>>                             <http://binding.ws>
>>>>
>>>>                                                                uri="
>>>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>>>                                    <callback >
>>>>                                    <binding.ws <http://binding.ws>
>>>>        <http://binding.ws>
>>>>               <http://binding.ws>
>>>>                      <http://binding.ws> <http://binding.ws>
>>>>                             <http://binding.ws>
>>>>
>>>>                                                         uri="
>>>> http://localhost:8084/Client/MessageInterpreterCallback
>>>>                                                         <
>>>> http://localhost:8081/Client/MessageInterpreterCallback>" />
>>>>
>>>>                                    </callback>
>>>>                                    </reference>
>>>>                                           <reference
>>>>        name="auditService">
>>>>             <binding.jms
>>>>
>>>>  initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>>>>                                    jndiURL="tcp://localhost:61616">
>>>>                                      <destination
>>>>        jndiName="AuditServiceQueue" />
>>>>                                      </binding.jms>         </reference>
>>>>                                            </component>
>>>>                                           <component
>>>>               name="MessageInterpreterComponent">
>>>>                                        <implementation.java
>>>>
>>>> class="org.acme.logix.MessageInterpreterImpl"/>
>>>>                                            <service
>>>>        name="MessageInterpreter">
>>>>                                    <interface.java
>>>>                      interface="org.acme.logix.MessageInterpreter"
>>>>
>>>>            callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>>>                                    <binding.ws <http://binding.ws>
>>>>        <http://binding.ws>
>>>>               <http://binding.ws>
>>>>                      <http://binding.ws> <http://binding.ws>
>>>>                             <http://binding.ws>
>>>>
>>>>                                                                 uri="
>>>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>>>                                    <callback>
>>>>                                    <binding.ws <http://binding.ws>
>>>>        <http://binding.ws>
>>>>               <http://binding.ws>
>>>>                      <http://binding.ws> <http://binding.ws>
>>>>                             <http://binding.ws>
>>>>
>>>>                                                         uri="
>>>> http://localhost:8084/Client/MessageInterpreterCallback
>>>>                                                         <
>>>> http://localhost:8081/Client/MessageInterpreterCallback>"/>
>>>>
>>>>                                    </callback>
>>>>                                    </service>
>>>>                                       </component>
>>>>
>>>>
>>>>                                       <component
>>>>        name="AuditServiceComponent">
>>>>                                           <implementation.java
>>>>
>>>> class="org.acme.logix.AuditServiceImpl"/>
>>>>                                                   <service
>>>>        name="AuditService">
>>>>                                               <binding.jms
>>>>
>>>>  initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>>>>                                    jndiURL="tcp://localhost:61616">
>>>>                                      <destination
>>>>        jndiName="AuditServiceQueue" />
>>>>                                    </binding.jms>         </service>
>>>>                                       </component>
>>>>                                       </composite>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>
>

Re: Callback and Tuscany 2.0 Samples

Posted by Urso Wieske <uw...@gmail.com>.
Nope, I was mislead.  The maven plugin does not work. Only the Testclass is
working.

Kind regards
Urso

2011/1/16 Urso Wieske <uw...@gmail.com>

> Hi Simon,
>
> I have been studying the source code around SCA binding.ws extension.
> As you mentioned earlier, the Tuscany SCA runtime  uses by default de
> reference implementation of JAX-WS binding.
>
> In the resource of binding-ws-runtime-jaxws-ri at the path
> META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory:
>
>
> org.apache.tuscany.sca.binding.ws.jaxws.ri.JAXWSBindingProviderFactory;model=org.apache.tuscany.sca.binding.ws.WebServiceBinding
>
> you can indeed see that the Factory JAXWSBindingProviderFactory is used as
> default.
>
> I believe -I have not digged into the code yet- that the reference
> implementation is overridden as soon as the SCA runtime finds an alternative
> binding.ws implementation on the classpath.
> I check this by just adding the Axis2 extension to my dependency set and I
> the runtime appears switch automatically to Axis2.
>
> I manage to run my code with the maven plugin. I removed
>                  <dependency>
>      <groupId>org.apache.tuscany.sca</groupId>
>      <artifactId>tuscany-node-impl</artifactId>
>      <version>2.0-Beta1</version>
>  </dependency>
>   <dependency>
>      <groupId>org.apache.tuscany.sca</groupId>
>      <artifactId>tuscany-implementation-java-runtime</artifactId>
>      <version>2.0-Beta1</version>
>  </dependency>
>
> from my dependencyset and ran my code succesfully.
> I don't understand the "negative" effect of these two dependencies on my
> code.
>
> Maybe you have some clarification for this?
>
>
> Kind Regards,
> Urso
>
> 2011/1/15 Simon Nash <na...@apache.org>
>
>> Urso Wieske wrote:
>>
>>> Hi Simon,
>>>
>>> Could you send me a copy of your POM which you have used /adapted?
>>> Also which public repositories are you using to download your Tuscany 2.0
>>> Beta1 dependencies?
>>> (I have initially googled for a oublic maven repository where I could
>>> donwload the Tuscany v2 Beta1 dependencies.)
>>>
>>> I replaced my base runtime for the 4 dependencies you have stated, but I
>>> get runtime exceptions due to other causes. Most probably I should have
>>> other dependencies too which you have not mentioned.
>>>
>>> Kind regards.
>>> Urso
>>>
>>>  Hi Urso,
>> My pom and JUnit test case are attached below.  The repository URL
>> is included in the pom.
>>
>>  Simon
>>
>> ----- begin pom -----
>>
>> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
>> http://www.w3.org/2001/XMLSchema-instance"
>>         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>>    <modelVersion>4.0.0</modelVersion>
>>    <parent>
>>        <groupId>org.apache.tuscany.sca</groupId>
>>        <artifactId>tuscany-sca</artifactId>
>>        <version>2.0-Beta1</version>
>>    </parent>
>>    <groupId>org.acme.logix</groupId>
>>    <artifactId>handler-agent</artifactId>
>>    <version>0.0.1-SNAPSHOT</version>
>>    <packaging>jar</packaging>
>>
>>    <name>handler-agent</name>
>>    <url>http://maven.apache.org</url>
>>
>>    <properties>
>>        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>>    </properties>
>>
>>    <repositories>
>>        <repository>
>>            <id>apache.staging</id>
>>            <url>https://repository.apache.org/content/groups/staging
>> </url>
>>        </repository>
>>    </repositories>
>>
>>    <build>
>>        <finalName>afnemer-handling-agent-contribution</finalName>
>>        <plugins>
>>            <plugin>
>>                <groupId>org.apache.tuscany.maven.plugins</groupId>
>>                <artifactId>maven-tuscany-plugin</artifactId>
>>                <version>2.0-Beta1</version>
>>                <dependencies>
>>                    <dependency>
>>                        <groupId>org.apache.tuscany.sca</groupId>
>>
>>  <artifactId>tuscany-binding-jms-runtime</artifactId>
>>                        <version>2.0-Beta1</version>
>>                    </dependency>
>>
>>                    <dependency>
>>                        <groupId>org.apache.activemq</groupId>
>>                        <artifactId>activemq-all</artifactId>
>>                        <version>5.3.0</version>
>>                        <scope>runtime</scope>
>>                    </dependency>
>>                </dependencies>
>>            </plugin>
>>            <plugin>
>>                <groupId>org.apache.maven.plugins</groupId>
>>                <artifactId>maven-compiler-plugin</artifactId>
>>                <version>2.3.2</version>
>>                <configuration>
>>                    <source>1.6</source>
>>                    <target>1.6</target>
>>                </configuration>
>>            </plugin>
>>        </plugins>
>>    </build>
>>    <dependencies>
>>        <dependency>
>>            <groupId>org.apache.tuscany.sca</groupId>
>>            <artifactId>tuscany-feature-api</artifactId>
>>            <type>pom</type>
>>            <version>2.0-Beta1</version>
>>        </dependency>
>>
>>        <dependency>
>>            <groupId>org.apache.tuscany.sca</groupId>
>>            <artifactId>tuscany-binding-jms-runtime</artifactId>
>>            <version>2.0-Beta1</version>
>>        </dependency>
>>
>>        <dependency>
>>            <groupId>org.apache.activemq</groupId>
>>            <artifactId>activemq-all</artifactId>
>>            <version>5.3.0</version>
>>            <scope>runtime</scope>
>>        </dependency>
>>
>>       <dependency>
>>            <groupId>org.apache.tuscany.sca</groupId>
>>            <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>>            <version>2.0-Beta1</version>
>>       </dependency>
>>
>>        <dependency>
>>            <groupId>org.apache.tuscany.sca</groupId>
>>            <artifactId>tuscany-host-jetty</artifactId>
>>            <version>2.0-Beta1</version>
>>        </dependency>
>>
>>        <dependency>
>>            <groupId>org.apache.tuscany.sca</groupId>
>>            <artifactId>tuscany-node-impl</artifactId>
>>            <version>2.0-Beta1</version>
>>        </dependency>
>>
>>        <dependency>
>>            <groupId>org.apache.tuscany.sca</groupId>
>>            <artifactId>tuscany-implementation-java-runtime</artifactId>
>>            <version>2.0-Beta1</version>
>>        </dependency>
>>
>>        <dependency>
>>            <groupId>junit</groupId>
>>            <artifactId>junit</artifactId>
>>            <version>4.8.1</version>
>>            <scope>test</scope>
>>        </dependency>
>>    </dependencies>
>> </project>
>>
>> ----- begin test case -----
>>
>> package acme;
>>
>> import org.apache.activemq.broker.BrokerService;
>> import org.apache.tuscany.sca.node.Contribution;
>> import org.apache.tuscany.sca.node.Node;
>> import org.apache.tuscany.sca.node.NodeFactory;
>> import org.junit.Test;
>>
>> public class CallbackTestCase {
>>
>>    @Test
>>    public void testSayHello() throws Exception {
>>
>>        // Start the JMS broker
>>        BrokerService jmsBroker = new BrokerService();
>>        jmsBroker.setPersistent(false);
>>        jmsBroker.setUseJmx(false);
>>        jmsBroker.addConnector("tcp://localhost:61616");
>>        jmsBroker.start();
>>
>>        // Start the Tuscany runtime with this module as the contribution
>>        System.out.println("starting Tuscany runtime");
>>        Node node = NodeFactory.newInstance().createNode(new
>> Contribution("c1", "target/classes"));
>>        System.out.println("Tuscany runtime started");
>>
>>        // Start the Tuscany node. This also runs the @EagerInit test
>> method.
>>        node.start();
>>        System.out.println("Tuscany node started");
>>
>>        // Stop the Tuscany runtime
>>        node.stop();
>>
>>        // Stop the JMS broker
>>        jmsBroker.stop();
>>    }
>>
>> }
>>
>> ----- end test case -----
>>
>>  > 2011/1/15 Simon Nash <nash@apache.org <ma...@apache.org>>
>>
>>>
>>>    Urso Wieske wrote:
>>>
>>>        Hi Simon,
>>>
>>>        Thanks for the quick response.
>>>        That's a pitty that maven-tuscany-plugin is not behaving
>>>        accordingly. It's a great instrument to use within my IDE
>>>        (Eclipse). I'll submit an issue at the Tuscany projectsite. I
>>>        will also dig into the "maven-tuscany-plugin" problem to figure
>>>        out what is the cause of this deviation.
>>>
>>>    Hi Urso,
>>>    I agree.  It should be possible to use maven-tuscany-plugin and
>>>    replace things in the base runtime by alternative implementations.
>>>    Maybe there is a way to do this, but I couldn't find one.
>>>
>>>     Simon
>>>
>>>        Kind Regards
>>>        Urso
>>>
>>>
>>>        2011/1/15 Simon Nash <nash@apache.org <ma...@apache.org>
>>>        <mailto:nash@apache.org <ma...@apache.org>>>
>>>
>>>           Urso Wieske wrote:
>>>
>>>               Hi Simon,
>>>
>>>               I have uploaded my sources as a zipped file.
>>>
>>>           Hi Urso,
>>>           This problem is caused by a bug in Tuscany.  Please raise a
>>> JIRA
>>>           so that we can track and fix the problem.  In the meantime, I
>>> can
>>>           suggest a partial workaround.
>>>
>>>           The injection failure only happens if Tuscany is using the
>>>           tuscany-binding-ws-runtime-jaxws module as the runtime
>>>        implementation
>>>           for <binding.ws <http://binding.ws> <http://binding.ws>>.  It
>>>        doesn't happen if
>>>           tuscany-binding-ws-runtime-axis2
>>>           is used instead of tuscany-binding-ws-runtime-jaxws.  This
>>>        implies that
>>>           the problem is caused by a bug in the -jaxws version.
>>>
>>>           By default, Tuscany uses the -jaxws version.  To get Tuscany
>>>        to use
>>>           the -axis2 version instead, you need to do special
>>>        configuration in
>>>           the pom.xml file.
>>>
>>>           Unfortunately I couldn't find a way to make this change when
>>>        using
>>>           maven-tuscany-plugin to run the application.  This is because
>>>           maven-tuscany-plugin has a dependency on tuscany-base-runtime.
>>>           The tuscany-base-runtime jar contains the -jaxws version and
>>>        seems
>>>           to always use it even if the -axis2 version is declared as an
>>>           additional dependency.
>>>
>>>           I did find a way to get Tuscany to use the -axis2 version
>>>        when not
>>>           using maven-tuscany-plugin.  If you replace this dependency:
>>>            <dependency>
>>>                <groupId>org.apache.tuscany.sca</groupId>
>>>                <artifactId>tuscany-base-runtime</artifactId>
>>>                <version>2.0-Beta1</version>
>>>            </dependency>
>>>
>>>           by the following four dependencies:
>>>            <dependency>
>>>                <groupId>org.apache.tuscany.sca</groupId>
>>>                <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>>>                <version>2.0-Beta1</version>
>>>            </dependency>
>>>
>>>            <dependency>
>>>                <groupId>org.apache.tuscany.sca</groupId>
>>>                <artifactId>tuscany-host-jetty</artifactId>
>>>                <version>2.0-Beta1</version>
>>>            </dependency>
>>>
>>>            <dependency>
>>>                <groupId>org.apache.tuscany.sca</groupId>
>>>                <artifactId>tuscany-node-impl</artifactId>
>>>                <version>2.0-Beta1</version>
>>>            </dependency>
>>>
>>>            <dependency>
>>>                <groupId>org.apache.tuscany.sca</groupId>
>>>
>>>  <artifactId>tuscany-implementation-java-runtime</artifactId>
>>>                <version>2.0-Beta1</version>
>>>            </dependency>
>>>
>>>           then the application runs successfully.  I used a maven JUnit
>>>        test
>>>           to verify this.
>>>
>>>            Simon
>>>
>>>               Hi Simon,
>>>
>>>               I adapted my code as you suggested. It seems like the
>>>        error has
>>>               dissappeared, but I got new ones. Well I removed the
>>>        setter and
>>>               getter of messageInterpreterCallback from
>>>               MessageInterpreterImpl. Now my MessageInterpreterImpl class
>>>               contains only the instance variable
>>>        messageInterpreterCallback .
>>>               I have made it a protected variable.
>>>
>>>               I get a HTTP Internal Server ( error 500).
>>>               I am still missing something.SCA runtime is supposed
>>>               "automatically" inject my callback instance in the
>>>               messageInterpreterCallback member variable of
>>>               MessageInterpreterImpl. The MessageInterpreterImpl needs
>>>        to have
>>>               a reference to some callback instance.
>>>               I can;t seem to solve this problem.
>>>
>>>               This is the error....
>>>               ---------------------------------------
>>>               SEVERE: Exception invoking injector - null
>>>               org.oasisopen.sca.ServiceRuntimeException: Exception
>>> invoking
>>>               injector - null
>>>               at
>>>
>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>>>               at
>>>
>>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>>               at
>>>
>>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>>               at
>>>
>>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>>               at
>>>
>>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>>               at
>>>
>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>>               at
>>>
>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>>               at
>>>        com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>>               at
>>>        com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>>               at
>>>        com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>>               at
>>>        com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>>               at
>>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>>               at
>>> sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>>               at
>>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>>               at
>>>
>>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>>               at
>>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>>               at
>>>        sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>>               at
>>>
>>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>>               at
>>>
>>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>>               at java.lang.Thread.run(Thread.java:662)
>>>               Caused by:
>>>
>>> org.apache.tuscany.sca.core.factory.ObjectCreationException:
>>>               Exception invoking injector - null
>>>               at
>>>
>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>>>               at
>>>
>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>>>               ... 27 more
>>>               Caused by: java.lang.NullPointerException
>>>               at
>>>
>>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>>>               at
>>>
>>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>>>               at
>>>
>>>  org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>>>               at
>>>
>>>  org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>>>               at
>>>
>>>  org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>>>               at
>>>
>>>  org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>>>               at
>>>
>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>>>               ... 28 more
>>>               10-jan-2011 1:39:26
>>>
>>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>>>               processRequest
>>>               SEVERE: The server sent HTTP status code 500: Internal
>>>        Server Error
>>>               com.sun.xml.internal.ws.client.ClientTransportException:
>>> The
>>>               server sent HTTP status code 500: Internal Server Error
>>>               at
>>>
>>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>>>               at
>>>        com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>>               at
>>>        com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>>               at
>>>        com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>>               at
>>>        com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>>               at
>>> com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>>>               at
>>>
>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>>>               at
>>>
>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>>>               at
>>>
>>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>>               at
>>>
>>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>>>               at
>>>
>>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>>>               at
>>>
>>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>>>               at
>>>
>>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>>>               at
>>>
>>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>>>               at $Proxy50.interpret(Unknown Source)
>>>               at
>>>
>>>  org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>>>               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>        Method)
>>>               at
>>>
>>>  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>               at
>>>
>>>  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>               at java.lang.reflect.Method.invoke(Method.java:597)
>>>               at
>>>
>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>>>               at
>>>
>>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>>               at
>>>
>>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>>               at
>>>
>>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>>               at
>>>
>>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>>               at
>>>
>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>>               at
>>>
>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>>               at
>>>        com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>>               at
>>>        com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>>               at
>>>        com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>>               at
>>>        com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>>               at
>>>
>>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>>               at
>>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>>               at
>>> sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>>               at
>>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>>               at
>>>
>>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>>               at
>>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>>               at
>>>        sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>>               at
>>>
>>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>>               at
>>>
>>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>>               at java.lang.Thread.run(Thread.java:662)
>>>               -----------------------------------------
>>>                Hope you can help me. (?)
>>>
>>>               Kind Regards
>>>               Urso
>>>
>>>
>>>
>>>
>>>               2011/1/14 Simon Nash <nash@apache.org
>>>        <ma...@apache.org> <mailto:nash@apache.org
>>>        <ma...@apache.org>>
>>>               <mailto:nash@apache.org <ma...@apache.org>
>>>        <mailto:nash@apache.org <ma...@apache.org>>>>
>>>
>>>
>>>                  Hi Urso,
>>>                  I'm starting to look at your project code now.
>>>
>>>                  It's important to keep these threads on the Tuscany
>>>        mailing list
>>>                  so that other members of the Tuscany community are
>>>        included in
>>>                  the discussion.  The Tuscany mailing list archives are
>>> an
>>>               important
>>>                  resource for Tuscany users who are experiencing a
>>>        problem and are
>>>                  looking to see if others have found a solution.  If a
>>>        problem is
>>>                  solved by a private message exchange instead of on the
>>>        public
>>>               list,
>>>                  the knowledge of how to solve it is confined to one
>>> person
>>>               instead
>>>                  of being shared by the community.
>>>
>>>                  The best way to make this happen would be for you to
>>>        resend your
>>>                  recent private emails to the public list.  I'll look
>>>        out for them
>>>                  on the public list so that I can respond to them there.
>>>
>>>                   Simon
>>>
>>>                  Urso Wieske wrote:
>>>
>>>                      Hi Simon,
>>>
>>>                      You'll find in this email the zipped file
>>>        containing my
>>>               sourcecode.
>>>
>>>                      Unfortunately, I still have errors.
>>>                      I changed the member variable from protected to
>>>        private
>>>               like you
>>>                      suggested.
>>>                      And created Getter and Setter for this member
>>>        variable.
>>>                      (messageInterpreterCallback).
>>>                      I annotated the setter with @Callback.
>>>                      I also removed the URI attribute from the
>>>               callback/binding.ws <http://binding.ws> <http://binding.ws
>>> >
>>>                      <http://binding.ws> <http://binding.ws> element of
>>> the
>>>               service
>>>
>>>                      according to your suggestion. Still problems.... :-(
>>>
>>>
>>>                      I have zipped my source. It's an Eclipse project.
>>>
>>>                      I appreciate the fact that you are willing to
>>>        verify this
>>>               issue.
>>>                      If you have any questions about the code, just let
>>>        me know.
>>>
>>>                      Please checkout also if my POM is well specified
>>> with
>>>               regard to
>>>                      dependencies. Do I have the proper dependencies. I
>>>        am using
>>>                      Tuscany 2.0 Beta1.
>>>
>>>                      Kind Regards
>>>                      Urso
>>>
>>>
>>>                      2011/1/10 Simon Nash <nash@apache.org
>>>        <ma...@apache.org>
>>>               <mailto:nash@apache.org <ma...@apache.org>>
>>>        <mailto:nash@apache.org <ma...@apache.org>
>>>               <mailto:nash@apache.org <ma...@apache.org>>>
>>>                      <mailto:nash@apache.org <ma...@apache.org>
>>>        <mailto:nash@apache.org <ma...@apache.org>>
>>>               <mailto:nash@apache.org <ma...@apache.org>
>>>        <mailto:nash@apache.org <ma...@apache.org>>>>>
>>>
>>>
>>>                         Urso Wieske wrote:
>>>
>>>                             Hi Simon,
>>>
>>>                             I adapted my code as you suggested. It
>>>        seems like the
>>>                      error has
>>>                             dissappeared, but I got new ones. Well I
>>>        removed the
>>>                      setter and
>>>                             getter of messageInterpreterCallback from
>>>                             MessageInterpreterImpl. Now my
>>>               MessageInterpreterImpl class
>>>                             contains only the instance variable
>>>                      messageInterpreterCallback .
>>>                             I have made it a protected variable.
>>>
>>>                         According to the SCA 1.1 specs, this variable
>>>        should
>>>               be private
>>>                         in order to avoid having it treated as a
>>> reference.
>>>                Can you try
>>>                         changing this and see if it makes any difference?
>>>
>>>
>>>                             I get a HTTP Internal Server ( error 500).
>>>                             I am still missing something.SCA runtime is
>>>        supposed
>>>                             "automatically" inject my callback instance
>>>        in the
>>>                             messageInterpreterCallback member variable of
>>>                             MessageInterpreterImpl. The
>>>        MessageInterpreterImpl
>>>               needs
>>>                      to have
>>>                             a reference to some callback instance.
>>>                             I can;t seem to solve this problem.
>>>
>>>                          >From the stack trace it seems that the thread
>>>        message
>>>                      context doesn't
>>>                         contain the callback endpoint.  I'm not sure what
>>>               could cause
>>>                      this.
>>>                         However I noticed a problem in your composite
>>> that
>>>               would be worth
>>>                         fixing, and it's just possible that this might be
>>>               related to the
>>>                         problem that you're seeing.
>>>
>>>                         The problem is that you have specified a
>>>        callback URI
>>>               for the
>>>                         MessageInterpreter service in
>>>               MessageInterpreterComponent, as
>>>                      follows:
>>>
>>>                          <service name="MessageInterpreter">
>>>                            <interface.java
>>>               interface="org.acme.logix.MessageInterpreter"
>>>
>>> callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>>                            <binding.ws <http://binding.ws>
>>>        <http://binding.ws> <http://binding.ws>
>>>               <http://binding.ws>
>>>
>>>
>>>                                              uri="
>>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>>                            <callback>
>>>                              <binding.ws <http://binding.ws>
>>>        <http://binding.ws>
>>>               <http://binding.ws> <http://binding.ws>
>>>                                       uri="
>>> http://localhost:8084/Client/MessageInterpreterCallback"/>
>>>                            </callback>
>>>                          </service>
>>>
>>>                         There shouldn't be any callback URI in the
>>> service
>>>                      definition, because
>>>                         this information is provided at runtime by the
>>>        client
>>>                      invocation.  So
>>>                         you should change the above to:
>>>
>>>                          <service name="MessageInterpreter">
>>>                            <interface.java
>>>               interface="org.acme.logix.MessageInterpreter"
>>>
>>> callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>>                            <binding.ws <http://binding.ws>
>>>        <http://binding.ws> <http://binding.ws>
>>>               <http://binding.ws>
>>>
>>>
>>>                                              uri="
>>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>>                            <callback>
>>>                              <binding.ws/ <http://binding.ws/>
>>>        <http://binding.ws/>
>>>               <http://binding.ws/> <http://binding.ws/>>
>>>
>>>
>>>                            </callback>
>>>                          </service>
>>>
>>>                         If neither of these suggested changes fixes the
>>>               problem, please
>>>                         post the complete application as a zip file.
>>>
>>>                          Simon
>>>
>>>                             This is the error....
>>>                             ---------------------------------------
>>>                             SEVERE: Exception invoking injector - null
>>>                             org.oasisopen.sca.ServiceRuntimeException:
>>>               Exception invoking
>>>                             injector - null
>>>                             at
>>>
>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>>                             at
>>>
>>> com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>>                             at
>>>
>>> com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>>                             at
>>>
>>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>>                             at
>>>               sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>>                             at
>>>
>>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>>                             at
>>>
>>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>>                             at
>>>
>>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>>                             at
>>>
>>>  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>>                             at
>>>
>>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>>                             at
>>>
>>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>>                             at java.lang.Thread.run(Thread.java:662)
>>>                             Caused by:
>>>
>>> org.apache.tuscany.sca.core.factory.ObjectCreationException:
>>>                             Exception invoking injector - null
>>>                             at
>>>
>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>>>                             ... 27 more
>>>                             Caused by: java.lang.NullPointerException
>>>                             at
>>>
>>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>>>                             ... 28 more
>>>                             10-jan-2011 1:39:26
>>>
>>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>>>                             processRequest
>>>                             SEVERE: The server sent HTTP status code
>>>        500: Internal
>>>                      Server Error
>>>
>>> com.sun.xml.internal.ws.client.ClientTransportException: The
>>>                             server sent HTTP status code 500: Internal
>>>        Server
>>>               Error
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>>                             at
>>>
>>> com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>>                             at
>>>
>>> com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>>                             at
>>>               com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>>>                             at $Proxy50.interpret(Unknown Source)
>>>                             at
>>>
>>>  org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>>>                             at
>>>        sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>                      Method)
>>>                             at
>>>
>>>  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>                             at
>>>
>>>  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>                             at
>>>        java.lang.reflect.Method.invoke(Method.java:597)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>>                             at
>>>
>>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>>                             at
>>>
>>> com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>>                             at
>>>
>>> com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>>                             at
>>>
>>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>>                             at
>>>
>>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>>                             at
>>>               sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>>                             at
>>>
>>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>>                             at
>>>
>>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>>                             at
>>>
>>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>>                             at
>>>
>>>  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>>                             at
>>>
>>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>>                             at
>>>
>>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>>                             at java.lang.Thread.run(Thread.java:662)
>>>                             -----------------------------------------
>>>                              Hope you can help me. (?)
>>>
>>>                             Kind Regards
>>>                             Urso
>>>
>>>                             2011/1/9 Simon Nash <nash@apache.org
>>>        <ma...@apache.org>
>>>               <mailto:nash@apache.org <ma...@apache.org>>
>>>                      <mailto:nash@apache.org <ma...@apache.org>
>>>        <mailto:nash@apache.org <ma...@apache.org>>>
>>>               <mailto:nash@apache.org <ma...@apache.org>
>>>        <mailto:nash@apache.org <ma...@apache.org>>
>>>                      <mailto:nash@apache.org <ma...@apache.org>
>>>        <mailto:nash@apache.org <ma...@apache.org>>>>
>>>                             <mailto:nash@apache.org
>>>        <ma...@apache.org> <mailto:nash@apache.org
>>>        <ma...@apache.org>>
>>>               <mailto:nash@apache.org <ma...@apache.org>
>>>        <mailto:nash@apache.org <ma...@apache.org>>>
>>>                      <mailto:nash@apache.org <ma...@apache.org>
>>>        <mailto:nash@apache.org <ma...@apache.org>>
>>>               <mailto:nash@apache.org <ma...@apache.org>
>>>        <mailto:nash@apache.org <ma...@apache.org>>>>>>
>>>
>>>
>>>
>>>                                Urso Wieske wrote:
>>>
>>>                                    Hi
>>>                                    I am evaluating Tuscany 2.0 Beta1 and
>>> am
>>>               trying to
>>>                      learn more
>>>                                    about Callbacks (Bi-Directional
>>>        interface)
>>>               of SCA
>>>                      1.1. I
>>>                                    downloaded the Tuscany Sample files
>>> and
>>>               started to
>>>                             explore the
>>>                                    callback implementations with
>>> webservice
>>>               binding,
>>>                      i.e. the
>>>                                    Search and SearchCallback interfaces.
>>>                                    It took me a while before I realized
>>>        that the
>>>                      Tuscany SCA
>>>                                    Samples were based on SCA v1.0.
>>>    Tuscany
>>>               2.0 Beta1 is
>>>                             based on
>>>                                    the SCA v1.1 specs.
>>>                                    After studying the sample sources, I
>>>        have
>>>               written
>>>                      my own
>>>                             callback.
>>>
>>>                                    Unfortunately, I kept on getting a
>>>        runtime
>>>                      exception after I
>>>                                    installed and deployed my
>>>        contribution. By the
>>>                      way, I am
>>>                             using
>>>                                    Eclipse and the maven tuscany plugin.
>>>
>>>                                    I can't find the problem and hope if
>>>               someone can
>>>                      point me
>>>                             in the
>>>                                    right direction.
>>>
>>>                                    This is the error (printed on my
>>>        console) I am
>>>                      getting when I
>>>                                    try to run my program:
>>>                                    [ERROR] Failed to execute goal
>>>
>>>  org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>>>                                    (default-cli) on project
>>> handler-agent:
>>>               Execution
>>>                             default-cli of
>>>                                    goal
>>>
>>>  org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>>>                                    failed:
>>>               org.oasisopen.sca.ServiceRuntimeException:
>>>                             [Composite:
>>>                                                  {
>>> http://docs.oasis-open.org/ns/opencsa/sca/200912},
>>>                             Component:
>>>                                    MessageInterpreterComponent] -
>>>        [ASM60033] No
>>>                      targets for
>>>                                    reference: Composite =
>>>                                                  {
>>> http://docs.oasis-open.org/ns/opencsa/sca/200912}
>>>                             Reference =
>>>                                    messageInterpreterCallback -> [Help 1]
>>>
>>>                                    I suspect that I am doing something
>>>        wrong
>>>               in the
>>>                             composite file.
>>>                                    I can't imagine I did something wrong
>>> in
>>>               the java
>>>                             sources. (See
>>>                                    below for the sources.)
>>>
>>>                                Because the MessageInterpreterImpl class
>>>        doesn't
>>>                      contain any
>>>                                @Reference or
>>>                                @Property annotations, SCA creates
>>> implicit
>>>               references for
>>>                             all public
>>>                                setter methods in this class whose type is
>>> a
>>>               remotable SCA
>>>                                interface, and
>>>                                also for all public or protected fields
>>>        in this
>>>               class
>>>                      whose
>>>                             type is a
>>>                                remotable SCA interface.
>>>
>>>                                There is a public setter method
>>>                             setMessageInterpreterCallback() and a
>>>                                protected field
>>>        messageInterpreterCallback, so SCA
>>>                      defines a
>>>                             reference
>>>                                named messageInterpreterCallback.  This
>>>               reference doesn't
>>>                             have a target
>>>                                configured in the composite, hence the
>>> error
>>>               message.
>>>
>>>                                To fix the problem, you need to remove
>>>        the setter
>>>                      method (or
>>>                             make it
>>>                                protected) and change the field from
>>>        protected
>>>               to private.
>>>
>>>                                 Simon
>>>
>>>
>>>                                    Kind Regards,
>>>
>>>                                    Urso
>>>
>>>
>>>                                    -------------------- THE SERVICE
>>>        Interface With
>>>                      Callback
>>>                                    Interface association ----------
>>>                                    /**
>>>                                     *  */
>>>                                    package org.acme.logix;
>>>
>>>                                    import org.acme.logix.message.Message;
>>>                                    import
>>>        org.oasisopen.sca.annotation.Callback;
>>>                                    import
>>>        org.oasisopen.sca.annotation.OneWay;
>>>                                    import
>>>        org.oasisopen.sca.annotation.Remotable;
>>>
>>>                                    /**
>>>                                     *  *
>>>                                     */
>>>                                    @Remotable
>>>
>>> @Callback(MessageInterpreterCallback.class)
>>>                                    public interface MessageInterpreter {
>>>
>>>                                    @OneWay
>>>                                    void interpret(Message msg);
>>>                                    }
>>>
>>>
>>>                                    /**
>>>                                     *  */
>>>                                    package org.acme.logix;
>>>
>>>                                    import
>>>        org.oasisopen.sca.annotation.OneWay;
>>>                                    import
>>>        org.oasisopen.sca.annotation.Remotable;
>>>
>>>                                    /**
>>>                                     *  *
>>>                                     */
>>>                                    @Remotable
>>>                                    public interface
>>>        MessageInterpreterCallback {
>>>                                    void onInterpret(Interpretation ipr);
>>>                                    }
>>>
>>>
>>>                                    ---------- THE CLIENT implementing
>>>        the callback
>>>                      interface
>>>                                    ------------
>>>
>>>                                    /**
>>>                                     *  */
>>>                                    package org.acme.logix;
>>>
>>>                                    import org.acme.logix.message.Message;
>>>                                    import
>>>        org.oasisopen.sca.annotation.Reference;
>>>
>>>                                    /**
>>>                                     *  */
>>>                                    public class LogisticCenterImpl
>>>        implements
>>>                      LogisticCenter,
>>>                                    MessageInterpreterCallback {
>>>                                    private AuditService auditService;
>>>                                    @Reference
>>>                                    protected MessageInterpreter
>>>               messageInterpreter;
>>>
>>>                                    /* (non-Javadoc)
>>>                                    * @see
>>>
>>>  org.acme.logix.LogisticCenter#processMessage(org.acme.logix.message.Message)
>>>                                    */
>>>                                    public void processMessage(Message
>>>        message) {
>>>                                    System.out.println("Processing
>>>        message with
>>>                      payload " +
>>>                                    message.getPayload() );
>>>                                    auditService.logSentMessage(message);
>>>                                    messageInterpreter.interpret(message);
>>>                                    }
>>>
>>>                                    /**
>>>                                    * @return the auditService
>>>                                    */
>>>                                    public AuditService getAuditService()
>>> {
>>>                                    return auditService;
>>>                                    }
>>>
>>>                                    /**
>>>                                    * @param auditService the
>>>        auditService to set
>>>                                    */
>>>                                    @Reference
>>>                                    public void
>>> setAuditService(AuditService
>>>                      auditService) {
>>>                                    this.auditService = auditService;
>>>                                    }
>>>
>>>                                    /**
>>>                                    * @param messageInterpreter the
>>>               messageInterpreter
>>>                      to set
>>>                                    */
>>>                                    public void
>>>               setMessageInterpreter(MessageInterpreter
>>>                                    messageInterpreter) {
>>>                                    this.messageInterpreter =
>>>        messageInterpreter;
>>>                                    }
>>>
>>>                                    /**
>>>                                    * @return the messageInterpreter
>>>                                    */
>>>                                    public MessageInterpreter
>>>               getMessageInterpreter() {
>>>                                    return messageInterpreter;
>>>                                    }
>>>
>>>
>>>                                           /**
>>>                                           *  THE CALLBACK method of
>>>                      MessageInterpreterCallback
>>>                                    interface
>>>                                           */
>>>                                    public void
>>>        onInterpret(Interpretation ipr) {
>>>                                    System.out.println("Message has been
>>>               interpreted.");
>>>                                    }
>>>
>>>                                    }
>>>
>>>
>>>                                    ---------THE SERVICE WHICH IS CALLED
>>>        BY THE
>>>               CLIENT
>>>                      THROUGH
>>>                                    WEBSERVICE BINDING ---------
>>>
>>>                                    /**
>>>                                     *  */
>>>                                    package org.acme.logix;
>>>
>>>                                    import org.acme.logix.message.Message;
>>>                                    import
>>> org.oasisopen.sca.RequestContext;
>>>                                    import
>>>        org.oasisopen.sca.ServiceReference;
>>>                                    import
>>>        org.oasisopen.sca.annotation.Callback;
>>>                                    import
>>>        org.oasisopen.sca.annotation.Context;
>>>                                    import
>>>        org.oasisopen.sca.annotation.Reference;
>>>                                    import
>>>        org.oasisopen.sca.annotation.Service;
>>>
>>>                                    /**
>>>                                     *  *
>>>                                     */
>>>                                    public class MessageInterpreterImpl
>>>        implements
>>>                             MessageInterpreter{
>>>
>>>                                    @Callback
>>>                                    protected MessageInterpreterCallback
>>>                             messageInterpreterCallback;
>>>                                    /* (non-Javadoc)
>>>                                    * @see
>>>
>>>  org.acme.logix.MessageInterpreter#interpret(org.acme.logix.message.Message)
>>>                                    */
>>>                                    public void interpret(Message msg) {
>>>                                    System.out.println("The message is
>>> being
>>>                      interpreted..");
>>>                                    Interpretation ipr = new
>>>        Interpretation();
>>>
>>> messageInterpreterCallback.onInterpret(ipr);
>>>                                    }
>>>
>>>
>>>
>>>                                    /**
>>>                                    * @return the
>>> messageInterpreterCallback
>>>                                    */
>>>                                    public MessageInterpreterCallback
>>>                             getMessageInterpreterCallback() {
>>>                                    return messageInterpreterCallback;
>>>                                    }
>>>
>>>
>>>
>>>                                    /**
>>>                                    * @param messageInterpreterCallback
>>> the
>>>                                    messageInterpreterCallback to set
>>>                                    */
>>>                                    public void
>>>        setMessageInterpreterCallback(
>>>                                    MessageInterpreterCallback
>>>                      messageInterpreterCallback) {
>>>                                    this.messageInterpreterCallback =
>>>                      messageInterpreterCallback;
>>>                                    }
>>>                                    }
>>>
>>>
>>>
>>>
>>>
>>>                                    ---- THE COMPOSITE -----------
>>>
>>>
>>>
>>>                                    <composite
>>>                                           xmlns="
>>> http://docs.oasis-open.org/ns/opencsa/sca/200912"
>>>                                                     targetNamespace="
>>> http://logistix"
>>>                                                     xmlns:logistix="
>>> http://logistix"
>>>
>>>  name="AfnemerLogisticCenter">
>>>
>>>                                       <component
>>>               name="AfnemerHandlingAgentComponent">
>>>                                    <implementation.java
>>>                             class="org.acme.logix.HandlingAgentImpl"/>
>>>                                             <reference
>>>        name="logisticCenter" >
>>>                                            <binding.ws
>>>        <http://binding.ws> <http://binding.ws>
>>>               <http://binding.ws>
>>>                      <http://binding.ws>
>>>                             <http://binding.ws> <http://binding.ws>
>>>
>>>                                                                uri="
>>> http://127.0.0.1:8087/AfnemerHandlingAgentComponent"/>
>>>                           </reference>         <reference
>>>                      name="auditService"
>>>                                    target="AuditServiceComponent"/>
>>>                                </component>
>>>
>>>
>>>
>>>                                       <component
>>>               name="AfnemerLogisticCenterComponent">
>>>                                           <implementation.java
>>>
>>> class="org.acme.logix.LogisticCenterImpl"/>
>>>                                           <reference
>>>        name="messageInterpreter">
>>>                                    <interface.java
>>>
>>>  interface="org.acme.logix.MessageInterpreter"
>>>
>>> callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>>
>>>                                    <binding.ws <http://binding.ws>
>>>        <http://binding.ws>
>>>               <http://binding.ws>
>>>                      <http://binding.ws> <http://binding.ws>
>>>                             <http://binding.ws>
>>>
>>>                                                                uri="
>>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>>                                    <callback >
>>>                                    <binding.ws <http://binding.ws>
>>>        <http://binding.ws>
>>>               <http://binding.ws>
>>>                      <http://binding.ws> <http://binding.ws>
>>>                             <http://binding.ws>
>>>
>>>                                                         uri="
>>> http://localhost:8084/Client/MessageInterpreterCallback
>>>                                                         <
>>> http://localhost:8081/Client/MessageInterpreterCallback>" />
>>>
>>>                                    </callback>
>>>                                    </reference>
>>>                                           <reference
>>>        name="auditService">
>>>           <binding.jms
>>>
>>>  initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>>>                                    jndiURL="tcp://localhost:61616">
>>>                                      <destination
>>>        jndiName="AuditServiceQueue" />
>>>                                      </binding.jms>         </reference>
>>>                                            </component>
>>>                                           <component
>>>               name="MessageInterpreterComponent">
>>>                                        <implementation.java
>>>
>>> class="org.acme.logix.MessageInterpreterImpl"/>
>>>                                            <service
>>>        name="MessageInterpreter">
>>>                                    <interface.java
>>>                      interface="org.acme.logix.MessageInterpreter"
>>>
>>>          callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>>                                    <binding.ws <http://binding.ws>
>>>        <http://binding.ws>
>>>               <http://binding.ws>
>>>                      <http://binding.ws> <http://binding.ws>
>>>                             <http://binding.ws>
>>>
>>>                                                                 uri="
>>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>>                                    <callback>
>>>                                    <binding.ws <http://binding.ws>
>>>        <http://binding.ws>
>>>               <http://binding.ws>
>>>                      <http://binding.ws> <http://binding.ws>
>>>                             <http://binding.ws>
>>>
>>>                                                         uri="
>>> http://localhost:8084/Client/MessageInterpreterCallback
>>>                                                         <
>>> http://localhost:8081/Client/MessageInterpreterCallback>"/>
>>>
>>>                                    </callback>
>>>                                    </service>
>>>                                       </component>
>>>
>>>
>>>                                       <component
>>>        name="AuditServiceComponent">
>>>                                           <implementation.java
>>>
>>> class="org.acme.logix.AuditServiceImpl"/>
>>>                                                   <service
>>>        name="AuditService">
>>>                                               <binding.jms
>>>
>>>  initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>>>                                    jndiURL="tcp://localhost:61616">
>>>                                      <destination
>>>        jndiName="AuditServiceQueue" />
>>>                                    </binding.jms>         </service>
>>>                                       </component>
>>>                                       </composite>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>

Re: Callback and Tuscany 2.0 Samples

Posted by Urso Wieske <uw...@gmail.com>.
Hi Simon,

I have been studying the source code around SCA binding.ws extension.
As you mentioned earlier, the Tuscany SCA runtime  uses by default de
reference implementation of JAX-WS binding.

In the resource of binding-ws-runtime-jaxws-ri at the path
META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory:

org.apache.tuscany.sca.binding.ws.jaxws.ri.JAXWSBindingProviderFactory;model=org.apache.tuscany.sca.binding.ws.WebServiceBinding

you can indeed see that the Factory JAXWSBindingProviderFactory is used as
default.

I believe -I have not digged into the code yet- that the reference
implementation is overridden as soon as the SCA runtime finds an alternative
binding.ws implementation on the classpath.
I check this by just adding the Axis2 extension to my dependency set and I
the runtime appears switch automatically to Axis2.

I manage to run my code with the maven plugin. I removed
                 <dependency>
     <groupId>org.apache.tuscany.sca</groupId>
     <artifactId>tuscany-node-impl</artifactId>
     <version>2.0-Beta1</version>
 </dependency>
 <dependency>
     <groupId>org.apache.tuscany.sca</groupId>
     <artifactId>tuscany-implementation-java-runtime</artifactId>
     <version>2.0-Beta1</version>
 </dependency>

from my dependencyset and ran my code succesfully.
I don't understand the "negative" effect of these two dependencies on my
code.

Maybe you have some clarification for this?


Kind Regards,
Urso

2011/1/15 Simon Nash <na...@apache.org>

> Urso Wieske wrote:
>
>> Hi Simon,
>>
>> Could you send me a copy of your POM which you have used /adapted?
>> Also which public repositories are you using to download your Tuscany 2.0
>> Beta1 dependencies?
>> (I have initially googled for a oublic maven repository where I could
>> donwload the Tuscany v2 Beta1 dependencies.)
>>
>> I replaced my base runtime for the 4 dependencies you have stated, but I
>> get runtime exceptions due to other causes. Most probably I should have
>> other dependencies too which you have not mentioned.
>>
>> Kind regards.
>> Urso
>>
>>  Hi Urso,
> My pom and JUnit test case are attached below.  The repository URL
> is included in the pom.
>
>  Simon
>
> ----- begin pom -----
>
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"
>         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>    <modelVersion>4.0.0</modelVersion>
>    <parent>
>        <groupId>org.apache.tuscany.sca</groupId>
>        <artifactId>tuscany-sca</artifactId>
>        <version>2.0-Beta1</version>
>    </parent>
>    <groupId>org.acme.logix</groupId>
>    <artifactId>handler-agent</artifactId>
>    <version>0.0.1-SNAPSHOT</version>
>    <packaging>jar</packaging>
>
>    <name>handler-agent</name>
>    <url>http://maven.apache.org</url>
>
>    <properties>
>        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>    </properties>
>
>    <repositories>
>        <repository>
>            <id>apache.staging</id>
>            <url>https://repository.apache.org/content/groups/staging</url>
>        </repository>
>    </repositories>
>
>    <build>
>        <finalName>afnemer-handling-agent-contribution</finalName>
>        <plugins>
>            <plugin>
>                <groupId>org.apache.tuscany.maven.plugins</groupId>
>                <artifactId>maven-tuscany-plugin</artifactId>
>                <version>2.0-Beta1</version>
>                <dependencies>
>                    <dependency>
>                        <groupId>org.apache.tuscany.sca</groupId>
>                        <artifactId>tuscany-binding-jms-runtime</artifactId>
>                        <version>2.0-Beta1</version>
>                    </dependency>
>
>                    <dependency>
>                        <groupId>org.apache.activemq</groupId>
>                        <artifactId>activemq-all</artifactId>
>                        <version>5.3.0</version>
>                        <scope>runtime</scope>
>                    </dependency>
>                </dependencies>
>            </plugin>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-compiler-plugin</artifactId>
>                <version>2.3.2</version>
>                <configuration>
>                    <source>1.6</source>
>                    <target>1.6</target>
>                </configuration>
>            </plugin>
>        </plugins>
>    </build>
>    <dependencies>
>        <dependency>
>            <groupId>org.apache.tuscany.sca</groupId>
>            <artifactId>tuscany-feature-api</artifactId>
>            <type>pom</type>
>            <version>2.0-Beta1</version>
>        </dependency>
>
>        <dependency>
>            <groupId>org.apache.tuscany.sca</groupId>
>            <artifactId>tuscany-binding-jms-runtime</artifactId>
>            <version>2.0-Beta1</version>
>        </dependency>
>
>        <dependency>
>            <groupId>org.apache.activemq</groupId>
>            <artifactId>activemq-all</artifactId>
>            <version>5.3.0</version>
>            <scope>runtime</scope>
>        </dependency>
>
>       <dependency>
>            <groupId>org.apache.tuscany.sca</groupId>
>            <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>            <version>2.0-Beta1</version>
>       </dependency>
>
>        <dependency>
>            <groupId>org.apache.tuscany.sca</groupId>
>            <artifactId>tuscany-host-jetty</artifactId>
>            <version>2.0-Beta1</version>
>        </dependency>
>
>        <dependency>
>            <groupId>org.apache.tuscany.sca</groupId>
>            <artifactId>tuscany-node-impl</artifactId>
>            <version>2.0-Beta1</version>
>        </dependency>
>
>        <dependency>
>            <groupId>org.apache.tuscany.sca</groupId>
>            <artifactId>tuscany-implementation-java-runtime</artifactId>
>            <version>2.0-Beta1</version>
>        </dependency>
>
>        <dependency>
>            <groupId>junit</groupId>
>            <artifactId>junit</artifactId>
>            <version>4.8.1</version>
>            <scope>test</scope>
>        </dependency>
>    </dependencies>
> </project>
>
> ----- begin test case -----
>
> package acme;
>
> import org.apache.activemq.broker.BrokerService;
> import org.apache.tuscany.sca.node.Contribution;
> import org.apache.tuscany.sca.node.Node;
> import org.apache.tuscany.sca.node.NodeFactory;
> import org.junit.Test;
>
> public class CallbackTestCase {
>
>    @Test
>    public void testSayHello() throws Exception {
>
>        // Start the JMS broker
>        BrokerService jmsBroker = new BrokerService();
>        jmsBroker.setPersistent(false);
>        jmsBroker.setUseJmx(false);
>        jmsBroker.addConnector("tcp://localhost:61616");
>        jmsBroker.start();
>
>        // Start the Tuscany runtime with this module as the contribution
>        System.out.println("starting Tuscany runtime");
>        Node node = NodeFactory.newInstance().createNode(new
> Contribution("c1", "target/classes"));
>        System.out.println("Tuscany runtime started");
>
>        // Start the Tuscany node. This also runs the @EagerInit test
> method.
>        node.start();
>        System.out.println("Tuscany node started");
>
>        // Stop the Tuscany runtime
>        node.stop();
>
>        // Stop the JMS broker
>        jmsBroker.stop();
>    }
>
> }
>
> ----- end test case -----
>
>  > 2011/1/15 Simon Nash <nash@apache.org <ma...@apache.org>>
>
>>
>>    Urso Wieske wrote:
>>
>>        Hi Simon,
>>
>>        Thanks for the quick response.
>>        That's a pitty that maven-tuscany-plugin is not behaving
>>        accordingly. It's a great instrument to use within my IDE
>>        (Eclipse). I'll submit an issue at the Tuscany projectsite. I
>>        will also dig into the "maven-tuscany-plugin" problem to figure
>>        out what is the cause of this deviation.
>>
>>    Hi Urso,
>>    I agree.  It should be possible to use maven-tuscany-plugin and
>>    replace things in the base runtime by alternative implementations.
>>    Maybe there is a way to do this, but I couldn't find one.
>>
>>     Simon
>>
>>        Kind Regards
>>        Urso
>>
>>
>>        2011/1/15 Simon Nash <nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>
>>
>>           Urso Wieske wrote:
>>
>>               Hi Simon,
>>
>>               I have uploaded my sources as a zipped file.
>>
>>           Hi Urso,
>>           This problem is caused by a bug in Tuscany.  Please raise a JIRA
>>           so that we can track and fix the problem.  In the meantime, I
>> can
>>           suggest a partial workaround.
>>
>>           The injection failure only happens if Tuscany is using the
>>           tuscany-binding-ws-runtime-jaxws module as the runtime
>>        implementation
>>           for <binding.ws <http://binding.ws> <http://binding.ws>>.  It
>>        doesn't happen if
>>           tuscany-binding-ws-runtime-axis2
>>           is used instead of tuscany-binding-ws-runtime-jaxws.  This
>>        implies that
>>           the problem is caused by a bug in the -jaxws version.
>>
>>           By default, Tuscany uses the -jaxws version.  To get Tuscany
>>        to use
>>           the -axis2 version instead, you need to do special
>>        configuration in
>>           the pom.xml file.
>>
>>           Unfortunately I couldn't find a way to make this change when
>>        using
>>           maven-tuscany-plugin to run the application.  This is because
>>           maven-tuscany-plugin has a dependency on tuscany-base-runtime.
>>           The tuscany-base-runtime jar contains the -jaxws version and
>>        seems
>>           to always use it even if the -axis2 version is declared as an
>>           additional dependency.
>>
>>           I did find a way to get Tuscany to use the -axis2 version
>>        when not
>>           using maven-tuscany-plugin.  If you replace this dependency:
>>            <dependency>
>>                <groupId>org.apache.tuscany.sca</groupId>
>>                <artifactId>tuscany-base-runtime</artifactId>
>>                <version>2.0-Beta1</version>
>>            </dependency>
>>
>>           by the following four dependencies:
>>            <dependency>
>>                <groupId>org.apache.tuscany.sca</groupId>
>>                <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>>                <version>2.0-Beta1</version>
>>            </dependency>
>>
>>            <dependency>
>>                <groupId>org.apache.tuscany.sca</groupId>
>>                <artifactId>tuscany-host-jetty</artifactId>
>>                <version>2.0-Beta1</version>
>>            </dependency>
>>
>>            <dependency>
>>                <groupId>org.apache.tuscany.sca</groupId>
>>                <artifactId>tuscany-node-impl</artifactId>
>>                <version>2.0-Beta1</version>
>>            </dependency>
>>
>>            <dependency>
>>                <groupId>org.apache.tuscany.sca</groupId>
>>
>>  <artifactId>tuscany-implementation-java-runtime</artifactId>
>>                <version>2.0-Beta1</version>
>>            </dependency>
>>
>>           then the application runs successfully.  I used a maven JUnit
>>        test
>>           to verify this.
>>
>>            Simon
>>
>>               Hi Simon,
>>
>>               I adapted my code as you suggested. It seems like the
>>        error has
>>               dissappeared, but I got new ones. Well I removed the
>>        setter and
>>               getter of messageInterpreterCallback from
>>               MessageInterpreterImpl. Now my MessageInterpreterImpl class
>>               contains only the instance variable
>>        messageInterpreterCallback .
>>               I have made it a protected variable.
>>
>>               I get a HTTP Internal Server ( error 500).
>>               I am still missing something.SCA runtime is supposed
>>               "automatically" inject my callback instance in the
>>               messageInterpreterCallback member variable of
>>               MessageInterpreterImpl. The MessageInterpreterImpl needs
>>        to have
>>               a reference to some callback instance.
>>               I can;t seem to solve this problem.
>>
>>               This is the error....
>>               ---------------------------------------
>>               SEVERE: Exception invoking injector - null
>>               org.oasisopen.sca.ServiceRuntimeException: Exception
>> invoking
>>               injector - null
>>               at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>>               at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>               at
>>
>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>               at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>               at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>               at
>>
>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>               at
>>
>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>               at
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>               at
>>
>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>               at
>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>               at
>> sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>               at
>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>               at
>>
>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>               at
>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>               at
>>        sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>               at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>               at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>               at java.lang.Thread.run(Thread.java:662)
>>               Caused by:
>>               org.apache.tuscany.sca.core.factory.ObjectCreationException:
>>               Exception invoking injector - null
>>               at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>>               at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>>               ... 27 more
>>               Caused by: java.lang.NullPointerException
>>               at
>>
>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>>               at
>>
>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>>               at
>>
>>  org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>>               at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>>               ... 28 more
>>               10-jan-2011 1:39:26
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>>               processRequest
>>               SEVERE: The server sent HTTP status code 500: Internal
>>        Server Error
>>               com.sun.xml.internal.ws.client.ClientTransportException: The
>>               server sent HTTP status code 500: Internal Server Error
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>               at
>> com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>>               at
>>
>>  com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>>               at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>>               at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>>               at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>>               at $Proxy50.interpret(Unknown Source)
>>               at
>>
>>  org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>>               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>        Method)
>>               at
>>
>>  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>               at
>>
>>  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>               at java.lang.reflect.Method.invoke(Method.java:597)
>>               at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>>               at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>               at
>>
>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>               at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>               at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>               at
>>
>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>               at
>>
>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>               at
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>               at
>>
>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>               at
>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>               at
>> sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>               at
>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>               at
>>
>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>               at
>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>               at
>>        sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>               at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>               at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>               at java.lang.Thread.run(Thread.java:662)
>>               -----------------------------------------
>>                Hope you can help me. (?)
>>
>>               Kind Regards
>>               Urso
>>
>>
>>
>>
>>               2011/1/14 Simon Nash <nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>
>>               <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>>
>>
>>
>>                  Hi Urso,
>>                  I'm starting to look at your project code now.
>>
>>                  It's important to keep these threads on the Tuscany
>>        mailing list
>>                  so that other members of the Tuscany community are
>>        included in
>>                  the discussion.  The Tuscany mailing list archives are an
>>               important
>>                  resource for Tuscany users who are experiencing a
>>        problem and are
>>                  looking to see if others have found a solution.  If a
>>        problem is
>>                  solved by a private message exchange instead of on the
>>        public
>>               list,
>>                  the knowledge of how to solve it is confined to one
>> person
>>               instead
>>                  of being shared by the community.
>>
>>                  The best way to make this happen would be for you to
>>        resend your
>>                  recent private emails to the public list.  I'll look
>>        out for them
>>                  on the public list so that I can respond to them there.
>>
>>                   Simon
>>
>>                  Urso Wieske wrote:
>>
>>                      Hi Simon,
>>
>>                      You'll find in this email the zipped file
>>        containing my
>>               sourcecode.
>>
>>                      Unfortunately, I still have errors.
>>                      I changed the member variable from protected to
>>        private
>>               like you
>>                      suggested.
>>                      And created Getter and Setter for this member
>>        variable.
>>                      (messageInterpreterCallback).
>>                      I annotated the setter with @Callback.
>>                      I also removed the URI attribute from the
>>               callback/binding.ws <http://binding.ws> <http://binding.ws>
>>                      <http://binding.ws> <http://binding.ws> element of
>> the
>>               service
>>
>>                      according to your suggestion. Still problems.... :-(
>>
>>
>>                      I have zipped my source. It's an Eclipse project.
>>
>>                      I appreciate the fact that you are willing to
>>        verify this
>>               issue.
>>                      If you have any questions about the code, just let
>>        me know.
>>
>>                      Please checkout also if my POM is well specified with
>>               regard to
>>                      dependencies. Do I have the proper dependencies. I
>>        am using
>>                      Tuscany 2.0 Beta1.
>>
>>                      Kind Regards
>>                      Urso
>>
>>
>>                      2011/1/10 Simon Nash <nash@apache.org
>>        <ma...@apache.org>
>>               <mailto:nash@apache.org <ma...@apache.org>>
>>        <mailto:nash@apache.org <ma...@apache.org>
>>               <mailto:nash@apache.org <ma...@apache.org>>>
>>                      <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>
>>               <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>>>
>>
>>
>>                         Urso Wieske wrote:
>>
>>                             Hi Simon,
>>
>>                             I adapted my code as you suggested. It
>>        seems like the
>>                      error has
>>                             dissappeared, but I got new ones. Well I
>>        removed the
>>                      setter and
>>                             getter of messageInterpreterCallback from
>>                             MessageInterpreterImpl. Now my
>>               MessageInterpreterImpl class
>>                             contains only the instance variable
>>                      messageInterpreterCallback .
>>                             I have made it a protected variable.
>>
>>                         According to the SCA 1.1 specs, this variable
>>        should
>>               be private
>>                         in order to avoid having it treated as a
>> reference.
>>                Can you try
>>                         changing this and see if it makes any difference?
>>
>>
>>                             I get a HTTP Internal Server ( error 500).
>>                             I am still missing something.SCA runtime is
>>        supposed
>>                             "automatically" inject my callback instance
>>        in the
>>                             messageInterpreterCallback member variable of
>>                             MessageInterpreterImpl. The
>>        MessageInterpreterImpl
>>               needs
>>                      to have
>>                             a reference to some callback instance.
>>                             I can;t seem to solve this problem.
>>
>>                          >From the stack trace it seems that the thread
>>        message
>>                      context doesn't
>>                         contain the callback endpoint.  I'm not sure what
>>               could cause
>>                      this.
>>                         However I noticed a problem in your composite that
>>               would be worth
>>                         fixing, and it's just possible that this might be
>>               related to the
>>                         problem that you're seeing.
>>
>>                         The problem is that you have specified a
>>        callback URI
>>               for the
>>                         MessageInterpreter service in
>>               MessageInterpreterComponent, as
>>                      follows:
>>
>>                          <service name="MessageInterpreter">
>>                            <interface.java
>>               interface="org.acme.logix.MessageInterpreter"
>>
>> callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>                            <binding.ws <http://binding.ws>
>>        <http://binding.ws> <http://binding.ws>
>>               <http://binding.ws>
>>
>>
>>                                              uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>                            <callback>
>>                              <binding.ws <http://binding.ws>
>>        <http://binding.ws>
>>               <http://binding.ws> <http://binding.ws>
>>                                       uri="
>> http://localhost:8084/Client/MessageInterpreterCallback"/>
>>                            </callback>
>>                          </service>
>>
>>                         There shouldn't be any callback URI in the service
>>                      definition, because
>>                         this information is provided at runtime by the
>>        client
>>                      invocation.  So
>>                         you should change the above to:
>>
>>                          <service name="MessageInterpreter">
>>                            <interface.java
>>               interface="org.acme.logix.MessageInterpreter"
>>
>> callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>                            <binding.ws <http://binding.ws>
>>        <http://binding.ws> <http://binding.ws>
>>               <http://binding.ws>
>>
>>
>>                                              uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>                            <callback>
>>                              <binding.ws/ <http://binding.ws/>
>>        <http://binding.ws/>
>>               <http://binding.ws/> <http://binding.ws/>>
>>
>>
>>                            </callback>
>>                          </service>
>>
>>                         If neither of these suggested changes fixes the
>>               problem, please
>>                         post the complete application as a zip file.
>>
>>                          Simon
>>
>>                             This is the error....
>>                             ---------------------------------------
>>                             SEVERE: Exception invoking injector - null
>>                             org.oasisopen.sca.ServiceRuntimeException:
>>               Exception invoking
>>                             injector - null
>>                             at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>>                             at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>                             at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>                             at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>                             at
>>
>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>                             at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>                             at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>                             at
>>
>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>                             at
>>
>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>                             at
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>                             at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>                             at
>>
>> com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>                             at
>>
>> com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>                             at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>                             at
>>
>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>                             at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>                             at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>                             at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>                             at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>                             at
>>
>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                             at
>>               sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>                             at
>>
>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>                             at
>>
>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>                             at
>>
>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                             at
>>
>>  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>                             at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>                             at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>                             at java.lang.Thread.run(Thread.java:662)
>>                             Caused by:
>>
>> org.apache.tuscany.sca.core.factory.ObjectCreationException:
>>                             Exception invoking injector - null
>>                             at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>>                             at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>>                             ... 27 more
>>                             Caused by: java.lang.NullPointerException
>>                             at
>>
>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>>                             at
>>
>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>>                             at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>>                             at
>>
>>  org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>>                             at
>>
>>  org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>>                             at
>>
>>  org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>>                             at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>>                             ... 28 more
>>                             10-jan-2011 1:39:26
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>>                             processRequest
>>                             SEVERE: The server sent HTTP status code
>>        500: Internal
>>                      Server Error
>>
>> com.sun.xml.internal.ws.client.ClientTransportException: The
>>                             server sent HTTP status code 500: Internal
>>        Server
>>               Error
>>                             at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>>                             at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>>                             at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>>                             at
>>
>>  com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>>                             at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>                             at
>>
>> com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>                             at
>>
>> com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>                             at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>                             at
>>               com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>>                             at
>>
>>  com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>>                             at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>>                             at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>>                             at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>                             at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>>                             at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>>                             at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>>                             at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>>                             at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>>                             at $Proxy50.interpret(Unknown Source)
>>                             at
>>
>>  org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>>                             at
>>        sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>                      Method)
>>                             at
>>
>>  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>                             at
>>
>>  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>                             at
>>        java.lang.reflect.Method.invoke(Method.java:597)
>>                             at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>>                             at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>                             at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>                             at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>                             at
>>
>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>                             at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>                             at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>                             at
>>
>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>                             at
>>
>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>                             at
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>                             at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>                             at
>>
>> com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>                             at
>>
>> com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>                             at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>                             at
>>
>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>                             at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>                             at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>                             at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>                             at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>                             at
>>
>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                             at
>>               sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>                             at
>>
>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>                             at
>>
>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>                             at
>>
>> com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                             at
>>
>>  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>                             at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>                             at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>                             at java.lang.Thread.run(Thread.java:662)
>>                             -----------------------------------------
>>                              Hope you can help me. (?)
>>
>>                             Kind Regards
>>                             Urso
>>
>>                             2011/1/9 Simon Nash <nash@apache.org
>>        <ma...@apache.org>
>>               <mailto:nash@apache.org <ma...@apache.org>>
>>                      <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>
>>               <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>
>>                      <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>>
>>                             <mailto:nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>
>>               <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>
>>                      <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>
>>               <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>>>>
>>
>>
>>
>>                                Urso Wieske wrote:
>>
>>                                    Hi
>>                                    I am evaluating Tuscany 2.0 Beta1 and
>> am
>>               trying to
>>                      learn more
>>                                    about Callbacks (Bi-Directional
>>        interface)
>>               of SCA
>>                      1.1. I
>>                                    downloaded the Tuscany Sample files and
>>               started to
>>                             explore the
>>                                    callback implementations with
>> webservice
>>               binding,
>>                      i.e. the
>>                                    Search and SearchCallback interfaces.
>>                                    It took me a while before I realized
>>        that the
>>                      Tuscany SCA
>>                                    Samples were based on SCA v1.0.
>>  Tuscany
>>               2.0 Beta1 is
>>                             based on
>>                                    the SCA v1.1 specs.
>>                                    After studying the sample sources, I
>>        have
>>               written
>>                      my own
>>                             callback.
>>
>>                                    Unfortunately, I kept on getting a
>>        runtime
>>                      exception after I
>>                                    installed and deployed my
>>        contribution. By the
>>                      way, I am
>>                             using
>>                                    Eclipse and the maven tuscany plugin.
>>
>>                                    I can't find the problem and hope if
>>               someone can
>>                      point me
>>                             in the
>>                                    right direction.
>>
>>                                    This is the error (printed on my
>>        console) I am
>>                      getting when I
>>                                    try to run my program:
>>                                    [ERROR] Failed to execute goal
>>
>>  org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>>                                    (default-cli) on project handler-agent:
>>               Execution
>>                             default-cli of
>>                                    goal
>>
>>  org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>>                                    failed:
>>               org.oasisopen.sca.ServiceRuntimeException:
>>                             [Composite:
>>                                                  {
>> http://docs.oasis-open.org/ns/opencsa/sca/200912},
>>                             Component:
>>                                    MessageInterpreterComponent] -
>>        [ASM60033] No
>>                      targets for
>>                                    reference: Composite =
>>                                                  {
>> http://docs.oasis-open.org/ns/opencsa/sca/200912}
>>                             Reference =
>>                                    messageInterpreterCallback -> [Help 1]
>>
>>                                    I suspect that I am doing something
>>        wrong
>>               in the
>>                             composite file.
>>                                    I can't imagine I did something wrong
>> in
>>               the java
>>                             sources. (See
>>                                    below for the sources.)
>>
>>                                Because the MessageInterpreterImpl class
>>        doesn't
>>                      contain any
>>                                @Reference or
>>                                @Property annotations, SCA creates implicit
>>               references for
>>                             all public
>>                                setter methods in this class whose type is
>> a
>>               remotable SCA
>>                                interface, and
>>                                also for all public or protected fields
>>        in this
>>               class
>>                      whose
>>                             type is a
>>                                remotable SCA interface.
>>
>>                                There is a public setter method
>>                             setMessageInterpreterCallback() and a
>>                                protected field
>>        messageInterpreterCallback, so SCA
>>                      defines a
>>                             reference
>>                                named messageInterpreterCallback.  This
>>               reference doesn't
>>                             have a target
>>                                configured in the composite, hence the
>> error
>>               message.
>>
>>                                To fix the problem, you need to remove
>>        the setter
>>                      method (or
>>                             make it
>>                                protected) and change the field from
>>        protected
>>               to private.
>>
>>                                 Simon
>>
>>
>>                                    Kind Regards,
>>
>>                                    Urso
>>
>>
>>                                    -------------------- THE SERVICE
>>        Interface With
>>                      Callback
>>                                    Interface association ----------
>>                                    /**
>>                                     *  */
>>                                    package org.acme.logix;
>>
>>                                    import org.acme.logix.message.Message;
>>                                    import
>>        org.oasisopen.sca.annotation.Callback;
>>                                    import
>>        org.oasisopen.sca.annotation.OneWay;
>>                                    import
>>        org.oasisopen.sca.annotation.Remotable;
>>
>>                                    /**
>>                                     *  *
>>                                     */
>>                                    @Remotable
>>
>> @Callback(MessageInterpreterCallback.class)
>>                                    public interface MessageInterpreter {
>>
>>                                    @OneWay
>>                                    void interpret(Message msg);
>>                                    }
>>
>>
>>                                    /**
>>                                     *  */
>>                                    package org.acme.logix;
>>
>>                                    import
>>        org.oasisopen.sca.annotation.OneWay;
>>                                    import
>>        org.oasisopen.sca.annotation.Remotable;
>>
>>                                    /**
>>                                     *  *
>>                                     */
>>                                    @Remotable
>>                                    public interface
>>        MessageInterpreterCallback {
>>                                    void onInterpret(Interpretation ipr);
>>                                    }
>>
>>
>>                                    ---------- THE CLIENT implementing
>>        the callback
>>                      interface
>>                                    ------------
>>
>>                                    /**
>>                                     *  */
>>                                    package org.acme.logix;
>>
>>                                    import org.acme.logix.message.Message;
>>                                    import
>>        org.oasisopen.sca.annotation.Reference;
>>
>>                                    /**
>>                                     *  */
>>                                    public class LogisticCenterImpl
>>        implements
>>                      LogisticCenter,
>>                                    MessageInterpreterCallback {
>>                                    private AuditService auditService;
>>                                    @Reference
>>                                    protected MessageInterpreter
>>               messageInterpreter;
>>
>>                                    /* (non-Javadoc)
>>                                    * @see
>>
>>  org.acme.logix.LogisticCenter#processMessage(org.acme.logix.message.Message)
>>                                    */
>>                                    public void processMessage(Message
>>        message) {
>>                                    System.out.println("Processing
>>        message with
>>                      payload " +
>>                                    message.getPayload() );
>>                                    auditService.logSentMessage(message);
>>                                    messageInterpreter.interpret(message);
>>                                    }
>>
>>                                    /**
>>                                    * @return the auditService
>>                                    */
>>                                    public AuditService getAuditService() {
>>                                    return auditService;
>>                                    }
>>
>>                                    /**
>>                                    * @param auditService the
>>        auditService to set
>>                                    */
>>                                    @Reference
>>                                    public void
>> setAuditService(AuditService
>>                      auditService) {
>>                                    this.auditService = auditService;
>>                                    }
>>
>>                                    /**
>>                                    * @param messageInterpreter the
>>               messageInterpreter
>>                      to set
>>                                    */
>>                                    public void
>>               setMessageInterpreter(MessageInterpreter
>>                                    messageInterpreter) {
>>                                    this.messageInterpreter =
>>        messageInterpreter;
>>                                    }
>>
>>                                    /**
>>                                    * @return the messageInterpreter
>>                                    */
>>                                    public MessageInterpreter
>>               getMessageInterpreter() {
>>                                    return messageInterpreter;
>>                                    }
>>
>>
>>                                           /**
>>                                           *  THE CALLBACK method of
>>                      MessageInterpreterCallback
>>                                    interface
>>                                           */
>>                                    public void
>>        onInterpret(Interpretation ipr) {
>>                                    System.out.println("Message has been
>>               interpreted.");
>>                                    }
>>
>>                                    }
>>
>>
>>                                    ---------THE SERVICE WHICH IS CALLED
>>        BY THE
>>               CLIENT
>>                      THROUGH
>>                                    WEBSERVICE BINDING ---------
>>
>>                                    /**
>>                                     *  */
>>                                    package org.acme.logix;
>>
>>                                    import org.acme.logix.message.Message;
>>                                    import
>> org.oasisopen.sca.RequestContext;
>>                                    import
>>        org.oasisopen.sca.ServiceReference;
>>                                    import
>>        org.oasisopen.sca.annotation.Callback;
>>                                    import
>>        org.oasisopen.sca.annotation.Context;
>>                                    import
>>        org.oasisopen.sca.annotation.Reference;
>>                                    import
>>        org.oasisopen.sca.annotation.Service;
>>
>>                                    /**
>>                                     *  *
>>                                     */
>>                                    public class MessageInterpreterImpl
>>        implements
>>                             MessageInterpreter{
>>
>>                                    @Callback
>>                                    protected MessageInterpreterCallback
>>                             messageInterpreterCallback;
>>                                    /* (non-Javadoc)
>>                                    * @see
>>
>>  org.acme.logix.MessageInterpreter#interpret(org.acme.logix.message.Message)
>>                                    */
>>                                    public void interpret(Message msg) {
>>                                    System.out.println("The message is
>> being
>>                      interpreted..");
>>                                    Interpretation ipr = new
>>        Interpretation();
>>
>> messageInterpreterCallback.onInterpret(ipr);
>>                                    }
>>
>>
>>
>>                                    /**
>>                                    * @return the
>> messageInterpreterCallback
>>                                    */
>>                                    public MessageInterpreterCallback
>>                             getMessageInterpreterCallback() {
>>                                    return messageInterpreterCallback;
>>                                    }
>>
>>
>>
>>                                    /**
>>                                    * @param messageInterpreterCallback the
>>                                    messageInterpreterCallback to set
>>                                    */
>>                                    public void
>>        setMessageInterpreterCallback(
>>                                    MessageInterpreterCallback
>>                      messageInterpreterCallback) {
>>                                    this.messageInterpreterCallback =
>>                      messageInterpreterCallback;
>>                                    }
>>                                    }
>>
>>
>>
>>
>>
>>                                    ---- THE COMPOSITE -----------
>>
>>
>>
>>                                    <composite
>>                                           xmlns="
>> http://docs.oasis-open.org/ns/opencsa/sca/200912"
>>                                                     targetNamespace="
>> http://logistix"
>>                                                     xmlns:logistix="
>> http://logistix"
>>                                              name="AfnemerLogisticCenter">
>>
>>                                       <component
>>               name="AfnemerHandlingAgentComponent">
>>                                    <implementation.java
>>                             class="org.acme.logix.HandlingAgentImpl"/>
>>                                             <reference
>>        name="logisticCenter" >
>>                                            <binding.ws
>>        <http://binding.ws> <http://binding.ws>
>>               <http://binding.ws>
>>                      <http://binding.ws>
>>                             <http://binding.ws> <http://binding.ws>
>>
>>                                                                uri="
>> http://127.0.0.1:8087/AfnemerHandlingAgentComponent"/>
>>                           </reference>         <reference
>>                      name="auditService"
>>                                    target="AuditServiceComponent"/>
>>                                </component>
>>
>>
>>
>>                                       <component
>>               name="AfnemerLogisticCenterComponent">
>>                                           <implementation.java
>>
>> class="org.acme.logix.LogisticCenterImpl"/>
>>                                           <reference
>>        name="messageInterpreter">
>>                                    <interface.java
>>
>>  interface="org.acme.logix.MessageInterpreter"
>>
>> callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>
>>                                    <binding.ws <http://binding.ws>
>>        <http://binding.ws>
>>               <http://binding.ws>
>>                      <http://binding.ws> <http://binding.ws>
>>                             <http://binding.ws>
>>
>>                                                                uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>                                    <callback >
>>                                    <binding.ws <http://binding.ws>
>>        <http://binding.ws>
>>               <http://binding.ws>
>>                      <http://binding.ws> <http://binding.ws>
>>                             <http://binding.ws>
>>
>>                                                         uri="
>> http://localhost:8084/Client/MessageInterpreterCallback
>>                                                         <
>> http://localhost:8081/Client/MessageInterpreterCallback>" />
>>
>>                                    </callback>
>>                                    </reference>
>>                                           <reference
>>        name="auditService">
>>           <binding.jms
>>
>>  initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>>                                    jndiURL="tcp://localhost:61616">
>>                                      <destination
>>        jndiName="AuditServiceQueue" />
>>                                      </binding.jms>         </reference>
>>                                            </component>
>>                                           <component
>>               name="MessageInterpreterComponent">
>>                                        <implementation.java
>>
>> class="org.acme.logix.MessageInterpreterImpl"/>
>>                                            <service
>>        name="MessageInterpreter">
>>                                    <interface.java
>>                      interface="org.acme.logix.MessageInterpreter"
>>
>>          callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>                                    <binding.ws <http://binding.ws>
>>        <http://binding.ws>
>>               <http://binding.ws>
>>                      <http://binding.ws> <http://binding.ws>
>>                             <http://binding.ws>
>>
>>                                                                 uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>                                    <callback>
>>                                    <binding.ws <http://binding.ws>
>>        <http://binding.ws>
>>               <http://binding.ws>
>>                      <http://binding.ws> <http://binding.ws>
>>                             <http://binding.ws>
>>
>>                                                         uri="
>> http://localhost:8084/Client/MessageInterpreterCallback
>>                                                         <
>> http://localhost:8081/Client/MessageInterpreterCallback>"/>
>>
>>                                    </callback>
>>                                    </service>
>>                                       </component>
>>
>>
>>                                       <component
>>        name="AuditServiceComponent">
>>                                           <implementation.java
>>
>> class="org.acme.logix.AuditServiceImpl"/>
>>                                                   <service
>>        name="AuditService">
>>                                               <binding.jms
>>
>>  initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>>                                    jndiURL="tcp://localhost:61616">
>>                                      <destination
>>        jndiName="AuditServiceQueue" />
>>                                    </binding.jms>         </service>
>>                                       </component>
>>                                       </composite>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>

Re: Callback and Tuscany 2.0 Samples

Posted by Simon Nash <na...@apache.org>.
Urso Wieske wrote:
> Hi Simon,
> 
> Could you send me a copy of your POM which you have used /adapted?
> Also which public repositories are you using to download your Tuscany 
> 2.0 Beta1 dependencies?
> (I have initially googled for a oublic maven repository where I could 
> donwload the Tuscany v2 Beta1 dependencies.)
> 
> I replaced my base runtime for the 4 dependencies you have stated, but I 
> get runtime exceptions due to other causes. Most probably I should have 
> other dependencies too which you have not mentioned.
> 
> Kind regards.
> Urso
>
Hi Urso,
My pom and JUnit test case are attached below.  The repository URL
is included in the pom.

   Simon

----- begin pom -----

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.tuscany.sca</groupId>
         <artifactId>tuscany-sca</artifactId>
         <version>2.0-Beta1</version>
     </parent>
     <groupId>org.acme.logix</groupId>
     <artifactId>handler-agent</artifactId>
     <version>0.0.1-SNAPSHOT</version>
     <packaging>jar</packaging>

     <name>handler-agent</name>
     <url>http://maven.apache.org</url>

     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>

     <repositories>
         <repository>
             <id>apache.staging</id>
             <url>https://repository.apache.org/content/groups/staging</url>
         </repository>
     </repositories>

     <build>
         <finalName>afnemer-handling-agent-contribution</finalName>
         <plugins>
             <plugin>
                 <groupId>org.apache.tuscany.maven.plugins</groupId>
                 <artifactId>maven-tuscany-plugin</artifactId>
                 <version>2.0-Beta1</version>
                 <dependencies>
                     <dependency>
                         <groupId>org.apache.tuscany.sca</groupId>
                         <artifactId>tuscany-binding-jms-runtime</artifactId>
                         <version>2.0-Beta1</version>
                     </dependency>

                     <dependency>
                         <groupId>org.apache.activemq</groupId>
                         <artifactId>activemq-all</artifactId>
                         <version>5.3.0</version>
                         <scope>runtime</scope>
                     </dependency>
                 </dependencies>
             </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <version>2.3.2</version>
                 <configuration>
                     <source>1.6</source>
                     <target>1.6</target>
                 </configuration>
             </plugin>
         </plugins>
     </build>
     <dependencies>
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-feature-api</artifactId>
             <type>pom</type>
             <version>2.0-Beta1</version>
         </dependency>

         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-binding-jms-runtime</artifactId>
             <version>2.0-Beta1</version>
         </dependency>

         <dependency>
             <groupId>org.apache.activemq</groupId>
             <artifactId>activemq-all</artifactId>
             <version>5.3.0</version>
             <scope>runtime</scope>
         </dependency>

        <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
             <version>2.0-Beta1</version>
        </dependency>

         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-host-jetty</artifactId>
             <version>2.0-Beta1</version>
         </dependency>

         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-node-impl</artifactId>
             <version>2.0-Beta1</version>
         </dependency>

         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-implementation-java-runtime</artifactId>
             <version>2.0-Beta1</version>
         </dependency>

         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <version>4.8.1</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
</project>

----- begin test case -----

package acme;

import org.apache.activemq.broker.BrokerService;
import org.apache.tuscany.sca.node.Contribution;
import org.apache.tuscany.sca.node.Node;
import org.apache.tuscany.sca.node.NodeFactory;
import org.junit.Test;

public class CallbackTestCase {

     @Test
     public void testSayHello() throws Exception {

         // Start the JMS broker
         BrokerService jmsBroker = new BrokerService();
         jmsBroker.setPersistent(false);
         jmsBroker.setUseJmx(false);
         jmsBroker.addConnector("tcp://localhost:61616");
         jmsBroker.start();

         // Start the Tuscany runtime with this module as the contribution
         System.out.println("starting Tuscany runtime");
         Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "target/classes"));
         System.out.println("Tuscany runtime started");

         // Start the Tuscany node. This also runs the @EagerInit test method.
         node.start();
         System.out.println("Tuscany node started");

         // Stop the Tuscany runtime
         node.stop();

         // Stop the JMS broker
         jmsBroker.stop();
     }

}

----- end test case -----

  > 2011/1/15 Simon Nash <nash@apache.org <ma...@apache.org>>
> 
>     Urso Wieske wrote:
> 
>         Hi Simon,
> 
>         Thanks for the quick response.
>         That's a pitty that maven-tuscany-plugin is not behaving
>         accordingly. It's a great instrument to use within my IDE
>         (Eclipse). I'll submit an issue at the Tuscany projectsite. I
>         will also dig into the "maven-tuscany-plugin" problem to figure
>         out what is the cause of this deviation.
> 
>     Hi Urso,
>     I agree.  It should be possible to use maven-tuscany-plugin and
>     replace things in the base runtime by alternative implementations.
>     Maybe there is a way to do this, but I couldn't find one.
> 
>      Simon
> 
>         Kind Regards
>         Urso
> 
> 
>         2011/1/15 Simon Nash <nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>
> 
>            Urso Wieske wrote:
> 
>                Hi Simon,
> 
>                I have uploaded my sources as a zipped file.
> 
>            Hi Urso,
>            This problem is caused by a bug in Tuscany.  Please raise a JIRA
>            so that we can track and fix the problem.  In the meantime, I can
>            suggest a partial workaround.
> 
>            The injection failure only happens if Tuscany is using the
>            tuscany-binding-ws-runtime-jaxws module as the runtime
>         implementation
>            for <binding.ws <http://binding.ws> <http://binding.ws>>.  It
>         doesn't happen if
>            tuscany-binding-ws-runtime-axis2
>            is used instead of tuscany-binding-ws-runtime-jaxws.  This
>         implies that
>            the problem is caused by a bug in the -jaxws version.
> 
>            By default, Tuscany uses the -jaxws version.  To get Tuscany
>         to use
>            the -axis2 version instead, you need to do special
>         configuration in
>            the pom.xml file.
> 
>            Unfortunately I couldn't find a way to make this change when
>         using
>            maven-tuscany-plugin to run the application.  This is because
>            maven-tuscany-plugin has a dependency on tuscany-base-runtime.
>            The tuscany-base-runtime jar contains the -jaxws version and
>         seems
>            to always use it even if the -axis2 version is declared as an
>            additional dependency.
> 
>            I did find a way to get Tuscany to use the -axis2 version
>         when not
>            using maven-tuscany-plugin.  If you replace this dependency:
>             <dependency>
>                 <groupId>org.apache.tuscany.sca</groupId>
>                 <artifactId>tuscany-base-runtime</artifactId>
>                 <version>2.0-Beta1</version>
>             </dependency>
> 
>            by the following four dependencies:
>             <dependency>
>                 <groupId>org.apache.tuscany.sca</groupId>
>                 <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>                 <version>2.0-Beta1</version>
>             </dependency>
> 
>             <dependency>
>                 <groupId>org.apache.tuscany.sca</groupId>
>                 <artifactId>tuscany-host-jetty</artifactId>
>                 <version>2.0-Beta1</version>
>             </dependency>
> 
>             <dependency>
>                 <groupId>org.apache.tuscany.sca</groupId>
>                 <artifactId>tuscany-node-impl</artifactId>
>                 <version>2.0-Beta1</version>
>             </dependency>
> 
>             <dependency>
>                 <groupId>org.apache.tuscany.sca</groupId>
>                 <artifactId>tuscany-implementation-java-runtime</artifactId>
>                 <version>2.0-Beta1</version>
>             </dependency>
> 
>            then the application runs successfully.  I used a maven JUnit
>         test
>            to verify this.
> 
>             Simon
> 
>                Hi Simon,
> 
>                I adapted my code as you suggested. It seems like the
>         error has
>                dissappeared, but I got new ones. Well I removed the
>         setter and
>                getter of messageInterpreterCallback from
>                MessageInterpreterImpl. Now my MessageInterpreterImpl class
>                contains only the instance variable
>         messageInterpreterCallback .
>                I have made it a protected variable.
> 
>                I get a HTTP Internal Server ( error 500).
>                I am still missing something.SCA runtime is supposed
>                "automatically" inject my callback instance in the
>                messageInterpreterCallback member variable of
>                MessageInterpreterImpl. The MessageInterpreterImpl needs
>         to have
>                a reference to some callback instance.
>                I can;t seem to solve this problem.
> 
>                This is the error....
>                ---------------------------------------
>                SEVERE: Exception invoking injector - null
>                org.oasisopen.sca.ServiceRuntimeException: Exception invoking
>                injector - null
>                at
>              
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>                at
>              
>          org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                at
>              
>          org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                at
>              
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                at
>              
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                at
>              
>          com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                at
>              
>          com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                at
>              
>          com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                at
>              
>          com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                at
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                at
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                at
>              
>          sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                at
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                at
>         sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                at
>              
>          java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                at
>              
>          java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                at java.lang.Thread.run(Thread.java:662)
>                Caused by:
>                org.apache.tuscany.sca.core.factory.ObjectCreationException:
>                Exception invoking injector - null
>                at
>              
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>                at
>              
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>                ... 27 more
>                Caused by: java.lang.NullPointerException
>                at
>              
>          org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>                at
>              
>          org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>                at
>              
>          org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>                at
>              
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>                ... 28 more
>                10-jan-2011 1:39:26
>              
>          com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>                processRequest
>                SEVERE: The server sent HTTP status code 500: Internal
>         Server Error
>                com.sun.xml.internal.ws.client.ClientTransportException: The
>                server sent HTTP status code 500: Internal Server Error
>                at
>              
>          com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>                at
>              
>          com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                at com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>                at
>              
>          com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>                at
>              
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>                at
>              
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>                at
>              
>          org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>                at $Proxy50.interpret(Unknown Source)
>                at
>              
>          org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>         Method)
>                at
>              
>          sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>                at
>              
>          sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>                at java.lang.reflect.Method.invoke(Method.java:597)
>                at
>              
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>                at
>              
>          org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                at
>              
>          org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                at
>              
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                at
>              
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                at
>              
>          com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                at
>              
>          com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                at
>              
>          com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                at
>              
>          com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                at
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                at
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                at
>              
>          sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                at
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                at
>         sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                at
>              
>          java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                at
>              
>          java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                at java.lang.Thread.run(Thread.java:662)
>                -----------------------------------------
>                 Hope you can help me. (?)
> 
>                Kind Regards
>                Urso
> 
> 
> 
> 
>                2011/1/14 Simon Nash <nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>
>                <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>>
> 
> 
>                   Hi Urso,
>                   I'm starting to look at your project code now.
> 
>                   It's important to keep these threads on the Tuscany
>         mailing list
>                   so that other members of the Tuscany community are
>         included in
>                   the discussion.  The Tuscany mailing list archives are an
>                important
>                   resource for Tuscany users who are experiencing a
>         problem and are
>                   looking to see if others have found a solution.  If a
>         problem is
>                   solved by a private message exchange instead of on the
>         public
>                list,
>                   the knowledge of how to solve it is confined to one person
>                instead
>                   of being shared by the community.
> 
>                   The best way to make this happen would be for you to
>         resend your
>                   recent private emails to the public list.  I'll look
>         out for them
>                   on the public list so that I can respond to them there.
> 
>                    Simon
> 
>                   Urso Wieske wrote:
> 
>                       Hi Simon,
> 
>                       You'll find in this email the zipped file
>         containing my
>                sourcecode.
> 
>                       Unfortunately, I still have errors.
>                       I changed the member variable from protected to
>         private
>                like you
>                       suggested.
>                       And created Getter and Setter for this member
>         variable.
>                       (messageInterpreterCallback).
>                       I annotated the setter with @Callback.
>                       I also removed the URI attribute from the
>                callback/binding.ws <http://binding.ws> <http://binding.ws>
>                       <http://binding.ws> <http://binding.ws> element of the
>                service
> 
>                       according to your suggestion. Still problems.... :-(
> 
> 
>                       I have zipped my source. It's an Eclipse project.
> 
>                       I appreciate the fact that you are willing to
>         verify this
>                issue.
>                       If you have any questions about the code, just let
>         me know.
> 
>                       Please checkout also if my POM is well specified with
>                regard to
>                       dependencies. Do I have the proper dependencies. I
>         am using
>                       Tuscany 2.0 Beta1.
> 
>                       Kind Regards
>                       Urso
> 
> 
>                       2011/1/10 Simon Nash <nash@apache.org
>         <ma...@apache.org>
>                <mailto:nash@apache.org <ma...@apache.org>>
>         <mailto:nash@apache.org <ma...@apache.org>
>                <mailto:nash@apache.org <ma...@apache.org>>>
>                       <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>
>                <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>>>
> 
> 
>                          Urso Wieske wrote:
> 
>                              Hi Simon,
> 
>                              I adapted my code as you suggested. It
>         seems like the
>                       error has
>                              dissappeared, but I got new ones. Well I
>         removed the
>                       setter and
>                              getter of messageInterpreterCallback from
>                              MessageInterpreterImpl. Now my
>                MessageInterpreterImpl class
>                              contains only the instance variable
>                       messageInterpreterCallback .
>                              I have made it a protected variable.
> 
>                          According to the SCA 1.1 specs, this variable
>         should
>                be private
>                          in order to avoid having it treated as a reference.
>                 Can you try
>                          changing this and see if it makes any difference?
> 
> 
>                              I get a HTTP Internal Server ( error 500).
>                              I am still missing something.SCA runtime is
>         supposed
>                              "automatically" inject my callback instance
>         in the
>                              messageInterpreterCallback member variable of
>                              MessageInterpreterImpl. The
>         MessageInterpreterImpl
>                needs
>                       to have
>                              a reference to some callback instance.
>                              I can;t seem to solve this problem.
> 
>                           >From the stack trace it seems that the thread
>         message
>                       context doesn't
>                          contain the callback endpoint.  I'm not sure what
>                could cause
>                       this.
>                          However I noticed a problem in your composite that
>                would be worth
>                          fixing, and it's just possible that this might be
>                related to the
>                          problem that you're seeing.
> 
>                          The problem is that you have specified a
>         callback URI
>                for the
>                          MessageInterpreter service in
>                MessageInterpreterComponent, as
>                       follows:
> 
>                           <service name="MessageInterpreter">
>                             <interface.java
>                interface="org.acme.logix.MessageInterpreter"
>                                              
>         callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>                             <binding.ws <http://binding.ws>
>         <http://binding.ws> <http://binding.ws>
>                <http://binding.ws>
> 
> 
>                                      
>          uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                             <callback>
>                               <binding.ws <http://binding.ws>
>         <http://binding.ws>
>                <http://binding.ws> <http://binding.ws>
>                                
>         uri="http://localhost:8084/Client/MessageInterpreterCallback"/>
>                             </callback>
>                           </service>
> 
>                          There shouldn't be any callback URI in the service
>                       definition, because
>                          this information is provided at runtime by the
>         client
>                       invocation.  So
>                          you should change the above to:
> 
>                           <service name="MessageInterpreter">
>                             <interface.java
>                interface="org.acme.logix.MessageInterpreter"
>                                              
>         callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>                             <binding.ws <http://binding.ws>
>         <http://binding.ws> <http://binding.ws>
>                <http://binding.ws>
> 
> 
>                                      
>          uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                             <callback>
>                               <binding.ws/ <http://binding.ws/>
>         <http://binding.ws/>
>                <http://binding.ws/> <http://binding.ws/>>
> 
> 
>                             </callback>
>                           </service>
> 
>                          If neither of these suggested changes fixes the
>                problem, please
>                          post the complete application as a zip file.
> 
>                           Simon
> 
>                              This is the error....
>                              ---------------------------------------
>                              SEVERE: Exception invoking injector - null
>                              org.oasisopen.sca.ServiceRuntimeException:
>                Exception invoking
>                              injector - null
>                              at
>                                          
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>                              at
>                                          
>          org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                              at
>                                          
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                              at
>                                          
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                              at
>                                          
>          org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                              at
>                                          
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                              at
>                                          
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                              at
>                                          
>          com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                              at
>                                          
>          com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                              at
>                                          
>          com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                              at
>                            
>          com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                              at
>                      
>         com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                              at
>                      
>         com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                              at
>                            
>          com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                              at
>                                          
>          com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                              at
>                                          
>          com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                              at
>                                          
>          com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                              at
>                                          
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                              at
>                                          
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                              at
>                      
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                              at
>                sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                              at
>                      
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                              at
>                                          
>          sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                              at
>                      
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                              at
>                            
>          sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                              at
>                                          
>          java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                              at
>                                          
>          java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                              at java.lang.Thread.run(Thread.java:662)
>                              Caused by:
>                                    
>         org.apache.tuscany.sca.core.factory.ObjectCreationException:
>                              Exception invoking injector - null
>                              at
>                                          
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>                              at
>                                          
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>                              ... 27 more
>                              Caused by: java.lang.NullPointerException
>                              at
>                                          
>          org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>                              at
>                                          
>          org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>                              at
>                                          
>          org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>                              at
>                                          
>          org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>                              at
>                                          
>          org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>                              at
>                                          
>          org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>                              at
>                                          
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>                              ... 28 more
>                              10-jan-2011 1:39:26
>                                          
>          com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>                              processRequest
>                              SEVERE: The server sent HTTP status code
>         500: Internal
>                       Server Error
>                                    
>         com.sun.xml.internal.ws.client.ClientTransportException: The
>                              server sent HTTP status code 500: Internal
>         Server
>                Error
>                              at
>                                          
>          com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>                              at
>                                          
>          com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>                              at
>                                          
>          com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>                              at
>                                          
>          com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>                              at
>                            
>          com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                              at
>                      
>         com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                              at
>                      
>         com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                              at
>                            
>          com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                              at
>                com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>                              at
>                                          
>          com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>                              at
>                                          
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>                              at
>                                          
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>                              at
>                                          
>          org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                              at
>                                          
>          org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>                              at
>                                          
>          org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>                              at
>                                          
>          org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>                              at
>                                          
>          org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>                              at
>                                          
>          org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>                              at $Proxy50.interpret(Unknown Source)
>                              at
>                                          
>          org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>                              at
>         sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>                       Method)
>                              at
>                                          
>          sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>                              at
>                                          
>          sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>                              at
>         java.lang.reflect.Method.invoke(Method.java:597)
>                              at
>                                          
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>                              at
>                                          
>          org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                              at
>                                          
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                              at
>                                          
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                              at
>                                          
>          org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                              at
>                                          
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                              at
>                                          
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                              at
>                                          
>          com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                              at
>                                          
>          com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                              at
>                                          
>          com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                              at
>                            
>          com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                              at
>                      
>         com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                              at
>                      
>         com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                              at
>                            
>          com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                              at
>                                          
>          com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                              at
>                                          
>          com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                              at
>                                          
>          com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                              at
>                                          
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                              at
>                                          
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                              at
>                      
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                              at
>                sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                              at
>                      
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                              at
>                                          
>          sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                              at
>                      
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                              at
>                            
>          sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                              at
>                                          
>          java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                              at
>                                          
>          java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                              at java.lang.Thread.run(Thread.java:662)
>                              -----------------------------------------
>                               Hope you can help me. (?)
> 
>                              Kind Regards
>                              Urso
> 
>                              2011/1/9 Simon Nash <nash@apache.org
>         <ma...@apache.org>
>                <mailto:nash@apache.org <ma...@apache.org>>
>                       <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>
>                <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>
>                       <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>>
>                              <mailto:nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>
>                <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>
>                       <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>
>                <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>>>>
> 
> 
> 
>                                 Urso Wieske wrote:
> 
>                                     Hi
>                                     I am evaluating Tuscany 2.0 Beta1 and am
>                trying to
>                       learn more
>                                     about Callbacks (Bi-Directional
>         interface)
>                of SCA
>                       1.1. I
>                                     downloaded the Tuscany Sample files and
>                started to
>                              explore the
>                                     callback implementations with webservice
>                binding,
>                       i.e. the
>                                     Search and SearchCallback interfaces.
>                                     It took me a while before I realized
>         that the
>                       Tuscany SCA
>                                     Samples were based on SCA v1.0.  
>         Tuscany
>                2.0 Beta1 is
>                              based on
>                                     the SCA v1.1 specs.
>                                     After studying the sample sources, I
>         have
>                written
>                       my own
>                              callback.
> 
>                                     Unfortunately, I kept on getting a
>         runtime
>                       exception after I
>                                     installed and deployed my
>         contribution. By the
>                       way, I am
>                              using
>                                     Eclipse and the maven tuscany plugin.
> 
>                                     I can't find the problem and hope if
>                someone can
>                       point me
>                              in the
>                                     right direction.
> 
>                                     This is the error (printed on my
>         console) I am
>                       getting when I
>                                     try to run my program:
>                                     [ERROR] Failed to execute goal
>                                                        
>          org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>                                     (default-cli) on project handler-agent:
>                Execution
>                              default-cli of
>                                     goal
>                                                        
>          org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>                                     failed:
>                org.oasisopen.sca.ServiceRuntimeException:
>                              [Composite:
>                                          
>          {http://docs.oasis-open.org/ns/opencsa/sca/200912},
>                              Component:
>                                     MessageInterpreterComponent] -
>         [ASM60033] No
>                       targets for
>                                     reference: Composite =
>                                          
>          {http://docs.oasis-open.org/ns/opencsa/sca/200912}
>                              Reference =
>                                     messageInterpreterCallback -> [Help 1]
> 
>                                     I suspect that I am doing something
>         wrong
>                in the
>                              composite file.
>                                     I can't imagine I did something wrong in
>                the java
>                              sources. (See
>                                     below for the sources.)
> 
>                                 Because the MessageInterpreterImpl class
>         doesn't
>                       contain any
>                                 @Reference or
>                                 @Property annotations, SCA creates implicit
>                references for
>                              all public
>                                 setter methods in this class whose type is a
>                remotable SCA
>                                 interface, and
>                                 also for all public or protected fields
>         in this
>                class
>                       whose
>                              type is a
>                                 remotable SCA interface.
> 
>                                 There is a public setter method
>                              setMessageInterpreterCallback() and a
>                                 protected field
>         messageInterpreterCallback, so SCA
>                       defines a
>                              reference
>                                 named messageInterpreterCallback.  This
>                reference doesn't
>                              have a target
>                                 configured in the composite, hence the error
>                message.
> 
>                                 To fix the problem, you need to remove
>         the setter
>                       method (or
>                              make it
>                                 protected) and change the field from
>         protected
>                to private.
> 
>                                  Simon
> 
> 
>                                     Kind Regards,
> 
>                                     Urso
> 
> 
>                                     -------------------- THE SERVICE
>         Interface With
>                       Callback
>                                     Interface association ----------
>                                     /**
>                                      *  */
>                                     package org.acme.logix;
> 
>                                     import org.acme.logix.message.Message;
>                                     import
>         org.oasisopen.sca.annotation.Callback;
>                                     import
>         org.oasisopen.sca.annotation.OneWay;
>                                     import
>         org.oasisopen.sca.annotation.Remotable;
> 
>                                     /**
>                                      *  *
>                                      */
>                                     @Remotable
>                                    
>         @Callback(MessageInterpreterCallback.class)
>                                     public interface MessageInterpreter {
> 
>                                     @OneWay
>                                     void interpret(Message msg);
>                                     }
> 
> 
>                                     /**
>                                      *  */
>                                     package org.acme.logix;
> 
>                                     import
>         org.oasisopen.sca.annotation.OneWay;
>                                     import
>         org.oasisopen.sca.annotation.Remotable;
> 
>                                     /**
>                                      *  *
>                                      */
>                                     @Remotable
>                                     public interface
>         MessageInterpreterCallback {
>                                     void onInterpret(Interpretation ipr);
>                                     }
> 
> 
>                                     ---------- THE CLIENT implementing
>         the callback
>                       interface
>                                     ------------
> 
>                                     /**
>                                      *  */
>                                     package org.acme.logix;
> 
>                                     import org.acme.logix.message.Message;
>                                     import
>         org.oasisopen.sca.annotation.Reference;
> 
>                                     /**
>                                      *  */
>                                     public class LogisticCenterImpl
>         implements
>                       LogisticCenter,
>                                     MessageInterpreterCallback {
>                                     private AuditService auditService;
>                                     @Reference
>                                     protected MessageInterpreter
>                messageInterpreter;
> 
>                                     /* (non-Javadoc)
>                                     * @see
>                                                        
>          org.acme.logix.LogisticCenter#processMessage(org.acme.logix.message.Message)
>                                     */
>                                     public void processMessage(Message
>         message) {
>                                     System.out.println("Processing
>         message with
>                       payload " +
>                                     message.getPayload() );
>                                     auditService.logSentMessage(message);
>                                     messageInterpreter.interpret(message);
>                                     }
> 
>                                     /**
>                                     * @return the auditService
>                                     */
>                                     public AuditService getAuditService() {
>                                     return auditService;
>                                     }
> 
>                                     /**
>                                     * @param auditService the
>         auditService to set
>                                     */
>                                     @Reference
>                                     public void setAuditService(AuditService
>                       auditService) {
>                                     this.auditService = auditService;
>                                     }
> 
>                                     /**
>                                     * @param messageInterpreter the
>                messageInterpreter
>                       to set
>                                     */
>                                     public void
>                setMessageInterpreter(MessageInterpreter
>                                     messageInterpreter) {
>                                     this.messageInterpreter =
>         messageInterpreter;
>                                     }
> 
>                                     /**
>                                     * @return the messageInterpreter
>                                     */
>                                     public MessageInterpreter
>                getMessageInterpreter() {
>                                     return messageInterpreter;
>                                     }
> 
> 
>                                            /**
>                                            *  THE CALLBACK method of
>                       MessageInterpreterCallback
>                                     interface
>                                            */
>                                     public void
>         onInterpret(Interpretation ipr) {
>                                     System.out.println("Message has been
>                interpreted.");
>                                     }
> 
>                                     }
> 
> 
>                                     ---------THE SERVICE WHICH IS CALLED
>         BY THE
>                CLIENT
>                       THROUGH
>                                     WEBSERVICE BINDING ---------
> 
>                                     /**
>                                      *  */
>                                     package org.acme.logix;
> 
>                                     import org.acme.logix.message.Message;
>                                     import org.oasisopen.sca.RequestContext;
>                                     import
>         org.oasisopen.sca.ServiceReference;
>                                     import
>         org.oasisopen.sca.annotation.Callback;
>                                     import
>         org.oasisopen.sca.annotation.Context;
>                                     import
>         org.oasisopen.sca.annotation.Reference;
>                                     import
>         org.oasisopen.sca.annotation.Service;
> 
>                                     /**
>                                      *  *
>                                      */
>                                     public class MessageInterpreterImpl
>         implements
>                              MessageInterpreter{
> 
>                                     @Callback
>                                     protected MessageInterpreterCallback
>                              messageInterpreterCallback;
>                                     /* (non-Javadoc)
>                                     * @see
>                                                        
>          org.acme.logix.MessageInterpreter#interpret(org.acme.logix.message.Message)
>                                     */
>                                     public void interpret(Message msg) {
>                                     System.out.println("The message is being
>                       interpreted..");
>                                     Interpretation ipr = new
>         Interpretation();
>                                    
>         messageInterpreterCallback.onInterpret(ipr);
>                                     }
> 
> 
> 
>                                     /**
>                                     * @return the messageInterpreterCallback
>                                     */
>                                     public MessageInterpreterCallback
>                              getMessageInterpreterCallback() {
>                                     return messageInterpreterCallback;
>                                     }
> 
> 
> 
>                                     /**
>                                     * @param messageInterpreterCallback the
>                                     messageInterpreterCallback to set
>                                     */
>                                     public void
>         setMessageInterpreterCallback(
>                                     MessageInterpreterCallback
>                       messageInterpreterCallback) {
>                                     this.messageInterpreterCallback =
>                       messageInterpreterCallback;
>                                     }
>                                     }
> 
> 
> 
> 
> 
>                                     ---- THE COMPOSITE -----------
> 
> 
> 
>                                     <composite
>                                    
>         xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
>                                              
>         targetNamespace="http://logistix"
>                                              
>         xmlns:logistix="http://logistix"
>                                               name="AfnemerLogisticCenter">
> 
>                                        <component
>                name="AfnemerHandlingAgentComponent">
>                                     <implementation.java
>                              class="org.acme.logix.HandlingAgentImpl"/>
>                                              <reference
>         name="logisticCenter" >
>                                             <binding.ws
>         <http://binding.ws> <http://binding.ws>
>                <http://binding.ws>
>                       <http://binding.ws>
>                              <http://binding.ws> <http://binding.ws>
> 
>                                                        
>          uri="http://127.0.0.1:8087/AfnemerHandlingAgentComponent"/>    
>                                          </reference>         <reference
>                       name="auditService"
>                                     target="AuditServiceComponent"/>    
>                                   </component>
> 
> 
> 
>                                        <component
>                name="AfnemerLogisticCenterComponent">
>                                            <implementation.java
>                                    
>         class="org.acme.logix.LogisticCenterImpl"/>
>                                            <reference
>         name="messageInterpreter">
>                                     <interface.java
>                            
>          interface="org.acme.logix.MessageInterpreter"                  
>                                                                    
>         callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
> 
>                                     <binding.ws <http://binding.ws>
>         <http://binding.ws>
>                <http://binding.ws>
>                       <http://binding.ws> <http://binding.ws>
>                              <http://binding.ws>
> 
>                                                        
>          uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                                     <callback >
>                                     <binding.ws <http://binding.ws>
>         <http://binding.ws>
>                <http://binding.ws>
>                       <http://binding.ws> <http://binding.ws>
>                              <http://binding.ws>
> 
>                                                  
>         uri="http://localhost:8084/Client/MessageInterpreterCallback
>                                                  
>         <http://localhost:8081/Client/MessageInterpreterCallback>" />
> 
>                                     </callback>
>                                     </reference>
>                                            <reference
>         name="auditService">                                            
>              <binding.jms
>                                                        
>          initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>                                     jndiURL="tcp://localhost:61616">
>                                       <destination
>         jndiName="AuditServiceQueue" />
>                                       </binding.jms>         </reference>
>                                             </component>
>                                            <component
>                name="MessageInterpreterComponent">
>                                         <implementation.java
>                                    
>         class="org.acme.logix.MessageInterpreterImpl"/>
>                                             <service
>         name="MessageInterpreter">
>                                     <interface.java
>                       interface="org.acme.logix.MessageInterpreter"
>                                                                        
>              callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>                                     <binding.ws <http://binding.ws>
>         <http://binding.ws>
>                <http://binding.ws>
>                       <http://binding.ws> <http://binding.ws>
>                              <http://binding.ws>
> 
>                                                          
>         uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                                     <callback>
>                                     <binding.ws <http://binding.ws>
>         <http://binding.ws>
>                <http://binding.ws>
>                       <http://binding.ws> <http://binding.ws>
>                              <http://binding.ws>
> 
>                                                  
>         uri="http://localhost:8084/Client/MessageInterpreterCallback
>                                                  
>         <http://localhost:8081/Client/MessageInterpreterCallback>"/>
> 
>                                     </callback>
>                                     </service>
>                                        </component>
> 
> 
>                                        <component
>         name="AuditServiceComponent">
>                                            <implementation.java
>                                    
>         class="org.acme.logix.AuditServiceImpl"/>
>                                                    <service
>         name="AuditService">
>                                                <binding.jms
>                                                        
>          initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>                                     jndiURL="tcp://localhost:61616">
>                                       <destination
>         jndiName="AuditServiceQueue" />
>                                     </binding.jms>         </service>
>                                        </component>
>                                        </composite>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 


Re: Callback and Tuscany 2.0 Samples

Posted by Urso Wieske <uw...@gmail.com>.
Hi Simon,

Could you send me a copy of your POM which you have used /adapted?
Also which public repositories are you using to download your Tuscany 2.0
Beta1 dependencies?
(I have initially googled for a oublic maven repository where I could
donwload the Tuscany v2 Beta1 dependencies.)

I replaced my base runtime for the 4 dependencies you have stated, but I get
runtime exceptions due to other causes. Most probably I should have other
dependencies too which you have not mentioned.

Kind regards.
Urso

2011/1/15 Simon Nash <na...@apache.org>

> Urso Wieske wrote:
>
>> Hi Simon,
>>
>> Thanks for the quick response.
>> That's a pitty that maven-tuscany-plugin is not behaving accordingly. It's
>> a great instrument to use within my IDE (Eclipse). I'll submit an issue at
>> the Tuscany projectsite. I will also dig into the "maven-tuscany-plugin"
>> problem to figure out what is the cause of this deviation.
>>
>>  Hi Urso,
> I agree.  It should be possible to use maven-tuscany-plugin and
> replace things in the base runtime by alternative implementations.
> Maybe there is a way to do this, but I couldn't find one.
>
>  Simon
>
>  Kind Regards
>> Urso
>>
>>
>> 2011/1/15 Simon Nash <nash@apache.org <ma...@apache.org>>
>>
>>    Urso Wieske wrote:
>>
>>        Hi Simon,
>>
>>        I have uploaded my sources as a zipped file.
>>
>>    Hi Urso,
>>    This problem is caused by a bug in Tuscany.  Please raise a JIRA
>>    so that we can track and fix the problem.  In the meantime, I can
>>    suggest a partial workaround.
>>
>>    The injection failure only happens if Tuscany is using the
>>    tuscany-binding-ws-runtime-jaxws module as the runtime implementation
>>    for <binding.ws <http://binding.ws>>.  It doesn't happen if
>>    tuscany-binding-ws-runtime-axis2
>>    is used instead of tuscany-binding-ws-runtime-jaxws.  This implies that
>>    the problem is caused by a bug in the -jaxws version.
>>
>>    By default, Tuscany uses the -jaxws version.  To get Tuscany to use
>>    the -axis2 version instead, you need to do special configuration in
>>    the pom.xml file.
>>
>>    Unfortunately I couldn't find a way to make this change when using
>>    maven-tuscany-plugin to run the application.  This is because
>>    maven-tuscany-plugin has a dependency on tuscany-base-runtime.
>>    The tuscany-base-runtime jar contains the -jaxws version and seems
>>    to always use it even if the -axis2 version is declared as an
>>    additional dependency.
>>
>>    I did find a way to get Tuscany to use the -axis2 version when not
>>    using maven-tuscany-plugin.  If you replace this dependency:
>>     <dependency>
>>         <groupId>org.apache.tuscany.sca</groupId>
>>         <artifactId>tuscany-base-runtime</artifactId>
>>         <version>2.0-Beta1</version>
>>     </dependency>
>>
>>    by the following four dependencies:
>>     <dependency>
>>         <groupId>org.apache.tuscany.sca</groupId>
>>         <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>>         <version>2.0-Beta1</version>
>>     </dependency>
>>
>>     <dependency>
>>         <groupId>org.apache.tuscany.sca</groupId>
>>         <artifactId>tuscany-host-jetty</artifactId>
>>         <version>2.0-Beta1</version>
>>     </dependency>
>>
>>     <dependency>
>>         <groupId>org.apache.tuscany.sca</groupId>
>>         <artifactId>tuscany-node-impl</artifactId>
>>         <version>2.0-Beta1</version>
>>     </dependency>
>>
>>     <dependency>
>>         <groupId>org.apache.tuscany.sca</groupId>
>>         <artifactId>tuscany-implementation-java-runtime</artifactId>
>>         <version>2.0-Beta1</version>
>>     </dependency>
>>
>>    then the application runs successfully.  I used a maven JUnit test
>>    to verify this.
>>
>>     Simon
>>
>>        Hi Simon,
>>
>>        I adapted my code as you suggested. It seems like the error has
>>        dissappeared, but I got new ones. Well I removed the setter and
>>        getter of messageInterpreterCallback from
>>        MessageInterpreterImpl. Now my MessageInterpreterImpl class
>>        contains only the instance variable messageInterpreterCallback .
>>        I have made it a protected variable.
>>
>>        I get a HTTP Internal Server ( error 500).
>>        I am still missing something.SCA runtime is supposed
>>        "automatically" inject my callback instance in the
>>        messageInterpreterCallback member variable of
>>        MessageInterpreterImpl. The MessageInterpreterImpl needs to have
>>        a reference to some callback instance.
>>        I can;t seem to solve this problem.
>>
>>        This is the error....
>>        ---------------------------------------
>>        SEVERE: Exception invoking injector - null
>>        org.oasisopen.sca.ServiceRuntimeException: Exception invoking
>>        injector - null
>>        at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>>        at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>        at
>>
>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>        at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>        at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>        at
>>
>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>        at
>>
>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>        at
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>        at
>>
>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>        at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>        at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>        at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>        at
>>
>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>        at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>        at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>        at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>        at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>        at java.lang.Thread.run(Thread.java:662)
>>        Caused by:
>>        org.apache.tuscany.sca.core.factory.ObjectCreationException:
>>        Exception invoking injector - null
>>        at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>>        at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>>        ... 27 more
>>        Caused by: java.lang.NullPointerException
>>        at
>>
>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>>        at
>>
>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>>        at
>>
>>  org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>>        at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>>        ... 28 more
>>        10-jan-2011 1:39:26
>>        com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>>        processRequest
>>        SEVERE: The server sent HTTP status code 500: Internal Server Error
>>        com.sun.xml.internal.ws.client.ClientTransportException: The
>>        server sent HTTP status code 500: Internal Server Error
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>        at com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>>        at
>>
>>  com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>>        at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>>        at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>>        at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>>        at $Proxy50.interpret(Unknown Source)
>>        at
>>
>>  org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at
>>
>>  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>        at
>>
>>  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>        at java.lang.reflect.Method.invoke(Method.java:597)
>>        at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>>        at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>        at
>>
>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>        at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>        at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>        at
>>
>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>        at
>>
>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>        at
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>        at
>>
>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>        at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>        at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>        at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>        at
>>
>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>        at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>        at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>        at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>        at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>        at java.lang.Thread.run(Thread.java:662)
>>        -----------------------------------------
>>         Hope you can help me. (?)
>>
>>        Kind Regards
>>        Urso
>>
>>
>>
>>
>>        2011/1/14 Simon Nash <nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>
>>
>>
>>           Hi Urso,
>>           I'm starting to look at your project code now.
>>
>>           It's important to keep these threads on the Tuscany mailing list
>>           so that other members of the Tuscany community are included in
>>           the discussion.  The Tuscany mailing list archives are an
>>        important
>>           resource for Tuscany users who are experiencing a problem and
>> are
>>           looking to see if others have found a solution.  If a problem is
>>           solved by a private message exchange instead of on the public
>>        list,
>>           the knowledge of how to solve it is confined to one person
>>        instead
>>           of being shared by the community.
>>
>>           The best way to make this happen would be for you to resend your
>>           recent private emails to the public list.  I'll look out for
>> them
>>           on the public list so that I can respond to them there.
>>
>>            Simon
>>
>>           Urso Wieske wrote:
>>
>>               Hi Simon,
>>
>>               You'll find in this email the zipped file containing my
>>        sourcecode.
>>
>>               Unfortunately, I still have errors.
>>               I changed the member variable from protected to private
>>        like you
>>               suggested.
>>               And created Getter and Setter for this member variable.
>>               (messageInterpreterCallback).
>>               I annotated the setter with @Callback.
>>               I also removed the URI attribute from the
>>        callback/binding.ws <http://binding.ws>
>>               <http://binding.ws> <http://binding.ws> element of the
>>        service
>>
>>               according to your suggestion. Still problems.... :-(
>>
>>
>>               I have zipped my source. It's an Eclipse project.
>>
>>               I appreciate the fact that you are willing to verify this
>>        issue.
>>               If you have any questions about the code, just let me know.
>>
>>               Please checkout also if my POM is well specified with
>>        regard to
>>               dependencies. Do I have the proper dependencies. I am using
>>               Tuscany 2.0 Beta1.
>>
>>               Kind Regards
>>               Urso
>>
>>
>>               2011/1/10 Simon Nash <nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>
>>               <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>>
>>
>>
>>                  Urso Wieske wrote:
>>
>>                      Hi Simon,
>>
>>                      I adapted my code as you suggested. It seems like the
>>               error has
>>                      dissappeared, but I got new ones. Well I removed the
>>               setter and
>>                      getter of messageInterpreterCallback from
>>                      MessageInterpreterImpl. Now my
>>        MessageInterpreterImpl class
>>                      contains only the instance variable
>>               messageInterpreterCallback .
>>                      I have made it a protected variable.
>>
>>                  According to the SCA 1.1 specs, this variable should
>>        be private
>>                  in order to avoid having it treated as a reference.
>>         Can you try
>>                  changing this and see if it makes any difference?
>>
>>
>>                      I get a HTTP Internal Server ( error 500).
>>                      I am still missing something.SCA runtime is supposed
>>                      "automatically" inject my callback instance in the
>>                      messageInterpreterCallback member variable of
>>                      MessageInterpreterImpl. The MessageInterpreterImpl
>>        needs
>>               to have
>>                      a reference to some callback instance.
>>                      I can;t seem to solve this problem.
>>
>>                   >From the stack trace it seems that the thread message
>>               context doesn't
>>                  contain the callback endpoint.  I'm not sure what
>>        could cause
>>               this.
>>                  However I noticed a problem in your composite that
>>        would be worth
>>                  fixing, and it's just possible that this might be
>>        related to the
>>                  problem that you're seeing.
>>
>>                  The problem is that you have specified a callback URI
>>        for the
>>                  MessageInterpreter service in
>>        MessageInterpreterComponent, as
>>               follows:
>>
>>                   <service name="MessageInterpreter">
>>                     <interface.java
>>        interface="org.acme.logix.MessageInterpreter"
>>
>> callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>                     <binding.ws <http://binding.ws> <http://binding.ws>
>>        <http://binding.ws>
>>
>>
>>                                uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>                     <callback>
>>                       <binding.ws <http://binding.ws>
>>        <http://binding.ws> <http://binding.ws>
>>                         uri="
>> http://localhost:8084/Client/MessageInterpreterCallback"/>
>>                     </callback>
>>                   </service>
>>
>>                  There shouldn't be any callback URI in the service
>>               definition, because
>>                  this information is provided at runtime by the client
>>               invocation.  So
>>                  you should change the above to:
>>
>>                   <service name="MessageInterpreter">
>>                     <interface.java
>>        interface="org.acme.logix.MessageInterpreter"
>>
>> callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>                     <binding.ws <http://binding.ws> <http://binding.ws>
>>        <http://binding.ws>
>>
>>
>>                                uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>                     <callback>
>>                       <binding.ws/ <http://binding.ws/>
>>        <http://binding.ws/> <http://binding.ws/>>
>>
>>
>>                     </callback>
>>                   </service>
>>
>>                  If neither of these suggested changes fixes the
>>        problem, please
>>                  post the complete application as a zip file.
>>
>>                   Simon
>>
>>                      This is the error....
>>                      ---------------------------------------
>>                      SEVERE: Exception invoking injector - null
>>                      org.oasisopen.sca.ServiceRuntimeException:
>>        Exception invoking
>>                      injector - null
>>                      at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>>                      at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>                      at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>                      at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>                      at
>>
>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>                      at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>                      at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>                      at
>>
>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>                      at
>>
>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>                      at
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>                      at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>                      at
>>
>> com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>                      at
>>               com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>                      at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>                      at
>>
>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>                      at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>                      at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>                      at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>                      at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>                      at
>>               com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                      at
>>        sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>                      at
>>               com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>                      at
>>
>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>                      at
>>               com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                      at
>>
>>  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>                      at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>                      at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>                      at java.lang.Thread.run(Thread.java:662)
>>                      Caused by:
>>
>> org.apache.tuscany.sca.core.factory.ObjectCreationException:
>>                      Exception invoking injector - null
>>                      at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>>                      at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>>                      ... 27 more
>>                      Caused by: java.lang.NullPointerException
>>                      at
>>
>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>>                      at
>>
>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>>                      at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>>                      at
>>
>>  org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>>                      at
>>
>>  org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>>                      at
>>
>>  org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>>                      at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>>                      ... 28 more
>>                      10-jan-2011 1:39:26
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>>                      processRequest
>>                      SEVERE: The server sent HTTP status code 500:
>> Internal
>>               Server Error
>>
>> com.sun.xml.internal.ws.client.ClientTransportException: The
>>                      server sent HTTP status code 500: Internal Server
>>        Error
>>                      at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>>                      at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>>                      at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>>                      at
>>
>>  com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>>                      at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>                      at
>>
>> com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>                      at
>>               com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>                      at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>                      at
>>        com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>>                      at
>>
>>  com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>>                      at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>>                      at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>>                      at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>                      at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>>                      at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>>                      at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>>                      at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>>                      at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>>                      at $Proxy50.interpret(Unknown Source)
>>                      at
>>
>>  org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>>                      at
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>               Method)
>>                      at
>>
>>  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>                      at
>>
>>  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>                      at java.lang.reflect.Method.invoke(Method.java:597)
>>                      at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>>                      at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>                      at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>                      at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>                      at
>>
>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>                      at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>                      at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>                      at
>>
>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>                      at
>>
>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>                      at
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>                      at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>                      at
>>
>> com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>                      at
>>               com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>                      at
>>
>>  com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>                      at
>>
>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>                      at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>                      at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>                      at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>                      at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>                      at
>>               com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                      at
>>        sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>                      at
>>               com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>                      at
>>
>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>                      at
>>               com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>                      at
>>
>>  sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>                      at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>                      at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>                      at java.lang.Thread.run(Thread.java:662)
>>                      -----------------------------------------
>>                       Hope you can help me. (?)
>>
>>                      Kind Regards
>>                      Urso
>>
>>                      2011/1/9 Simon Nash <nash@apache.org
>>        <ma...@apache.org>
>>               <mailto:nash@apache.org <ma...@apache.org>>
>>        <mailto:nash@apache.org <ma...@apache.org>
>>               <mailto:nash@apache.org <ma...@apache.org>>>
>>                      <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>
>>               <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>>>
>>
>>
>>
>>                         Urso Wieske wrote:
>>
>>                             Hi
>>                             I am evaluating Tuscany 2.0 Beta1 and am
>>        trying to
>>               learn more
>>                             about Callbacks (Bi-Directional interface)
>>        of SCA
>>               1.1. I
>>                             downloaded the Tuscany Sample files and
>>        started to
>>                      explore the
>>                             callback implementations with webservice
>>        binding,
>>               i.e. the
>>                             Search and SearchCallback interfaces.
>>                             It took me a while before I realized that the
>>               Tuscany SCA
>>                             Samples were based on SCA v1.0.   Tuscany
>>        2.0 Beta1 is
>>                      based on
>>                             the SCA v1.1 specs.
>>                             After studying the sample sources, I have
>>        written
>>               my own
>>                      callback.
>>
>>                             Unfortunately, I kept on getting a runtime
>>               exception after I
>>                             installed and deployed my contribution. By the
>>               way, I am
>>                      using
>>                             Eclipse and the maven tuscany plugin.
>>
>>                             I can't find the problem and hope if
>>        someone can
>>               point me
>>                      in the
>>                             right direction.
>>
>>                             This is the error (printed on my console) I am
>>               getting when I
>>                             try to run my program:
>>                             [ERROR] Failed to execute goal
>>
>>  org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>>                             (default-cli) on project handler-agent:
>>        Execution
>>                      default-cli of
>>                             goal
>>
>>  org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>>                             failed:
>>        org.oasisopen.sca.ServiceRuntimeException:
>>                      [Composite:
>>                                    {
>> http://docs.oasis-open.org/ns/opencsa/sca/200912},
>>                      Component:
>>                             MessageInterpreterComponent] - [ASM60033] No
>>               targets for
>>                             reference: Composite =
>>                                    {
>> http://docs.oasis-open.org/ns/opencsa/sca/200912}
>>                      Reference =
>>                             messageInterpreterCallback -> [Help 1]
>>
>>                             I suspect that I am doing something wrong
>>        in the
>>                      composite file.
>>                             I can't imagine I did something wrong in
>>        the java
>>                      sources. (See
>>                             below for the sources.)
>>
>>                         Because the MessageInterpreterImpl class doesn't
>>               contain any
>>                         @Reference or
>>                         @Property annotations, SCA creates implicit
>>        references for
>>                      all public
>>                         setter methods in this class whose type is a
>>        remotable SCA
>>                         interface, and
>>                         also for all public or protected fields in this
>>        class
>>               whose
>>                      type is a
>>                         remotable SCA interface.
>>
>>                         There is a public setter method
>>                      setMessageInterpreterCallback() and a
>>                         protected field messageInterpreterCallback, so SCA
>>               defines a
>>                      reference
>>                         named messageInterpreterCallback.  This
>>        reference doesn't
>>                      have a target
>>                         configured in the composite, hence the error
>>        message.
>>
>>                         To fix the problem, you need to remove the setter
>>               method (or
>>                      make it
>>                         protected) and change the field from protected
>>        to private.
>>
>>                          Simon
>>
>>
>>                             Kind Regards,
>>
>>                             Urso
>>
>>
>>                             -------------------- THE SERVICE Interface
>> With
>>               Callback
>>                             Interface association ----------
>>                             /**
>>                              *  */
>>                             package org.acme.logix;
>>
>>                             import org.acme.logix.message.Message;
>>                             import org.oasisopen.sca.annotation.Callback;
>>                             import org.oasisopen.sca.annotation.OneWay;
>>                             import org.oasisopen.sca.annotation.Remotable;
>>
>>                             /**
>>                              *  *
>>                              */
>>                             @Remotable
>>                             @Callback(MessageInterpreterCallback.class)
>>                             public interface MessageInterpreter {
>>
>>                             @OneWay
>>                             void interpret(Message msg);
>>                             }
>>
>>
>>                             /**
>>                              *  */
>>                             package org.acme.logix;
>>
>>                             import org.oasisopen.sca.annotation.OneWay;
>>                             import org.oasisopen.sca.annotation.Remotable;
>>
>>                             /**
>>                              *  *
>>                              */
>>                             @Remotable
>>                             public interface MessageInterpreterCallback {
>>                             void onInterpret(Interpretation ipr);
>>                             }
>>
>>
>>                             ---------- THE CLIENT implementing the
>> callback
>>               interface
>>                             ------------
>>
>>                             /**
>>                              *  */
>>                             package org.acme.logix;
>>
>>                             import org.acme.logix.message.Message;
>>                             import org.oasisopen.sca.annotation.Reference;
>>
>>                             /**
>>                              *  */
>>                             public class LogisticCenterImpl implements
>>               LogisticCenter,
>>                             MessageInterpreterCallback {
>>                             private AuditService auditService;
>>                             @Reference
>>                             protected MessageInterpreter
>>        messageInterpreter;
>>
>>                             /* (non-Javadoc)
>>                             * @see
>>
>>  org.acme.logix.LogisticCenter#processMessage(org.acme.logix.message.Message)
>>                             */
>>                             public void processMessage(Message message) {
>>                             System.out.println("Processing message with
>>               payload " +
>>                             message.getPayload() );
>>                             auditService.logSentMessage(message);
>>                             messageInterpreter.interpret(message);
>>                             }
>>
>>                             /**
>>                             * @return the auditService
>>                             */
>>                             public AuditService getAuditService() {
>>                             return auditService;
>>                             }
>>
>>                             /**
>>                             * @param auditService the auditService to set
>>                             */
>>                             @Reference
>>                             public void setAuditService(AuditService
>>               auditService) {
>>                             this.auditService = auditService;
>>                             }
>>
>>                             /**
>>                             * @param messageInterpreter the
>>        messageInterpreter
>>               to set
>>                             */
>>                             public void
>>        setMessageInterpreter(MessageInterpreter
>>                             messageInterpreter) {
>>                             this.messageInterpreter = messageInterpreter;
>>                             }
>>
>>                             /**
>>                             * @return the messageInterpreter
>>                             */
>>                             public MessageInterpreter
>>        getMessageInterpreter() {
>>                             return messageInterpreter;
>>                             }
>>
>>
>>                                    /**
>>                                    *  THE CALLBACK method of
>>               MessageInterpreterCallback
>>                             interface
>>                                    */
>>                             public void onInterpret(Interpretation ipr) {
>>                             System.out.println("Message has been
>>        interpreted.");
>>                             }
>>
>>                             }
>>
>>
>>                             ---------THE SERVICE WHICH IS CALLED BY THE
>>        CLIENT
>>               THROUGH
>>                             WEBSERVICE BINDING ---------
>>
>>                             /**
>>                              *  */
>>                             package org.acme.logix;
>>
>>                             import org.acme.logix.message.Message;
>>                             import org.oasisopen.sca.RequestContext;
>>                             import org.oasisopen.sca.ServiceReference;
>>                             import org.oasisopen.sca.annotation.Callback;
>>                             import org.oasisopen.sca.annotation.Context;
>>                             import org.oasisopen.sca.annotation.Reference;
>>                             import org.oasisopen.sca.annotation.Service;
>>
>>                             /**
>>                              *  *
>>                              */
>>                             public class MessageInterpreterImpl implements
>>                      MessageInterpreter{
>>
>>                             @Callback
>>                             protected MessageInterpreterCallback
>>                      messageInterpreterCallback;
>>                             /* (non-Javadoc)
>>                             * @see
>>
>>  org.acme.logix.MessageInterpreter#interpret(org.acme.logix.message.Message)
>>                             */
>>                             public void interpret(Message msg) {
>>                             System.out.println("The message is being
>>               interpreted..");
>>                             Interpretation ipr = new Interpretation();
>>                             messageInterpreterCallback.onInterpret(ipr);
>>                             }
>>
>>
>>
>>                             /**
>>                             * @return the messageInterpreterCallback
>>                             */
>>                             public MessageInterpreterCallback
>>                      getMessageInterpreterCallback() {
>>                             return messageInterpreterCallback;
>>                             }
>>
>>
>>
>>                             /**
>>                             * @param messageInterpreterCallback the
>>                             messageInterpreterCallback to set
>>                             */
>>                             public void setMessageInterpreterCallback(
>>                             MessageInterpreterCallback
>>               messageInterpreterCallback) {
>>                             this.messageInterpreterCallback =
>>               messageInterpreterCallback;
>>                             }
>>                             }
>>
>>
>>
>>
>>
>>                             ---- THE COMPOSITE -----------
>>
>>
>>
>>                             <composite
>>                             xmlns="
>> http://docs.oasis-open.org/ns/opencsa/sca/200912"
>>                                       targetNamespace="http://logistix"
>>                                       xmlns:logistix="http://logistix"
>>                                       name="AfnemerLogisticCenter">
>>
>>                                <component
>>        name="AfnemerHandlingAgentComponent">
>>                             <implementation.java
>>                      class="org.acme.logix.HandlingAgentImpl"/>
>>                                      <reference name="logisticCenter" >
>>                                     <binding.ws <http://binding.ws>
>>        <http://binding.ws>
>>               <http://binding.ws>
>>                      <http://binding.ws> <http://binding.ws>
>>
>>                                                  uri="
>> http://127.0.0.1:8087/AfnemerHandlingAgentComponent"/>
>>                    </reference>         <reference
>>               name="auditService"
>>                             target="AuditServiceComponent"/>
>>                 </component>
>>
>>
>>
>>                                <component
>>        name="AfnemerLogisticCenterComponent">
>>                                    <implementation.java
>>                             class="org.acme.logix.LogisticCenterImpl"/>
>>                                    <reference name="messageInterpreter">
>>                             <interface.java
>>                      interface="org.acme.logix.MessageInterpreter"
>>
>> callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>
>>                             <binding.ws <http://binding.ws>
>>        <http://binding.ws>
>>               <http://binding.ws> <http://binding.ws>
>>                      <http://binding.ws>
>>
>>                                                  uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>                             <callback >
>>                             <binding.ws <http://binding.ws>
>>        <http://binding.ws>
>>               <http://binding.ws> <http://binding.ws>
>>                      <http://binding.ws>
>>
>>                                           uri="
>> http://localhost:8084/Client/MessageInterpreterCallback
>>                                           <
>> http://localhost:8081/Client/MessageInterpreterCallback>" />
>>
>>                             </callback>
>>                             </reference>
>>                                    <reference name="auditService">
>>                                          <binding.jms
>>
>>  initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>>                             jndiURL="tcp://localhost:61616">
>>                               <destination jndiName="AuditServiceQueue" />
>>                               </binding.jms>         </reference>
>>                                     </component>
>>                                    <component
>>        name="MessageInterpreterComponent">
>>                                 <implementation.java
>>
>> class="org.acme.logix.MessageInterpreterImpl"/>
>>                                     <service name="MessageInterpreter">
>>                             <interface.java
>>               interface="org.acme.logix.MessageInterpreter"
>>
>>  callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>                             <binding.ws <http://binding.ws>
>>        <http://binding.ws>
>>               <http://binding.ws> <http://binding.ws>
>>                      <http://binding.ws>
>>
>>                                                   uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>                             <callback>
>>                             <binding.ws <http://binding.ws>
>>        <http://binding.ws>
>>               <http://binding.ws> <http://binding.ws>
>>                      <http://binding.ws>
>>
>>                                           uri="
>> http://localhost:8084/Client/MessageInterpreterCallback
>>                                           <
>> http://localhost:8081/Client/MessageInterpreterCallback>"/>
>>
>>                             </callback>
>>                             </service>
>>                                </component>
>>
>>
>>                                <component name="AuditServiceComponent">
>>                                    <implementation.java
>>                             class="org.acme.logix.AuditServiceImpl"/>
>>                                            <service name="AuditService">
>>                                        <binding.jms
>>
>>  initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>>                             jndiURL="tcp://localhost:61616">
>>                               <destination jndiName="AuditServiceQueue" />
>>                             </binding.jms>         </service>
>>                                </component>
>>                                </composite>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>

Re: Callback and Tuscany 2.0 Samples

Posted by Simon Nash <na...@apache.org>.
Urso Wieske wrote:
> Hi Simon,
> 
> Thanks for the quick response.
> That's a pitty that maven-tuscany-plugin is not behaving accordingly. 
> It's a great instrument to use within my IDE (Eclipse). I'll submit an 
> issue at the Tuscany projectsite. I will also dig into the 
> "maven-tuscany-plugin" problem to figure out what is the cause of this 
> deviation.
> 
Hi Urso,
I agree.  It should be possible to use maven-tuscany-plugin and
replace things in the base runtime by alternative implementations.
Maybe there is a way to do this, but I couldn't find one.

   Simon

> Kind Regards
> Urso
> 
> 
> 2011/1/15 Simon Nash <nash@apache.org <ma...@apache.org>>
> 
>     Urso Wieske wrote:
> 
>         Hi Simon,
> 
>         I have uploaded my sources as a zipped file.
> 
>     Hi Urso,
>     This problem is caused by a bug in Tuscany.  Please raise a JIRA
>     so that we can track and fix the problem.  In the meantime, I can
>     suggest a partial workaround.
> 
>     The injection failure only happens if Tuscany is using the
>     tuscany-binding-ws-runtime-jaxws module as the runtime implementation
>     for <binding.ws <http://binding.ws>>.  It doesn't happen if
>     tuscany-binding-ws-runtime-axis2
>     is used instead of tuscany-binding-ws-runtime-jaxws.  This implies that
>     the problem is caused by a bug in the -jaxws version.
> 
>     By default, Tuscany uses the -jaxws version.  To get Tuscany to use
>     the -axis2 version instead, you need to do special configuration in
>     the pom.xml file.
> 
>     Unfortunately I couldn't find a way to make this change when using
>     maven-tuscany-plugin to run the application.  This is because
>     maven-tuscany-plugin has a dependency on tuscany-base-runtime.
>     The tuscany-base-runtime jar contains the -jaxws version and seems
>     to always use it even if the -axis2 version is declared as an
>     additional dependency.
> 
>     I did find a way to get Tuscany to use the -axis2 version when not
>     using maven-tuscany-plugin.  If you replace this dependency:
>      <dependency>
>          <groupId>org.apache.tuscany.sca</groupId>
>          <artifactId>tuscany-base-runtime</artifactId>
>          <version>2.0-Beta1</version>
>      </dependency>
> 
>     by the following four dependencies:
>      <dependency>
>          <groupId>org.apache.tuscany.sca</groupId>
>          <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>          <version>2.0-Beta1</version>
>      </dependency>
> 
>      <dependency>
>          <groupId>org.apache.tuscany.sca</groupId>
>          <artifactId>tuscany-host-jetty</artifactId>
>          <version>2.0-Beta1</version>
>      </dependency>
> 
>      <dependency>
>          <groupId>org.apache.tuscany.sca</groupId>
>          <artifactId>tuscany-node-impl</artifactId>
>          <version>2.0-Beta1</version>
>      </dependency>
> 
>      <dependency>
>          <groupId>org.apache.tuscany.sca</groupId>
>          <artifactId>tuscany-implementation-java-runtime</artifactId>
>          <version>2.0-Beta1</version>
>      </dependency>
> 
>     then the application runs successfully.  I used a maven JUnit test
>     to verify this.
> 
>      Simon
> 
>         Hi Simon,
> 
>         I adapted my code as you suggested. It seems like the error has
>         dissappeared, but I got new ones. Well I removed the setter and
>         getter of messageInterpreterCallback from
>         MessageInterpreterImpl. Now my MessageInterpreterImpl class
>         contains only the instance variable messageInterpreterCallback .
>         I have made it a protected variable.
> 
>         I get a HTTP Internal Server ( error 500).
>         I am still missing something.SCA runtime is supposed
>         "automatically" inject my callback instance in the
>         messageInterpreterCallback member variable of
>         MessageInterpreterImpl. The MessageInterpreterImpl needs to have
>         a reference to some callback instance.
>         I can;t seem to solve this problem.
> 
>         This is the error....
>         ---------------------------------------
>         SEVERE: Exception invoking injector - null
>         org.oasisopen.sca.ServiceRuntimeException: Exception invoking
>         injector - null
>         at
>         org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>         at
>         org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>         at
>         org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>         at
>         org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>         at
>         org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>         at
>         org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>         at
>         org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>         at
>         com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>         at
>         com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>         at
>         com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>         at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>         at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>         at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>         at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>         at
>         com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>         at
>         com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>         at
>         com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>         at
>         com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>         at
>         com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>         at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>         at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>         at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>         at
>         sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>         at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>         at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>         at
>         java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at
>         java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:662)
>         Caused by:
>         org.apache.tuscany.sca.core.factory.ObjectCreationException:
>         Exception invoking injector - null
>         at
>         org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>         at
>         org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>         ... 27 more
>         Caused by: java.lang.NullPointerException
>         at
>         org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>         at
>         org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>         at
>         org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>         at
>         org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>         at
>         org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>         at
>         org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>         at
>         org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>         ... 28 more
>         10-jan-2011 1:39:26
>         com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>         processRequest
>         SEVERE: The server sent HTTP status code 500: Internal Server Error
>         com.sun.xml.internal.ws.client.ClientTransportException: The
>         server sent HTTP status code 500: Internal Server Error
>         at
>         com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>         at
>         com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>         at
>         com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>         at
>         com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>         at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>         at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>         at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>         at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>         at com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>         at
>         com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>         at
>         org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>         at
>         org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>         at
>         org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>         at
>         org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>         at
>         org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>         at
>         org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>         at
>         org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>         at
>         org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>         at $Proxy50.interpret(Unknown Source)
>         at
>         org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>         sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
>         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at
>         org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>         at
>         org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>         at
>         org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>         at
>         org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>         at
>         org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>         at
>         org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>         at
>         org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>         at
>         com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>         at
>         com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>         at
>         com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>         at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>         at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>         at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>         at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>         at
>         com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>         at
>         com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>         at
>         com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>         at
>         com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>         at
>         com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>         at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>         at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>         at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>         at
>         sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>         at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>         at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>         at
>         java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at
>         java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:662)
>         -----------------------------------------
>          Hope you can help me. (?)
> 
>         Kind Regards
>         Urso
> 
> 
> 
> 
>         2011/1/14 Simon Nash <nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>
> 
> 
>            Hi Urso,
>            I'm starting to look at your project code now.
> 
>            It's important to keep these threads on the Tuscany mailing list
>            so that other members of the Tuscany community are included in
>            the discussion.  The Tuscany mailing list archives are an
>         important
>            resource for Tuscany users who are experiencing a problem and are
>            looking to see if others have found a solution.  If a problem is
>            solved by a private message exchange instead of on the public
>         list,
>            the knowledge of how to solve it is confined to one person
>         instead
>            of being shared by the community.
> 
>            The best way to make this happen would be for you to resend your
>            recent private emails to the public list.  I'll look out for them
>            on the public list so that I can respond to them there.
> 
>             Simon
> 
>            Urso Wieske wrote:
> 
>                Hi Simon,
> 
>                You'll find in this email the zipped file containing my
>         sourcecode.
> 
>                Unfortunately, I still have errors.
>                I changed the member variable from protected to private
>         like you
>                suggested.
>                And created Getter and Setter for this member variable.
>                (messageInterpreterCallback).
>                I annotated the setter with @Callback.
>                I also removed the URI attribute from the
>         callback/binding.ws <http://binding.ws>
>                <http://binding.ws> <http://binding.ws> element of the
>         service
> 
>                according to your suggestion. Still problems.... :-(
> 
> 
>                I have zipped my source. It's an Eclipse project.
> 
>                I appreciate the fact that you are willing to verify this
>         issue.
>                If you have any questions about the code, just let me know.
> 
>                Please checkout also if my POM is well specified with
>         regard to
>                dependencies. Do I have the proper dependencies. I am using
>                Tuscany 2.0 Beta1.
> 
>                Kind Regards
>                Urso
> 
> 
>                2011/1/10 Simon Nash <nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>
>                <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>>
> 
> 
>                   Urso Wieske wrote:
> 
>                       Hi Simon,
> 
>                       I adapted my code as you suggested. It seems like the
>                error has
>                       dissappeared, but I got new ones. Well I removed the
>                setter and
>                       getter of messageInterpreterCallback from
>                       MessageInterpreterImpl. Now my
>         MessageInterpreterImpl class
>                       contains only the instance variable
>                messageInterpreterCallback .
>                       I have made it a protected variable.
> 
>                   According to the SCA 1.1 specs, this variable should
>         be private
>                   in order to avoid having it treated as a reference.
>          Can you try
>                   changing this and see if it makes any difference?
> 
> 
>                       I get a HTTP Internal Server ( error 500).
>                       I am still missing something.SCA runtime is supposed
>                       "automatically" inject my callback instance in the
>                       messageInterpreterCallback member variable of
>                       MessageInterpreterImpl. The MessageInterpreterImpl
>         needs
>                to have
>                       a reference to some callback instance.
>                       I can;t seem to solve this problem.
> 
>                    >From the stack trace it seems that the thread message
>                context doesn't
>                   contain the callback endpoint.  I'm not sure what
>         could cause
>                this.
>                   However I noticed a problem in your composite that
>         would be worth
>                   fixing, and it's just possible that this might be
>         related to the
>                   problem that you're seeing.
> 
>                   The problem is that you have specified a callback URI
>         for the
>                   MessageInterpreter service in
>         MessageInterpreterComponent, as
>                follows:
> 
>                    <service name="MessageInterpreter">
>                      <interface.java
>         interface="org.acme.logix.MessageInterpreter"
>                                
>         callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>                      <binding.ws <http://binding.ws> <http://binding.ws>
>         <http://binding.ws>
> 
> 
>                        
>          uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                      <callback>
>                        <binding.ws <http://binding.ws>
>         <http://binding.ws> <http://binding.ws>
>                  
>         uri="http://localhost:8084/Client/MessageInterpreterCallback"/>
>                      </callback>
>                    </service>
> 
>                   There shouldn't be any callback URI in the service
>                definition, because
>                   this information is provided at runtime by the client
>                invocation.  So
>                   you should change the above to:
> 
>                    <service name="MessageInterpreter">
>                      <interface.java
>         interface="org.acme.logix.MessageInterpreter"
>                                
>         callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>                      <binding.ws <http://binding.ws> <http://binding.ws>
>         <http://binding.ws>
> 
> 
>                        
>          uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                      <callback>
>                        <binding.ws/ <http://binding.ws/>
>         <http://binding.ws/> <http://binding.ws/>>
> 
> 
>                      </callback>
>                    </service>
> 
>                   If neither of these suggested changes fixes the
>         problem, please
>                   post the complete application as a zip file.
> 
>                    Simon
> 
>                       This is the error....
>                       ---------------------------------------
>                       SEVERE: Exception invoking injector - null
>                       org.oasisopen.sca.ServiceRuntimeException:
>         Exception invoking
>                       injector - null
>                       at
>                            
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>                       at
>                            
>          org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                       at
>                            
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                       at
>                            
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                       at
>                            
>          org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                       at
>                            
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                       at
>                            
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                       at
>                            
>          com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                       at
>                            
>          com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                       at
>                            
>          com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                       at
>              
>          com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                       at
>                com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                       at
>                com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                       at
>              
>          com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                       at
>                            
>          com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                       at
>                            
>          com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                       at
>                            
>          com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                       at
>                            
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                       at
>                            
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                       at
>                com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                       at
>         sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                       at
>                com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                       at
>                            
>          sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                       at
>                com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                       at
>              
>          sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                       at
>                            
>          java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                       at
>                            
>          java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                       at java.lang.Thread.run(Thread.java:662)
>                       Caused by:
>                      
>         org.apache.tuscany.sca.core.factory.ObjectCreationException:
>                       Exception invoking injector - null
>                       at
>                            
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>                       at
>                            
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>                       ... 27 more
>                       Caused by: java.lang.NullPointerException
>                       at
>                            
>          org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>                       at
>                            
>          org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>                       at
>                            
>          org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>                       at
>                            
>          org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>                       at
>                            
>          org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>                       at
>                            
>          org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>                       at
>                            
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>                       ... 28 more
>                       10-jan-2011 1:39:26
>                            
>          com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>                       processRequest
>                       SEVERE: The server sent HTTP status code 500: Internal
>                Server Error
>                      
>         com.sun.xml.internal.ws.client.ClientTransportException: The
>                       server sent HTTP status code 500: Internal Server
>         Error
>                       at
>                            
>          com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>                       at
>                            
>          com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>                       at
>                            
>          com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>                       at
>                            
>          com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>                       at
>              
>          com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                       at
>                com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                       at
>                com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                       at
>              
>          com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                       at
>         com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>                       at
>                            
>          com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>                       at
>                            
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>                       at
>                            
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>                       at
>                            
>          org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                       at
>                            
>          org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>                       at
>                            
>          org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>                       at
>                            
>          org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>                       at
>                            
>          org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>                       at
>                            
>          org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>                       at $Proxy50.interpret(Unknown Source)
>                       at
>                            
>          org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>                       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>                Method)
>                       at
>                            
>          sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>                       at
>                            
>          sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>                       at java.lang.reflect.Method.invoke(Method.java:597)
>                       at
>                            
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>                       at
>                            
>          org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                       at
>                            
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                       at
>                            
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                       at
>                            
>          org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                       at
>                            
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                       at
>                            
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                       at
>                            
>          com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                       at
>                            
>          com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                       at
>                            
>          com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                       at
>              
>          com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                       at
>                com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                       at
>                com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                       at
>              
>          com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                       at
>                            
>          com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                       at
>                            
>          com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                       at
>                            
>          com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                       at
>                            
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                       at
>                            
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                       at
>                com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                       at
>         sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                       at
>                com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                       at
>                            
>          sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                       at
>                com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                       at
>              
>          sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                       at
>                            
>          java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                       at
>                            
>          java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                       at java.lang.Thread.run(Thread.java:662)
>                       -----------------------------------------
>                        Hope you can help me. (?)
> 
>                       Kind Regards
>                       Urso
> 
>                       2011/1/9 Simon Nash <nash@apache.org
>         <ma...@apache.org>
>                <mailto:nash@apache.org <ma...@apache.org>>
>         <mailto:nash@apache.org <ma...@apache.org>
>                <mailto:nash@apache.org <ma...@apache.org>>>
>                       <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>
>                <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>>>
> 
> 
> 
>                          Urso Wieske wrote:
> 
>                              Hi
>                              I am evaluating Tuscany 2.0 Beta1 and am
>         trying to
>                learn more
>                              about Callbacks (Bi-Directional interface)
>         of SCA
>                1.1. I
>                              downloaded the Tuscany Sample files and
>         started to
>                       explore the
>                              callback implementations with webservice
>         binding,
>                i.e. the
>                              Search and SearchCallback interfaces.
>                              It took me a while before I realized that the
>                Tuscany SCA
>                              Samples were based on SCA v1.0.   Tuscany
>         2.0 Beta1 is
>                       based on
>                              the SCA v1.1 specs.
>                              After studying the sample sources, I have
>         written
>                my own
>                       callback.
> 
>                              Unfortunately, I kept on getting a runtime
>                exception after I
>                              installed and deployed my contribution. By the
>                way, I am
>                       using
>                              Eclipse and the maven tuscany plugin.
> 
>                              I can't find the problem and hope if
>         someone can
>                point me
>                       in the
>                              right direction.
> 
>                              This is the error (printed on my console) I am
>                getting when I
>                              try to run my program:
>                              [ERROR] Failed to execute goal
>                                          
>          org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>                              (default-cli) on project handler-agent:
>         Execution
>                       default-cli of
>                              goal
>                                          
>          org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>                              failed:
>         org.oasisopen.sca.ServiceRuntimeException:
>                       [Composite:
>                            
>          {http://docs.oasis-open.org/ns/opencsa/sca/200912},
>                       Component:
>                              MessageInterpreterComponent] - [ASM60033] No
>                targets for
>                              reference: Composite =
>                            
>          {http://docs.oasis-open.org/ns/opencsa/sca/200912}
>                       Reference =
>                              messageInterpreterCallback -> [Help 1]
> 
>                              I suspect that I am doing something wrong
>         in the
>                       composite file.
>                              I can't imagine I did something wrong in
>         the java
>                       sources. (See
>                              below for the sources.)
> 
>                          Because the MessageInterpreterImpl class doesn't
>                contain any
>                          @Reference or
>                          @Property annotations, SCA creates implicit
>         references for
>                       all public
>                          setter methods in this class whose type is a
>         remotable SCA
>                          interface, and
>                          also for all public or protected fields in this
>         class
>                whose
>                       type is a
>                          remotable SCA interface.
> 
>                          There is a public setter method
>                       setMessageInterpreterCallback() and a
>                          protected field messageInterpreterCallback, so SCA
>                defines a
>                       reference
>                          named messageInterpreterCallback.  This
>         reference doesn't
>                       have a target
>                          configured in the composite, hence the error
>         message.
> 
>                          To fix the problem, you need to remove the setter
>                method (or
>                       make it
>                          protected) and change the field from protected
>         to private.
> 
>                           Simon
> 
> 
>                              Kind Regards,
> 
>                              Urso
> 
> 
>                              -------------------- THE SERVICE Interface With
>                Callback
>                              Interface association ----------
>                              /**
>                               *  */
>                              package org.acme.logix;
> 
>                              import org.acme.logix.message.Message;
>                              import org.oasisopen.sca.annotation.Callback;
>                              import org.oasisopen.sca.annotation.OneWay;
>                              import org.oasisopen.sca.annotation.Remotable;
> 
>                              /**
>                               *  *
>                               */
>                              @Remotable
>                              @Callback(MessageInterpreterCallback.class)
>                              public interface MessageInterpreter {
> 
>                              @OneWay
>                              void interpret(Message msg);
>                              }
> 
> 
>                              /**
>                               *  */
>                              package org.acme.logix;
> 
>                              import org.oasisopen.sca.annotation.OneWay;
>                              import org.oasisopen.sca.annotation.Remotable;
> 
>                              /**
>                               *  *
>                               */
>                              @Remotable
>                              public interface MessageInterpreterCallback {
>                              void onInterpret(Interpretation ipr);
>                              }
> 
> 
>                              ---------- THE CLIENT implementing the callback
>                interface
>                              ------------
> 
>                              /**
>                               *  */
>                              package org.acme.logix;
> 
>                              import org.acme.logix.message.Message;
>                              import org.oasisopen.sca.annotation.Reference;
> 
>                              /**
>                               *  */
>                              public class LogisticCenterImpl implements
>                LogisticCenter,
>                              MessageInterpreterCallback {
>                              private AuditService auditService;
>                              @Reference
>                              protected MessageInterpreter
>         messageInterpreter;
> 
>                              /* (non-Javadoc)
>                              * @see
>                                          
>          org.acme.logix.LogisticCenter#processMessage(org.acme.logix.message.Message)
>                              */
>                              public void processMessage(Message message) {
>                              System.out.println("Processing message with
>                payload " +
>                              message.getPayload() );
>                              auditService.logSentMessage(message);
>                              messageInterpreter.interpret(message);
>                              }
> 
>                              /**
>                              * @return the auditService
>                              */
>                              public AuditService getAuditService() {
>                              return auditService;
>                              }
> 
>                              /**
>                              * @param auditService the auditService to set
>                              */
>                              @Reference
>                              public void setAuditService(AuditService
>                auditService) {
>                              this.auditService = auditService;
>                              }
> 
>                              /**
>                              * @param messageInterpreter the
>         messageInterpreter
>                to set
>                              */
>                              public void
>         setMessageInterpreter(MessageInterpreter
>                              messageInterpreter) {
>                              this.messageInterpreter = messageInterpreter;
>                              }
> 
>                              /**
>                              * @return the messageInterpreter
>                              */
>                              public MessageInterpreter
>         getMessageInterpreter() {
>                              return messageInterpreter;
>                              }
> 
> 
>                                     /**
>                                     *  THE CALLBACK method of
>                MessageInterpreterCallback
>                              interface
>                                     */
>                              public void onInterpret(Interpretation ipr) {
>                              System.out.println("Message has been
>         interpreted.");
>                              }
> 
>                              }
> 
> 
>                              ---------THE SERVICE WHICH IS CALLED BY THE
>         CLIENT
>                THROUGH
>                              WEBSERVICE BINDING ---------
> 
>                              /**
>                               *  */
>                              package org.acme.logix;
> 
>                              import org.acme.logix.message.Message;
>                              import org.oasisopen.sca.RequestContext;
>                              import org.oasisopen.sca.ServiceReference;
>                              import org.oasisopen.sca.annotation.Callback;
>                              import org.oasisopen.sca.annotation.Context;
>                              import org.oasisopen.sca.annotation.Reference;
>                              import org.oasisopen.sca.annotation.Service;
> 
>                              /**
>                               *  *
>                               */
>                              public class MessageInterpreterImpl implements
>                       MessageInterpreter{
> 
>                              @Callback
>                              protected MessageInterpreterCallback
>                       messageInterpreterCallback;
>                              /* (non-Javadoc)
>                              * @see
>                                          
>          org.acme.logix.MessageInterpreter#interpret(org.acme.logix.message.Message)
>                              */
>                              public void interpret(Message msg) {
>                              System.out.println("The message is being
>                interpreted..");
>                              Interpretation ipr = new Interpretation();
>                              messageInterpreterCallback.onInterpret(ipr);
>                              }
> 
> 
> 
>                              /**
>                              * @return the messageInterpreterCallback
>                              */
>                              public MessageInterpreterCallback
>                       getMessageInterpreterCallback() {
>                              return messageInterpreterCallback;
>                              }
> 
> 
> 
>                              /**
>                              * @param messageInterpreterCallback the
>                              messageInterpreterCallback to set
>                              */
>                              public void setMessageInterpreterCallback(
>                              MessageInterpreterCallback
>                messageInterpreterCallback) {
>                              this.messageInterpreterCallback =
>                messageInterpreterCallback;
>                              }
>                              }
> 
> 
> 
> 
> 
>                              ---- THE COMPOSITE -----------
> 
> 
> 
>                              <composite
>                      
>         xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
>                                        targetNamespace="http://logistix"
>                                        xmlns:logistix="http://logistix"
>                                        name="AfnemerLogisticCenter">
> 
>                                 <component
>         name="AfnemerHandlingAgentComponent">
>                              <implementation.java
>                       class="org.acme.logix.HandlingAgentImpl"/>
>                                       <reference name="logisticCenter" >
>                                      <binding.ws <http://binding.ws>
>         <http://binding.ws>
>                <http://binding.ws>
>                       <http://binding.ws> <http://binding.ws>
> 
>                                          
>          uri="http://127.0.0.1:8087/AfnemerHandlingAgentComponent"/>    
>                                   </reference>         <reference
>                name="auditService"
>                              target="AuditServiceComponent"/>          
>                      </component>
> 
> 
> 
>                                 <component
>         name="AfnemerLogisticCenterComponent">
>                                     <implementation.java
>                              class="org.acme.logix.LogisticCenterImpl"/>
>                                     <reference name="messageInterpreter">
>                              <interface.java
>                       interface="org.acme.logix.MessageInterpreter"    
>                                                                    
>         callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
> 
>                              <binding.ws <http://binding.ws>
>         <http://binding.ws>
>                <http://binding.ws> <http://binding.ws>
>                       <http://binding.ws>
> 
>                                          
>          uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                              <callback >
>                              <binding.ws <http://binding.ws>
>         <http://binding.ws>
>                <http://binding.ws> <http://binding.ws>
>                       <http://binding.ws>
> 
>                                    
>         uri="http://localhost:8084/Client/MessageInterpreterCallback
>                                    
>         <http://localhost:8081/Client/MessageInterpreterCallback>" />
> 
>                              </callback>
>                              </reference>
>                                     <reference name="auditService">    
>                                               <binding.jms
>                                          
>          initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>                              jndiURL="tcp://localhost:61616">
>                                <destination jndiName="AuditServiceQueue" />
>                                </binding.jms>         </reference>
>                                      </component>
>                                     <component
>         name="MessageInterpreterComponent">
>                                  <implementation.java
>                              class="org.acme.logix.MessageInterpreterImpl"/>
>                                      <service name="MessageInterpreter">
>                              <interface.java
>                interface="org.acme.logix.MessageInterpreter"
>                                                              
>          callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>                              <binding.ws <http://binding.ws>
>         <http://binding.ws>
>                <http://binding.ws> <http://binding.ws>
>                       <http://binding.ws>
> 
>                                            
>         uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                              <callback>
>                              <binding.ws <http://binding.ws>
>         <http://binding.ws>
>                <http://binding.ws> <http://binding.ws>
>                       <http://binding.ws>
> 
>                                    
>         uri="http://localhost:8084/Client/MessageInterpreterCallback
>                                    
>         <http://localhost:8081/Client/MessageInterpreterCallback>"/>
> 
>                              </callback>
>                              </service>
>                                 </component>
> 
> 
>                                 <component name="AuditServiceComponent">
>                                     <implementation.java
>                              class="org.acme.logix.AuditServiceImpl"/>
>                                             <service name="AuditService">
>                                         <binding.jms
>                                          
>          initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>                              jndiURL="tcp://localhost:61616">
>                                <destination jndiName="AuditServiceQueue" />
>                              </binding.jms>         </service>
>                                 </component>
>                                 </composite>
> 
> 
> 
> 
> 
> 
> 
> 
> 


Re: Callback and Tuscany 2.0 Samples

Posted by Urso Wieske <uw...@gmail.com>.
Hi Simon,

Thanks for the quick response.
That's a pitty that maven-tuscany-plugin is not behaving accordingly. It's a
great instrument to use within my IDE (Eclipse). I'll submit an issue at the
Tuscany projectsite. I will also dig into the "maven-tuscany-plugin" problem
to figure out what is the cause of this deviation.

Kind Regards
Urso


2011/1/15 Simon Nash <na...@apache.org>

> Urso Wieske wrote:
>
>> Hi Simon,
>>
>> I have uploaded my sources as a zipped file.
>>
>>  Hi Urso,
> This problem is caused by a bug in Tuscany.  Please raise a JIRA
> so that we can track and fix the problem.  In the meantime, I can
> suggest a partial workaround.
>
> The injection failure only happens if Tuscany is using the
> tuscany-binding-ws-runtime-jaxws module as the runtime implementation
> for <binding.ws>.  It doesn't happen if tuscany-binding-ws-runtime-axis2
> is used instead of tuscany-binding-ws-runtime-jaxws.  This implies that
> the problem is caused by a bug in the -jaxws version.
>
> By default, Tuscany uses the -jaxws version.  To get Tuscany to use
> the -axis2 version instead, you need to do special configuration in
> the pom.xml file.
>
> Unfortunately I couldn't find a way to make this change when using
> maven-tuscany-plugin to run the application.  This is because
> maven-tuscany-plugin has a dependency on tuscany-base-runtime.
> The tuscany-base-runtime jar contains the -jaxws version and seems
> to always use it even if the -axis2 version is declared as an
> additional dependency.
>
> I did find a way to get Tuscany to use the -axis2 version when not
> using maven-tuscany-plugin.  If you replace this dependency:
>  <dependency>
>      <groupId>org.apache.tuscany.sca</groupId>
>      <artifactId>tuscany-base-runtime</artifactId>
>      <version>2.0-Beta1</version>
>  </dependency>
>
> by the following four dependencies:
>  <dependency>
>      <groupId>org.apache.tuscany.sca</groupId>
>      <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
>      <version>2.0-Beta1</version>
>  </dependency>
>
>  <dependency>
>      <groupId>org.apache.tuscany.sca</groupId>
>      <artifactId>tuscany-host-jetty</artifactId>
>      <version>2.0-Beta1</version>
>  </dependency>
>
>  <dependency>
>      <groupId>org.apache.tuscany.sca</groupId>
>      <artifactId>tuscany-node-impl</artifactId>
>      <version>2.0-Beta1</version>
>  </dependency>
>
>  <dependency>
>      <groupId>org.apache.tuscany.sca</groupId>
>      <artifactId>tuscany-implementation-java-runtime</artifactId>
>      <version>2.0-Beta1</version>
>  </dependency>
>
> then the application runs successfully.  I used a maven JUnit test
> to verify this.
>
>  Simon
>
>  Hi Simon,
>>
>> I adapted my code as you suggested. It seems like the error has
>> dissappeared, but I got new ones. Well I removed the setter and getter of
>> messageInterpreterCallback from MessageInterpreterImpl. Now my
>> MessageInterpreterImpl class contains only the instance variable
>> messageInterpreterCallback . I have made it a protected variable.
>>
>> I get a HTTP Internal Server ( error 500).
>> I am still missing something.SCA runtime is supposed "automatically"
>> inject my callback instance in the messageInterpreterCallback member
>> variable of MessageInterpreterImpl. The MessageInterpreterImpl needs to have
>> a reference to some callback instance.
>> I can;t seem to solve this problem.
>>
>> This is the error....
>> ---------------------------------------
>> SEVERE: Exception invoking injector - null
>> org.oasisopen.sca.ServiceRuntimeException: Exception invoking injector -
>> null
>> at
>> org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>> at
>> org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>> at
>> org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>> at
>> org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>> at
>> org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>> at
>> org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>> at
>> org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>> at
>> com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>> at
>> com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>> at
>> com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>> at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>> at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>> at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>> at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>> at
>> com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>> at
>> com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>> at
>> com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>> at
>> com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>> at
>> com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>> at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>> at
>> sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>> at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>> at java.lang.Thread.run(Thread.java:662)
>> Caused by: org.apache.tuscany.sca.core.factory.ObjectCreationException:
>> Exception invoking injector - null
>> at
>> org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>> at
>> org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>> ... 27 more
>> Caused by: java.lang.NullPointerException
>> at
>> org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>> at
>> org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>> at
>> org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>> at
>> org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>> at
>> org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>> at
>> org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>> at
>> org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>> ... 28 more
>> 10-jan-2011 1:39:26
>> com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>> processRequest
>> SEVERE: The server sent HTTP status code 500: Internal Server Error
>> com.sun.xml.internal.ws.client.ClientTransportException: The server sent
>> HTTP status code 500: Internal Server Error
>> at
>> com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>> at
>> com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>> at
>> com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>> at
>> com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>> at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>> at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>> at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>> at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>> at com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>> at
>> com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>> at
>> org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>> at
>> org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>> at
>> org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>> at
>> org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>> at
>> org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>> at
>> org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>> at
>> org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>> at
>> org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>> at $Proxy50.interpret(Unknown Source)
>> at
>> org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>> org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>> at
>> org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>> at
>> org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>> at
>> org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>> at
>> org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>> at
>> org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>> at
>> org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>> at
>> com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>> at
>> com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>> at
>> com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>> at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>> at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>> at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>> at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>> at
>> com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>> at
>> com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>> at
>> com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>> at
>> com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>> at
>> com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>> at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>> at
>> sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>> at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>> at java.lang.Thread.run(Thread.java:662)
>> -----------------------------------------
>>  Hope you can help me. (?)
>>
>> Kind Regards
>> Urso
>>
>>
>>
>>
>> 2011/1/14 Simon Nash <nash@apache.org <ma...@apache.org>>
>>
>>
>>    Hi Urso,
>>    I'm starting to look at your project code now.
>>
>>    It's important to keep these threads on the Tuscany mailing list
>>    so that other members of the Tuscany community are included in
>>    the discussion.  The Tuscany mailing list archives are an important
>>    resource for Tuscany users who are experiencing a problem and are
>>    looking to see if others have found a solution.  If a problem is
>>    solved by a private message exchange instead of on the public list,
>>    the knowledge of how to solve it is confined to one person instead
>>    of being shared by the community.
>>
>>    The best way to make this happen would be for you to resend your
>>    recent private emails to the public list.  I'll look out for them
>>    on the public list so that I can respond to them there.
>>
>>     Simon
>>
>>    Urso Wieske wrote:
>>
>>        Hi Simon,
>>
>>        You'll find in this email the zipped file containing my sourcecode.
>>
>>        Unfortunately, I still have errors.
>>        I changed the member variable from protected to private like you
>>        suggested.
>>        And created Getter and Setter for this member variable.
>>        (messageInterpreterCallback).
>>        I annotated the setter with @Callback.
>>        I also removed the URI attribute from the callback/binding.ws
>>        <http://binding.ws> <http://binding.ws> element of the service
>>
>>        according to your suggestion. Still problems.... :-(
>>
>>
>>        I have zipped my source. It's an Eclipse project.
>>
>>        I appreciate the fact that you are willing to verify this issue.
>>        If you have any questions about the code, just let me know.
>>
>>        Please checkout also if my POM is well specified with regard to
>>        dependencies. Do I have the proper dependencies. I am using
>>        Tuscany 2.0 Beta1.
>>
>>        Kind Regards
>>        Urso
>>
>>
>>        2011/1/10 Simon Nash <nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>
>>
>>
>>           Urso Wieske wrote:
>>
>>               Hi Simon,
>>
>>               I adapted my code as you suggested. It seems like the
>>        error has
>>               dissappeared, but I got new ones. Well I removed the
>>        setter and
>>               getter of messageInterpreterCallback from
>>               MessageInterpreterImpl. Now my MessageInterpreterImpl class
>>               contains only the instance variable
>>        messageInterpreterCallback .
>>               I have made it a protected variable.
>>
>>           According to the SCA 1.1 specs, this variable should be private
>>           in order to avoid having it treated as a reference.  Can you try
>>           changing this and see if it makes any difference?
>>
>>
>>               I get a HTTP Internal Server ( error 500).
>>               I am still missing something.SCA runtime is supposed
>>               "automatically" inject my callback instance in the
>>               messageInterpreterCallback member variable of
>>               MessageInterpreterImpl. The MessageInterpreterImpl needs
>>        to have
>>               a reference to some callback instance.
>>               I can;t seem to solve this problem.
>>
>>            >From the stack trace it seems that the thread message
>>        context doesn't
>>           contain the callback endpoint.  I'm not sure what could cause
>>        this.
>>           However I noticed a problem in your composite that would be
>> worth
>>           fixing, and it's just possible that this might be related to the
>>           problem that you're seeing.
>>
>>           The problem is that you have specified a callback URI for the
>>           MessageInterpreter service in MessageInterpreterComponent, as
>>        follows:
>>
>>            <service name="MessageInterpreter">
>>              <interface.java interface="org.acme.logix.MessageInterpreter"
>>
>> callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>              <binding.ws <http://binding.ws> <http://binding.ws>
>>
>>
>>                  uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>              <callback>
>>                <binding.ws <http://binding.ws> <http://binding.ws>
>>           uri="http://localhost:8084/Client/MessageInterpreterCallback"/>
>>              </callback>
>>            </service>
>>
>>           There shouldn't be any callback URI in the service
>>        definition, because
>>           this information is provided at runtime by the client
>>        invocation.  So
>>           you should change the above to:
>>
>>            <service name="MessageInterpreter">
>>              <interface.java interface="org.acme.logix.MessageInterpreter"
>>
>> callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>              <binding.ws <http://binding.ws> <http://binding.ws>
>>
>>
>>                  uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>              <callback>
>>                <binding.ws/ <http://binding.ws/> <http://binding.ws/>>
>>
>>
>>              </callback>
>>            </service>
>>
>>           If neither of these suggested changes fixes the problem, please
>>           post the complete application as a zip file.
>>
>>            Simon
>>
>>               This is the error....
>>               ---------------------------------------
>>               SEVERE: Exception invoking injector - null
>>               org.oasisopen.sca.ServiceRuntimeException: Exception
>> invoking
>>               injector - null
>>               at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>>               at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>               at
>>
>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>               at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>               at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>               at
>>
>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>               at
>>
>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>               at
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>               at
>>
>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>               at
>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>               at
>> sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>               at
>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>               at
>>
>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>               at
>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>               at
>>        sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>               at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>               at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>               at java.lang.Thread.run(Thread.java:662)
>>               Caused by:
>>               org.apache.tuscany.sca.core.factory.ObjectCreationException:
>>               Exception invoking injector - null
>>               at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>>               at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>>               ... 27 more
>>               Caused by: java.lang.NullPointerException
>>               at
>>
>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>>               at
>>
>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>>               at
>>
>>  org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>>               at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>>               ... 28 more
>>               10-jan-2011 1:39:26
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>>               processRequest
>>               SEVERE: The server sent HTTP status code 500: Internal
>>        Server Error
>>               com.sun.xml.internal.ws.client.ClientTransportException: The
>>               server sent HTTP status code 500: Internal Server Error
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>               at
>> com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>>               at
>>
>>  com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>>               at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>>               at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>>               at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>>               at $Proxy50.interpret(Unknown Source)
>>               at
>>
>>  org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>>               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>        Method)
>>               at
>>
>>  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>               at
>>
>>  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>               at java.lang.reflect.Method.invoke(Method.java:597)
>>               at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>>               at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>               at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>               at
>>
>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>               at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>               at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>               at
>>
>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>               at
>>
>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>               at
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>               at
>>        com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>               at
>>
>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>               at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>               at
>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>               at
>> sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>               at
>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>               at
>>
>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>               at
>>        com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>               at
>>        sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>               at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>               at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>               at java.lang.Thread.run(Thread.java:662)
>>               -----------------------------------------
>>                Hope you can help me. (?)
>>
>>               Kind Regards
>>               Urso
>>
>>               2011/1/9 Simon Nash <nash@apache.org
>>        <ma...@apache.org> <mailto:nash@apache.org
>>        <ma...@apache.org>>
>>               <mailto:nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>>
>>
>>
>>
>>                  Urso Wieske wrote:
>>
>>                      Hi
>>                      I am evaluating Tuscany 2.0 Beta1 and am trying to
>>        learn more
>>                      about Callbacks (Bi-Directional interface) of SCA
>>        1.1. I
>>                      downloaded the Tuscany Sample files and started to
>>               explore the
>>                      callback implementations with webservice binding,
>>        i.e. the
>>                      Search and SearchCallback interfaces.
>>                      It took me a while before I realized that the
>>        Tuscany SCA
>>                      Samples were based on SCA v1.0.   Tuscany 2.0 Beta1
>> is
>>               based on
>>                      the SCA v1.1 specs.
>>                      After studying the sample sources, I have written
>>        my own
>>               callback.
>>
>>                      Unfortunately, I kept on getting a runtime
>>        exception after I
>>                      installed and deployed my contribution. By the
>>        way, I am
>>               using
>>                      Eclipse and the maven tuscany plugin.
>>
>>                      I can't find the problem and hope if someone can
>>        point me
>>               in the
>>                      right direction.
>>
>>                      This is the error (printed on my console) I am
>>        getting when I
>>                      try to run my program:
>>                      [ERROR] Failed to execute goal
>>
>>  org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>>                      (default-cli) on project handler-agent: Execution
>>               default-cli of
>>                      goal
>>
>>  org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>>                      failed: org.oasisopen.sca.ServiceRuntimeException:
>>               [Composite:
>>                      {http://docs.oasis-open.org/ns/opencsa/sca/200912},
>>               Component:
>>                      MessageInterpreterComponent] - [ASM60033] No
>>        targets for
>>                      reference: Composite =
>>                      {http://docs.oasis-open.org/ns/opencsa/sca/200912}
>>               Reference =
>>                      messageInterpreterCallback -> [Help 1]
>>
>>                      I suspect that I am doing something wrong in the
>>               composite file.
>>                      I can't imagine I did something wrong in the java
>>               sources. (See
>>                      below for the sources.)
>>
>>                  Because the MessageInterpreterImpl class doesn't
>>        contain any
>>                  @Reference or
>>                  @Property annotations, SCA creates implicit references
>> for
>>               all public
>>                  setter methods in this class whose type is a remotable
>> SCA
>>                  interface, and
>>                  also for all public or protected fields in this class
>>        whose
>>               type is a
>>                  remotable SCA interface.
>>
>>                  There is a public setter method
>>               setMessageInterpreterCallback() and a
>>                  protected field messageInterpreterCallback, so SCA
>>        defines a
>>               reference
>>                  named messageInterpreterCallback.  This reference doesn't
>>               have a target
>>                  configured in the composite, hence the error message.
>>
>>                  To fix the problem, you need to remove the setter
>>        method (or
>>               make it
>>                  protected) and change the field from protected to
>> private.
>>
>>                   Simon
>>
>>
>>                      Kind Regards,
>>
>>                      Urso
>>
>>
>>                      -------------------- THE SERVICE Interface With
>>        Callback
>>                      Interface association ----------
>>                      /**
>>                       *  */
>>                      package org.acme.logix;
>>
>>                      import org.acme.logix.message.Message;
>>                      import org.oasisopen.sca.annotation.Callback;
>>                      import org.oasisopen.sca.annotation.OneWay;
>>                      import org.oasisopen.sca.annotation.Remotable;
>>
>>                      /**
>>                       *  *
>>                       */
>>                      @Remotable
>>                      @Callback(MessageInterpreterCallback.class)
>>                      public interface MessageInterpreter {
>>
>>                      @OneWay
>>                      void interpret(Message msg);
>>                      }
>>
>>
>>                      /**
>>                       *  */
>>                      package org.acme.logix;
>>
>>                      import org.oasisopen.sca.annotation.OneWay;
>>                      import org.oasisopen.sca.annotation.Remotable;
>>
>>                      /**
>>                       *  *
>>                       */
>>                      @Remotable
>>                      public interface MessageInterpreterCallback {
>>                      void onInterpret(Interpretation ipr);
>>                      }
>>
>>
>>                      ---------- THE CLIENT implementing the callback
>>        interface
>>                      ------------
>>
>>                      /**
>>                       *  */
>>                      package org.acme.logix;
>>
>>                      import org.acme.logix.message.Message;
>>                      import org.oasisopen.sca.annotation.Reference;
>>
>>                      /**
>>                       *  */
>>                      public class LogisticCenterImpl implements
>>        LogisticCenter,
>>                      MessageInterpreterCallback {
>>                      private AuditService auditService;
>>                      @Reference
>>                      protected MessageInterpreter messageInterpreter;
>>
>>                      /* (non-Javadoc)
>>                      * @see
>>
>>  org.acme.logix.LogisticCenter#processMessage(org.acme.logix.message.Message)
>>                      */
>>                      public void processMessage(Message message) {
>>                      System.out.println("Processing message with
>>        payload " +
>>                      message.getPayload() );
>>                      auditService.logSentMessage(message);
>>                      messageInterpreter.interpret(message);
>>                      }
>>
>>                      /**
>>                      * @return the auditService
>>                      */
>>                      public AuditService getAuditService() {
>>                      return auditService;
>>                      }
>>
>>                      /**
>>                      * @param auditService the auditService to set
>>                      */
>>                      @Reference
>>                      public void setAuditService(AuditService
>>        auditService) {
>>                      this.auditService = auditService;
>>                      }
>>
>>                      /**
>>                      * @param messageInterpreter the messageInterpreter
>>        to set
>>                      */
>>                      public void setMessageInterpreter(MessageInterpreter
>>                      messageInterpreter) {
>>                      this.messageInterpreter = messageInterpreter;
>>                      }
>>
>>                      /**
>>                      * @return the messageInterpreter
>>                      */
>>                      public MessageInterpreter getMessageInterpreter() {
>>                      return messageInterpreter;
>>                      }
>>
>>
>>                             /**
>>                             *  THE CALLBACK method of
>>        MessageInterpreterCallback
>>                      interface
>>                             */
>>                      public void onInterpret(Interpretation ipr) {
>>                      System.out.println("Message has been interpreted.");
>>                      }
>>
>>                      }
>>
>>
>>                      ---------THE SERVICE WHICH IS CALLED BY THE CLIENT
>>        THROUGH
>>                      WEBSERVICE BINDING ---------
>>
>>                      /**
>>                       *  */
>>                      package org.acme.logix;
>>
>>                      import org.acme.logix.message.Message;
>>                      import org.oasisopen.sca.RequestContext;
>>                      import org.oasisopen.sca.ServiceReference;
>>                      import org.oasisopen.sca.annotation.Callback;
>>                      import org.oasisopen.sca.annotation.Context;
>>                      import org.oasisopen.sca.annotation.Reference;
>>                      import org.oasisopen.sca.annotation.Service;
>>
>>                      /**
>>                       *  *
>>                       */
>>                      public class MessageInterpreterImpl implements
>>               MessageInterpreter{
>>
>>                      @Callback
>>                      protected MessageInterpreterCallback
>>               messageInterpreterCallback;
>>                      /* (non-Javadoc)
>>                      * @see
>>
>>  org.acme.logix.MessageInterpreter#interpret(org.acme.logix.message.Message)
>>                      */
>>                      public void interpret(Message msg) {
>>                      System.out.println("The message is being
>>        interpreted..");
>>                      Interpretation ipr = new Interpretation();
>>                      messageInterpreterCallback.onInterpret(ipr);
>>                      }
>>
>>
>>
>>                      /**
>>                      * @return the messageInterpreterCallback
>>                      */
>>                      public MessageInterpreterCallback
>>               getMessageInterpreterCallback() {
>>                      return messageInterpreterCallback;
>>                      }
>>
>>
>>
>>                      /**
>>                      * @param messageInterpreterCallback the
>>                      messageInterpreterCallback to set
>>                      */
>>                      public void setMessageInterpreterCallback(
>>                      MessageInterpreterCallback
>>        messageInterpreterCallback) {
>>                      this.messageInterpreterCallback =
>>        messageInterpreterCallback;
>>                      }
>>                      }
>>
>>
>>
>>
>>
>>                      ---- THE COMPOSITE -----------
>>
>>
>>
>>                      <composite
>>               xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
>>                                targetNamespace="http://logistix"
>>                                xmlns:logistix="http://logistix"
>>                                name="AfnemerLogisticCenter">
>>
>>                         <component name="AfnemerHandlingAgentComponent">
>>                      <implementation.java
>>               class="org.acme.logix.HandlingAgentImpl"/>
>>                               <reference name="logisticCenter" >
>>                              <binding.ws <http://binding.ws>
>>        <http://binding.ws>
>>               <http://binding.ws> <http://binding.ws>
>>
>>                                    uri="
>> http://127.0.0.1:8087/AfnemerHandlingAgentComponent"/>
>>             </reference>         <reference
>>        name="auditService"
>>                      target="AuditServiceComponent"/>
>>    </component>
>>
>>
>>
>>                         <component name="AfnemerLogisticCenterComponent">
>>                             <implementation.java
>>                      class="org.acme.logix.LogisticCenterImpl"/>
>>                             <reference name="messageInterpreter">
>>                      <interface.java
>>               interface="org.acme.logix.MessageInterpreter"
>>
>> callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>
>>                      <binding.ws <http://binding.ws>
>>        <http://binding.ws> <http://binding.ws>
>>               <http://binding.ws>
>>
>>                                    uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>                      <callback >
>>                      <binding.ws <http://binding.ws>
>>        <http://binding.ws> <http://binding.ws>
>>               <http://binding.ws>
>>
>>                             uri="
>> http://localhost:8084/Client/MessageInterpreterCallback
>>                             <
>> http://localhost:8081/Client/MessageInterpreterCallback>" />
>>
>>                      </callback>
>>                      </reference>
>>                             <reference name="auditService">
>>                             <binding.jms
>>
>>  initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>>                      jndiURL="tcp://localhost:61616">
>>                        <destination jndiName="AuditServiceQueue" />
>>                        </binding.jms>         </reference>
>>                              </component>
>>                             <component name="MessageInterpreterComponent">
>>                          <implementation.java
>>                      class="org.acme.logix.MessageInterpreterImpl"/>
>>                              <service name="MessageInterpreter">
>>                      <interface.java
>>        interface="org.acme.logix.MessageInterpreter"
>>
>>  callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>                      <binding.ws <http://binding.ws>
>>        <http://binding.ws> <http://binding.ws>
>>               <http://binding.ws>
>>
>>                                     uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>                      <callback>
>>                      <binding.ws <http://binding.ws>
>>        <http://binding.ws> <http://binding.ws>
>>               <http://binding.ws>
>>
>>                             uri="
>> http://localhost:8084/Client/MessageInterpreterCallback
>>                             <
>> http://localhost:8081/Client/MessageInterpreterCallback>"/>
>>
>>                      </callback>
>>                      </service>
>>                         </component>
>>
>>
>>                         <component name="AuditServiceComponent">
>>                             <implementation.java
>>                      class="org.acme.logix.AuditServiceImpl"/>
>>                                     <service name="AuditService">
>>                                 <binding.jms
>>
>>  initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>>                      jndiURL="tcp://localhost:61616">
>>                        <destination jndiName="AuditServiceQueue" />
>>                      </binding.jms>         </service>
>>                         </component>
>>                         </composite>
>>
>>
>>
>>
>>
>>
>>
>>
>

Re: Callback and Tuscany 2.0 Samples

Posted by Simon Nash <na...@apache.org>.
Urso Wieske wrote:
> Hi Simon,
> 
> I have uploaded my sources as a zipped file.
> 
Hi Urso,
This problem is caused by a bug in Tuscany.  Please raise a JIRA
so that we can track and fix the problem.  In the meantime, I can
suggest a partial workaround.

The injection failure only happens if Tuscany is using the
tuscany-binding-ws-runtime-jaxws module as the runtime implementation
for <binding.ws>.  It doesn't happen if tuscany-binding-ws-runtime-axis2
is used instead of tuscany-binding-ws-runtime-jaxws.  This implies that
the problem is caused by a bug in the -jaxws version.

By default, Tuscany uses the -jaxws version.  To get Tuscany to use
the -axis2 version instead, you need to do special configuration in
the pom.xml file.

Unfortunately I couldn't find a way to make this change when using
maven-tuscany-plugin to run the application.  This is because
maven-tuscany-plugin has a dependency on tuscany-base-runtime.
The tuscany-base-runtime jar contains the -jaxws version and seems
to always use it even if the -axis2 version is declared as an
additional dependency.

I did find a way to get Tuscany to use the -axis2 version when not
using maven-tuscany-plugin.  If you replace this dependency:
   <dependency>
       <groupId>org.apache.tuscany.sca</groupId>
       <artifactId>tuscany-base-runtime</artifactId>
       <version>2.0-Beta1</version>
   </dependency>

by the following four dependencies:
   <dependency>
       <groupId>org.apache.tuscany.sca</groupId>
       <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
       <version>2.0-Beta1</version>
   </dependency>

   <dependency>
       <groupId>org.apache.tuscany.sca</groupId>
       <artifactId>tuscany-host-jetty</artifactId>
       <version>2.0-Beta1</version>
   </dependency>

   <dependency>
       <groupId>org.apache.tuscany.sca</groupId>
       <artifactId>tuscany-node-impl</artifactId>
       <version>2.0-Beta1</version>
   </dependency>

   <dependency>
       <groupId>org.apache.tuscany.sca</groupId>
       <artifactId>tuscany-implementation-java-runtime</artifactId>
       <version>2.0-Beta1</version>
   </dependency>

then the application runs successfully.  I used a maven JUnit test
to verify this.

   Simon

> Hi Simon,
> 
> I adapted my code as you suggested. It seems like the error has 
> dissappeared, but I got new ones. 
> Well I removed the setter and getter of messageInterpreterCallback from 
> MessageInterpreterImpl. Now my MessageInterpreterImpl class contains 
> only the instance variable messageInterpreterCallback . I have made it a 
> protected variable.
> 
> I get a HTTP Internal Server ( error 500).
> I am still missing something.SCA runtime is supposed "automatically" 
> inject my callback instance in the messageInterpreterCallback member 
> variable of MessageInterpreterImpl. The MessageInterpreterImpl needs to 
> have a reference to some callback instance.
> I can;t seem to solve this problem.
> 
> This is the error....
> ---------------------------------------
> SEVERE: Exception invoking injector - null
> org.oasisopen.sca.ServiceRuntimeException: Exception invoking injector - 
> null
> at 
> org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
> at 
> org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
> at 
> org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
> at 
> org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
> at 
> org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
> at 
> org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
> at 
> org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
> at 
> com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
> at 
> com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
> at 
> com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
> at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
> at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
> at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
> at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
> at 
> com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
> at 
> com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
> at 
> com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
> at 
> com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
> at 
> com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
> at 
> sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:662)
> Caused by: org.apache.tuscany.sca.core.factory.ObjectCreationException: 
> Exception invoking injector - null
> at 
> org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
> at 
> org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
> ... 27 more
> Caused by: java.lang.NullPointerException
> at 
> org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
> at 
> org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
> at 
> org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
> at 
> org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
> at 
> org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
> at 
> org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
> at 
> org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
> ... 28 more
> 10-jan-2011 1:39:26 
> com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube 
> processRequest
> SEVERE: The server sent HTTP status code 500: Internal Server Error
> com.sun.xml.internal.ws.client.ClientTransportException: The server sent 
> HTTP status code 500: Internal Server Error
> at 
> com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
> at 
> com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
> at 
> com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
> at 
> com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
> at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
> at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
> at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
> at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
> at com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
> at 
> com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
> at 
> org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
> at 
> org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
> at 
> org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
> at 
> org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
> at 
> org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
> at 
> org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
> at 
> org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
> at 
> org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
> at $Proxy50.interpret(Unknown Source)
> at 
> org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at 
> org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
> at 
> org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
> at 
> org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
> at 
> org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
> at 
> org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
> at 
> org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
> at 
> org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
> at 
> com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
> at 
> com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
> at 
> com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
> at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
> at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
> at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
> at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
> at 
> com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
> at 
> com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
> at 
> com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
> at 
> com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
> at 
> com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
> at 
> sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:662)
> -----------------------------------------
>  
> Hope you can help me. (?)
> 
> Kind Regards
> Urso
> 
> 
> 
> 
> 2011/1/14 Simon Nash <nash@apache.org <ma...@apache.org>>
> 
>     Hi Urso,
>     I'm starting to look at your project code now.
> 
>     It's important to keep these threads on the Tuscany mailing list
>     so that other members of the Tuscany community are included in
>     the discussion.  The Tuscany mailing list archives are an important
>     resource for Tuscany users who are experiencing a problem and are
>     looking to see if others have found a solution.  If a problem is
>     solved by a private message exchange instead of on the public list,
>     the knowledge of how to solve it is confined to one person instead
>     of being shared by the community.
> 
>     The best way to make this happen would be for you to resend your
>     recent private emails to the public list.  I'll look out for them
>     on the public list so that I can respond to them there.
> 
>      Simon
> 
>     Urso Wieske wrote:
> 
>         Hi Simon,
> 
>         You'll find in this email the zipped file containing my sourcecode.
> 
>         Unfortunately, I still have errors.
>         I changed the member variable from protected to private like you
>         suggested.
>         And created Getter and Setter for this member variable.
>         (messageInterpreterCallback).
>         I annotated the setter with @Callback.
>         I also removed the URI attribute from the callback/binding.ws
>         <http://binding.ws> <http://binding.ws> element of the service
>         according to your suggestion. Still problems.... :-(
> 
> 
>         I have zipped my source. It's an Eclipse project.
> 
>         I appreciate the fact that you are willing to verify this issue.
>         If you have any questions about the code, just let me know.
> 
>         Please checkout also if my POM is well specified with regard to
>         dependencies. Do I have the proper dependencies. I am using
>         Tuscany 2.0 Beta1.
> 
>         Kind Regards
>         Urso
> 
> 
>         2011/1/10 Simon Nash <nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>
> 
> 
>            Urso Wieske wrote:
> 
>                Hi Simon,
> 
>                I adapted my code as you suggested. It seems like the
>         error has
>                dissappeared, but I got new ones. Well I removed the
>         setter and
>                getter of messageInterpreterCallback from
>                MessageInterpreterImpl. Now my MessageInterpreterImpl class
>                contains only the instance variable
>         messageInterpreterCallback .
>                I have made it a protected variable.
> 
>            According to the SCA 1.1 specs, this variable should be private
>            in order to avoid having it treated as a reference.  Can you try
>            changing this and see if it makes any difference?
> 
> 
>                I get a HTTP Internal Server ( error 500).
>                I am still missing something.SCA runtime is supposed
>                "automatically" inject my callback instance in the
>                messageInterpreterCallback member variable of
>                MessageInterpreterImpl. The MessageInterpreterImpl needs
>         to have
>                a reference to some callback instance.
>                I can;t seem to solve this problem.
> 
>             >From the stack trace it seems that the thread message
>         context doesn't
>            contain the callback endpoint.  I'm not sure what could cause
>         this.
>            However I noticed a problem in your composite that would be worth
>            fixing, and it's just possible that this might be related to the
>            problem that you're seeing.
> 
>            The problem is that you have specified a callback URI for the
>            MessageInterpreter service in MessageInterpreterComponent, as
>         follows:
> 
>             <service name="MessageInterpreter">
>               <interface.java interface="org.acme.logix.MessageInterpreter"
>                  
>         callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>               <binding.ws <http://binding.ws> <http://binding.ws>
> 
>          
>          uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>               <callback>
>                 <binding.ws <http://binding.ws> <http://binding.ws>
>            uri="http://localhost:8084/Client/MessageInterpreterCallback"/>
>               </callback>
>             </service>
> 
>            There shouldn't be any callback URI in the service
>         definition, because
>            this information is provided at runtime by the client
>         invocation.  So
>            you should change the above to:
> 
>             <service name="MessageInterpreter">
>               <interface.java interface="org.acme.logix.MessageInterpreter"
>                  
>         callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>               <binding.ws <http://binding.ws> <http://binding.ws>
> 
>          
>          uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>               <callback>
>                 <binding.ws/ <http://binding.ws/> <http://binding.ws/>>
> 
>               </callback>
>             </service>
> 
>            If neither of these suggested changes fixes the problem, please
>            post the complete application as a zip file.
> 
>             Simon
> 
>                This is the error....
>                ---------------------------------------
>                SEVERE: Exception invoking injector - null
>                org.oasisopen.sca.ServiceRuntimeException: Exception invoking
>                injector - null
>                at
>              
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>                at
>              
>          org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                at
>              
>          org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                at
>              
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                at
>              
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                at
>              
>          com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                at
>              
>          com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                at
>              
>          com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                at
>              
>          com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                at
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                at
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                at
>              
>          sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                at
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                at
>         sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                at
>              
>          java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                at
>              
>          java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                at java.lang.Thread.run(Thread.java:662)
>                Caused by:
>                org.apache.tuscany.sca.core.factory.ObjectCreationException:
>                Exception invoking injector - null
>                at
>              
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>                at
>              
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>                ... 27 more
>                Caused by: java.lang.NullPointerException
>                at
>              
>          org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>                at
>              
>          org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>                at
>              
>          org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>                at
>              
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>                ... 28 more
>                10-jan-2011 1:39:26
>              
>          com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>                processRequest
>                SEVERE: The server sent HTTP status code 500: Internal
>         Server Error
>                com.sun.xml.internal.ws.client.ClientTransportException: The
>                server sent HTTP status code 500: Internal Server Error
>                at
>              
>          com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>                at
>              
>          com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                at com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>                at
>              
>          com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>                at
>              
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>                at
>              
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>                at
>              
>          org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>                at $Proxy50.interpret(Unknown Source)
>                at
>              
>          org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>         Method)
>                at
>              
>          sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>                at
>              
>          sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>                at java.lang.reflect.Method.invoke(Method.java:597)
>                at
>              
>          org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>                at
>              
>          org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>                at
>              
>          org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>                at
>              
>          org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>                at
>              
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>                at
>              
>          org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>                at
>              
>          com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>                at
>              
>          com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>                at
>              
>          com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>                at
>         com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>                at
>              
>          com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>                at
>              
>          com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>                at
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>                at
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>                at
>              
>          sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>                at
>         com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>                at
>         sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>                at
>              
>          java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>                at
>              
>          java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>                at java.lang.Thread.run(Thread.java:662)
>                -----------------------------------------
>                 Hope you can help me. (?)
> 
>                Kind Regards
>                Urso
> 
>                2011/1/9 Simon Nash <nash@apache.org
>         <ma...@apache.org> <mailto:nash@apache.org
>         <ma...@apache.org>>
>                <mailto:nash@apache.org <ma...@apache.org>
>         <mailto:nash@apache.org <ma...@apache.org>>>>
> 
> 
> 
>                   Urso Wieske wrote:
> 
>                       Hi
>                       I am evaluating Tuscany 2.0 Beta1 and am trying to
>         learn more
>                       about Callbacks (Bi-Directional interface) of SCA
>         1.1. I
>                       downloaded the Tuscany Sample files and started to
>                explore the
>                       callback implementations with webservice binding,
>         i.e. the
>                       Search and SearchCallback interfaces.
>                       It took me a while before I realized that the
>         Tuscany SCA
>                       Samples were based on SCA v1.0.   Tuscany 2.0 Beta1 is
>                based on
>                       the SCA v1.1 specs.
>                       After studying the sample sources, I have written
>         my own
>                callback.
> 
>                       Unfortunately, I kept on getting a runtime
>         exception after I
>                       installed and deployed my contribution. By the
>         way, I am
>                using
>                       Eclipse and the maven tuscany plugin.
> 
>                       I can't find the problem and hope if someone can
>         point me
>                in the
>                       right direction.
> 
>                       This is the error (printed on my console) I am
>         getting when I
>                       try to run my program:
>                       [ERROR] Failed to execute goal
>                            
>          org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>                       (default-cli) on project handler-agent: Execution
>                default-cli of
>                       goal
>                            
>          org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>                       failed: org.oasisopen.sca.ServiceRuntimeException:
>                [Composite:
>                       {http://docs.oasis-open.org/ns/opencsa/sca/200912},
>                Component:
>                       MessageInterpreterComponent] - [ASM60033] No
>         targets for
>                       reference: Composite =
>                       {http://docs.oasis-open.org/ns/opencsa/sca/200912}
>                Reference =
>                       messageInterpreterCallback -> [Help 1]
> 
>                       I suspect that I am doing something wrong in the
>                composite file.
>                       I can't imagine I did something wrong in the java
>                sources. (See
>                       below for the sources.)
> 
>                   Because the MessageInterpreterImpl class doesn't
>         contain any
>                   @Reference or
>                   @Property annotations, SCA creates implicit references for
>                all public
>                   setter methods in this class whose type is a remotable SCA
>                   interface, and
>                   also for all public or protected fields in this class
>         whose
>                type is a
>                   remotable SCA interface.
> 
>                   There is a public setter method
>                setMessageInterpreterCallback() and a
>                   protected field messageInterpreterCallback, so SCA
>         defines a
>                reference
>                   named messageInterpreterCallback.  This reference doesn't
>                have a target
>                   configured in the composite, hence the error message.
> 
>                   To fix the problem, you need to remove the setter
>         method (or
>                make it
>                   protected) and change the field from protected to private.
> 
>                    Simon
> 
> 
>                       Kind Regards,
> 
>                       Urso
> 
> 
>                       -------------------- THE SERVICE Interface With
>         Callback
>                       Interface association ----------
>                       /**
>                        *  */
>                       package org.acme.logix;
> 
>                       import org.acme.logix.message.Message;
>                       import org.oasisopen.sca.annotation.Callback;
>                       import org.oasisopen.sca.annotation.OneWay;
>                       import org.oasisopen.sca.annotation.Remotable;
> 
>                       /**
>                        *  *
>                        */
>                       @Remotable
>                       @Callback(MessageInterpreterCallback.class)
>                       public interface MessageInterpreter {
> 
>                       @OneWay
>                       void interpret(Message msg);
>                       }
> 
> 
>                       /**
>                        *  */
>                       package org.acme.logix;
> 
>                       import org.oasisopen.sca.annotation.OneWay;
>                       import org.oasisopen.sca.annotation.Remotable;
> 
>                       /**
>                        *  *
>                        */
>                       @Remotable
>                       public interface MessageInterpreterCallback {
>                       void onInterpret(Interpretation ipr);
>                       }
> 
> 
>                       ---------- THE CLIENT implementing the callback
>         interface
>                       ------------
> 
>                       /**
>                        *  */
>                       package org.acme.logix;
> 
>                       import org.acme.logix.message.Message;
>                       import org.oasisopen.sca.annotation.Reference;
> 
>                       /**
>                        *  */
>                       public class LogisticCenterImpl implements
>         LogisticCenter,
>                       MessageInterpreterCallback {
>                       private AuditService auditService;
>                       @Reference
>                       protected MessageInterpreter messageInterpreter;
> 
>                       /* (non-Javadoc)
>                       * @see
>                            
>          org.acme.logix.LogisticCenter#processMessage(org.acme.logix.message.Message)
>                       */
>                       public void processMessage(Message message) {
>                       System.out.println("Processing message with
>         payload " +
>                       message.getPayload() );
>                       auditService.logSentMessage(message);
>                       messageInterpreter.interpret(message);
>                       }
> 
>                       /**
>                       * @return the auditService
>                       */
>                       public AuditService getAuditService() {
>                       return auditService;
>                       }
> 
>                       /**
>                       * @param auditService the auditService to set
>                       */
>                       @Reference
>                       public void setAuditService(AuditService
>         auditService) {
>                       this.auditService = auditService;
>                       }
> 
>                       /**
>                       * @param messageInterpreter the messageInterpreter
>         to set
>                       */
>                       public void setMessageInterpreter(MessageInterpreter
>                       messageInterpreter) {
>                       this.messageInterpreter = messageInterpreter;
>                       }
> 
>                       /**
>                       * @return the messageInterpreter
>                       */
>                       public MessageInterpreter getMessageInterpreter() {
>                       return messageInterpreter;
>                       }
> 
> 
>                              /**
>                              *  THE CALLBACK method of
>         MessageInterpreterCallback
>                       interface
>                              */
>                       public void onInterpret(Interpretation ipr) {
>                       System.out.println("Message has been interpreted.");
>                       }
> 
>                       }
> 
> 
>                       ---------THE SERVICE WHICH IS CALLED BY THE CLIENT
>         THROUGH
>                       WEBSERVICE BINDING ---------
> 
>                       /**
>                        *  */
>                       package org.acme.logix;
> 
>                       import org.acme.logix.message.Message;
>                       import org.oasisopen.sca.RequestContext;
>                       import org.oasisopen.sca.ServiceReference;
>                       import org.oasisopen.sca.annotation.Callback;
>                       import org.oasisopen.sca.annotation.Context;
>                       import org.oasisopen.sca.annotation.Reference;
>                       import org.oasisopen.sca.annotation.Service;
> 
>                       /**
>                        *  *
>                        */
>                       public class MessageInterpreterImpl implements
>                MessageInterpreter{
> 
>                       @Callback
>                       protected MessageInterpreterCallback
>                messageInterpreterCallback;
>                       /* (non-Javadoc)
>                       * @see
>                            
>          org.acme.logix.MessageInterpreter#interpret(org.acme.logix.message.Message)
>                       */
>                       public void interpret(Message msg) {
>                       System.out.println("The message is being
>         interpreted..");
>                       Interpretation ipr = new Interpretation();
>                       messageInterpreterCallback.onInterpret(ipr);
>                       }
> 
> 
> 
>                       /**
>                       * @return the messageInterpreterCallback
>                       */
>                       public MessageInterpreterCallback
>                getMessageInterpreterCallback() {
>                       return messageInterpreterCallback;
>                       }
> 
> 
> 
>                       /**
>                       * @param messageInterpreterCallback the
>                       messageInterpreterCallback to set
>                       */
>                       public void setMessageInterpreterCallback(
>                       MessageInterpreterCallback
>         messageInterpreterCallback) {
>                       this.messageInterpreterCallback =
>         messageInterpreterCallback;
>                       }
>                       }
> 
> 
> 
> 
> 
>                       ---- THE COMPOSITE -----------
> 
> 
> 
>                       <composite
>                xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
>                                 targetNamespace="http://logistix"
>                                 xmlns:logistix="http://logistix"
>                                 name="AfnemerLogisticCenter">
> 
>                          <component name="AfnemerHandlingAgentComponent">
>                       <implementation.java
>                class="org.acme.logix.HandlingAgentImpl"/>
>                                <reference name="logisticCenter" >
>                               <binding.ws <http://binding.ws>
>         <http://binding.ws>
>                <http://binding.ws> <http://binding.ws>
> 
>                            
>          uri="http://127.0.0.1:8087/AfnemerHandlingAgentComponent"/>    
>                            </reference>         <reference
>         name="auditService"
>                       target="AuditServiceComponent"/>                
>         </component>
> 
> 
> 
>                          <component name="AfnemerLogisticCenterComponent">
>                              <implementation.java
>                       class="org.acme.logix.LogisticCenterImpl"/>
>                              <reference name="messageInterpreter">
>                       <interface.java
>                interface="org.acme.logix.MessageInterpreter"            
>                                              
>         callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
> 
>                       <binding.ws <http://binding.ws>
>         <http://binding.ws> <http://binding.ws>
>                <http://binding.ws>
> 
>                            
>          uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                       <callback >
>                       <binding.ws <http://binding.ws>
>         <http://binding.ws> <http://binding.ws>
>                <http://binding.ws>
> 
>                      
>         uri="http://localhost:8084/Client/MessageInterpreterCallback
>                      
>         <http://localhost:8081/Client/MessageInterpreterCallback>" />
> 
>                       </callback>
>                       </reference>
>                              <reference name="auditService">            
>                                <binding.jms
>                            
>          initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>                       jndiURL="tcp://localhost:61616">
>                         <destination jndiName="AuditServiceQueue" />
>                         </binding.jms>         </reference>
>                               </component>
>                              <component name="MessageInterpreterComponent">
>                           <implementation.java
>                       class="org.acme.logix.MessageInterpreterImpl"/>
>                               <service name="MessageInterpreter">
>                       <interface.java
>         interface="org.acme.logix.MessageInterpreter"
>                                                
>          callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>                       <binding.ws <http://binding.ws>
>         <http://binding.ws> <http://binding.ws>
>                <http://binding.ws>
> 
>                              
>         uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>                       <callback>
>                       <binding.ws <http://binding.ws>
>         <http://binding.ws> <http://binding.ws>
>                <http://binding.ws>
> 
>                      
>         uri="http://localhost:8084/Client/MessageInterpreterCallback
>                      
>         <http://localhost:8081/Client/MessageInterpreterCallback>"/>
> 
>                       </callback>
>                       </service>
>                          </component>
> 
> 
>                          <component name="AuditServiceComponent">
>                              <implementation.java
>                       class="org.acme.logix.AuditServiceImpl"/>
>                                      <service name="AuditService">
>                                  <binding.jms
>                            
>          initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>                       jndiURL="tcp://localhost:61616">
>                         <destination jndiName="AuditServiceQueue" />
>                       </binding.jms>         </service>
>                          </component>
>                          </composite>
> 
> 
> 
> 
> 
> 
> 


Re: Callback and Tuscany 2.0 Samples

Posted by Urso Wieske <uw...@gmail.com>.
Hi Simon,

I have uploaded my sources as a zipped file.

Hi Simon,

I adapted my code as you suggested. It seems like the error has
dissappeared, but I got new ones.
Well I removed the setter and getter of messageInterpreterCallback from
MessageInterpreterImpl. Now my MessageInterpreterImpl class contains only
the instance variable messageInterpreterCallback . I have made it a
protected variable.

I get a HTTP Internal Server ( error 500).
I am still missing something.SCA runtime is supposed "automatically" inject
my callback instance in the messageInterpreterCallback member variable of
MessageInterpreterImpl. The MessageInterpreterImpl needs to have a reference
to some callback instance.
I can;t seem to solve this problem.

This is the error....
---------------------------------------
SEVERE: Exception invoking injector - null
org.oasisopen.sca.ServiceRuntimeException: Exception invoking injector -
null
at
org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
at
org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
at
org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
at
org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
at
org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
at
org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
at
org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
at
com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
at
com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
at
com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
at
com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
at
com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
at
com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
at
com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
at
com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
at
sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.tuscany.sca.core.factory.ObjectCreationException:
Exception invoking injector - null
at
org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
at
org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
... 27 more
Caused by: java.lang.NullPointerException
at
org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
at
org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
at
org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
at
org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
at
org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
at
org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
at
org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
... 28 more
10-jan-2011 1:39:26
com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
processRequest
SEVERE: The server sent HTTP status code 500: Internal Server Error
com.sun.xml.internal.ws.client.ClientTransportException: The server sent
HTTP status code 500: Internal Server Error
at
com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
at
com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
at
com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
at
com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
at com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
at
com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
at
org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
at
org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
at
org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
at
org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
at
org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
at
org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
at
org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
at
org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
at $Proxy50.interpret(Unknown Source)
at
org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
at
org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
at
org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
at
org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
at
org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
at
org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
at
org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
at
com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
at
com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
at
com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
at
com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
at
com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
at
com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
at
com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
at
com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
at
sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
-----------------------------------------

Hope you can help me. (?)

Kind Regards
Urso




2011/1/14 Simon Nash <na...@apache.org>

> Hi Urso,
> I'm starting to look at your project code now.
>
> It's important to keep these threads on the Tuscany mailing list
> so that other members of the Tuscany community are included in
> the discussion.  The Tuscany mailing list archives are an important
> resource for Tuscany users who are experiencing a problem and are
> looking to see if others have found a solution.  If a problem is
> solved by a private message exchange instead of on the public list,
> the knowledge of how to solve it is confined to one person instead
> of being shared by the community.
>
> The best way to make this happen would be for you to resend your
> recent private emails to the public list.  I'll look out for them
> on the public list so that I can respond to them there.
>
>  Simon
>
> Urso Wieske wrote:
>
>> Hi Simon,
>>
>> You'll find in this email the zipped file containing my sourcecode.
>>
>> Unfortunately, I still have errors.
>> I changed the member variable from protected to private like you
>> suggested.
>> And created Getter and Setter for this member variable.
>> (messageInterpreterCallback).
>> I annotated the setter with @Callback.
>> I also removed the URI attribute from the callback/binding.ws <
>> http://binding.ws> element of the service according to your suggestion.
>> Still problems.... :-(
>>
>>
>> I have zipped my source. It's an Eclipse project.
>>
>> I appreciate the fact that you are willing to verify this issue.
>> If you have any questions about the code, just let me know.
>>
>> Please checkout also if my POM is well specified with regard to
>> dependencies. Do I have the proper dependencies. I am using Tuscany 2.0
>> Beta1.
>>
>> Kind Regards
>> Urso
>>
>>
>> 2011/1/10 Simon Nash <nash@apache.org <ma...@apache.org>>
>>
>>
>>    Urso Wieske wrote:
>>
>>        Hi Simon,
>>
>>        I adapted my code as you suggested. It seems like the error has
>>        dissappeared, but I got new ones. Well I removed the setter and
>>        getter of messageInterpreterCallback from
>>        MessageInterpreterImpl. Now my MessageInterpreterImpl class
>>        contains only the instance variable messageInterpreterCallback .
>>        I have made it a protected variable.
>>
>>    According to the SCA 1.1 specs, this variable should be private
>>    in order to avoid having it treated as a reference.  Can you try
>>    changing this and see if it makes any difference?
>>
>>
>>        I get a HTTP Internal Server ( error 500).
>>        I am still missing something.SCA runtime is supposed
>>        "automatically" inject my callback instance in the
>>        messageInterpreterCallback member variable of
>>        MessageInterpreterImpl. The MessageInterpreterImpl needs to have
>>        a reference to some callback instance.
>>        I can;t seem to solve this problem.
>>
>>     >From the stack trace it seems that the thread message context doesn't
>>    contain the callback endpoint.  I'm not sure what could cause this.
>>    However I noticed a problem in your composite that would be worth
>>    fixing, and it's just possible that this might be related to the
>>    problem that you're seeing.
>>
>>    The problem is that you have specified a callback URI for the
>>    MessageInterpreter service in MessageInterpreterComponent, as follows:
>>
>>     <service name="MessageInterpreter">
>>       <interface.java interface="org.acme.logix.MessageInterpreter"
>>           callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>       <binding.ws <http://binding.ws>
>>
>>    uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>       <callback>
>>         <binding.ws <http://binding.ws>
>>    uri="http://localhost:8084/Client/MessageInterpreterCallback"/>
>>       </callback>
>>     </service>
>>
>>    There shouldn't be any callback URI in the service definition, because
>>    this information is provided at runtime by the client invocation.  So
>>    you should change the above to:
>>
>>     <service name="MessageInterpreter">
>>       <interface.java interface="org.acme.logix.MessageInterpreter"
>>           callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>       <binding.ws <http://binding.ws>
>>
>>    uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>       <callback>
>>         <binding.ws/ <http://binding.ws/>>
>>
>>       </callback>
>>     </service>
>>
>>    If neither of these suggested changes fixes the problem, please
>>    post the complete application as a zip file.
>>
>>     Simon
>>
>>        This is the error....
>>        ---------------------------------------
>>        SEVERE: Exception invoking injector - null
>>        org.oasisopen.sca.ServiceRuntimeException: Exception invoking
>>        injector - null
>>        at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
>>        at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>        at
>>
>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>        at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>        at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>        at
>>
>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>        at
>>
>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>        at
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>        at
>>
>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>        at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>        at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>        at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>        at
>>
>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>        at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>        at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>        at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>        at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>        at java.lang.Thread.run(Thread.java:662)
>>        Caused by:
>>        org.apache.tuscany.sca.core.factory.ObjectCreationException:
>>        Exception invoking injector - null
>>        at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
>>        at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
>>        ... 27 more
>>        Caused by: java.lang.NullPointerException
>>        at
>>
>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
>>        at
>>
>>  org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
>>        at
>>
>>  org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
>>        at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
>>        ... 28 more
>>        10-jan-2011 1:39:26
>>        com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
>>        processRequest
>>        SEVERE: The server sent HTTP status code 500: Internal Server Error
>>        com.sun.xml.internal.ws.client.ClientTransportException: The
>>        server sent HTTP status code 500: Internal Server Error
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>        at com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
>>        at
>>
>>  com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
>>        at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
>>        at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
>>        at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
>>        at $Proxy50.interpret(Unknown Source)
>>        at
>>
>>  org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at
>>
>>  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>        at
>>
>>  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>        at java.lang.reflect.Method.invoke(Method.java:597)
>>        at
>>
>>  org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
>>        at
>>
>>  org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>>        at
>>
>>  org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>>        at
>>
>>  org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
>>        at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
>>        at
>>
>>  org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
>>        at
>>
>>  com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
>>        at
>>
>>  com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
>>        at
>>
>>  com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
>>        at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
>>        at
>>
>>  com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
>>        at
>>
>>  com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
>>        at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>        at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
>>        at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
>>        at
>>
>>  sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
>>        at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
>>        at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
>>        at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>        at
>>
>>  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>        at java.lang.Thread.run(Thread.java:662)
>>        -----------------------------------------
>>         Hope you can help me. (?)
>>
>>        Kind Regards
>>        Urso
>>
>>        2011/1/9 Simon Nash <nash@apache.org <ma...@apache.org>
>>        <mailto:nash@apache.org <ma...@apache.org>>>
>>
>>
>>
>>           Urso Wieske wrote:
>>
>>               Hi
>>               I am evaluating Tuscany 2.0 Beta1 and am trying to learn
>> more
>>               about Callbacks (Bi-Directional interface) of SCA 1.1. I
>>               downloaded the Tuscany Sample files and started to
>>        explore the
>>               callback implementations with webservice binding, i.e. the
>>               Search and SearchCallback interfaces.
>>               It took me a while before I realized that the Tuscany SCA
>>               Samples were based on SCA v1.0.   Tuscany 2.0 Beta1 is
>>        based on
>>               the SCA v1.1 specs.
>>               After studying the sample sources, I have written my own
>>        callback.
>>
>>               Unfortunately, I kept on getting a runtime exception after I
>>               installed and deployed my contribution. By the way, I am
>>        using
>>               Eclipse and the maven tuscany plugin.
>>
>>               I can't find the problem and hope if someone can point me
>>        in the
>>               right direction.
>>
>>               This is the error (printed on my console) I am getting when
>> I
>>               try to run my program:
>>               [ERROR] Failed to execute goal
>>
>>  org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>>               (default-cli) on project handler-agent: Execution
>>        default-cli of
>>               goal
>>
>>  org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>>               failed: org.oasisopen.sca.ServiceRuntimeException:
>>        [Composite:
>>               {http://docs.oasis-open.org/ns/opencsa/sca/200912},
>>        Component:
>>               MessageInterpreterComponent] - [ASM60033] No targets for
>>               reference: Composite =
>>               {http://docs.oasis-open.org/ns/opencsa/sca/200912}
>>        Reference =
>>               messageInterpreterCallback -> [Help 1]
>>
>>               I suspect that I am doing something wrong in the
>>        composite file.
>>               I can't imagine I did something wrong in the java
>>        sources. (See
>>               below for the sources.)
>>
>>           Because the MessageInterpreterImpl class doesn't contain any
>>           @Reference or
>>           @Property annotations, SCA creates implicit references for
>>        all public
>>           setter methods in this class whose type is a remotable SCA
>>           interface, and
>>           also for all public or protected fields in this class whose
>>        type is a
>>           remotable SCA interface.
>>
>>           There is a public setter method
>>        setMessageInterpreterCallback() and a
>>           protected field messageInterpreterCallback, so SCA defines a
>>        reference
>>           named messageInterpreterCallback.  This reference doesn't
>>        have a target
>>           configured in the composite, hence the error message.
>>
>>           To fix the problem, you need to remove the setter method (or
>>        make it
>>           protected) and change the field from protected to private.
>>
>>            Simon
>>
>>
>>               Kind Regards,
>>
>>               Urso
>>
>>
>>               -------------------- THE SERVICE Interface With Callback
>>               Interface association ----------
>>               /**
>>                *  */
>>               package org.acme.logix;
>>
>>               import org.acme.logix.message.Message;
>>               import org.oasisopen.sca.annotation.Callback;
>>               import org.oasisopen.sca.annotation.OneWay;
>>               import org.oasisopen.sca.annotation.Remotable;
>>
>>               /**
>>                *  *
>>                */
>>               @Remotable
>>               @Callback(MessageInterpreterCallback.class)
>>               public interface MessageInterpreter {
>>
>>               @OneWay
>>               void interpret(Message msg);
>>               }
>>
>>
>>               /**
>>                *  */
>>               package org.acme.logix;
>>
>>               import org.oasisopen.sca.annotation.OneWay;
>>               import org.oasisopen.sca.annotation.Remotable;
>>
>>               /**
>>                *  *
>>                */
>>               @Remotable
>>               public interface MessageInterpreterCallback {
>>               void onInterpret(Interpretation ipr);
>>               }
>>
>>
>>               ---------- THE CLIENT implementing the callback interface
>>               ------------
>>
>>               /**
>>                *  */
>>               package org.acme.logix;
>>
>>               import org.acme.logix.message.Message;
>>               import org.oasisopen.sca.annotation.Reference;
>>
>>               /**
>>                *  */
>>               public class LogisticCenterImpl implements LogisticCenter,
>>               MessageInterpreterCallback {
>>               private AuditService auditService;
>>               @Reference
>>               protected MessageInterpreter messageInterpreter;
>>
>>               /* (non-Javadoc)
>>               * @see
>>
>>  org.acme.logix.LogisticCenter#processMessage(org.acme.logix.message.Message)
>>               */
>>               public void processMessage(Message message) {
>>               System.out.println("Processing message with payload " +
>>               message.getPayload() );
>>               auditService.logSentMessage(message);
>>               messageInterpreter.interpret(message);
>>               }
>>
>>               /**
>>               * @return the auditService
>>               */
>>               public AuditService getAuditService() {
>>               return auditService;
>>               }
>>
>>               /**
>>               * @param auditService the auditService to set
>>               */
>>               @Reference
>>               public void setAuditService(AuditService auditService) {
>>               this.auditService = auditService;
>>               }
>>
>>               /**
>>               * @param messageInterpreter the messageInterpreter to set
>>               */
>>               public void setMessageInterpreter(MessageInterpreter
>>               messageInterpreter) {
>>               this.messageInterpreter = messageInterpreter;
>>               }
>>
>>               /**
>>               * @return the messageInterpreter
>>               */
>>               public MessageInterpreter getMessageInterpreter() {
>>               return messageInterpreter;
>>               }
>>
>>
>>                      /**
>>                      *  THE CALLBACK method of MessageInterpreterCallback
>>               interface
>>                      */
>>               public void onInterpret(Interpretation ipr) {
>>               System.out.println("Message has been interpreted.");
>>               }
>>
>>               }
>>
>>
>>               ---------THE SERVICE WHICH IS CALLED BY THE CLIENT THROUGH
>>               WEBSERVICE BINDING ---------
>>
>>               /**
>>                *  */
>>               package org.acme.logix;
>>
>>               import org.acme.logix.message.Message;
>>               import org.oasisopen.sca.RequestContext;
>>               import org.oasisopen.sca.ServiceReference;
>>               import org.oasisopen.sca.annotation.Callback;
>>               import org.oasisopen.sca.annotation.Context;
>>               import org.oasisopen.sca.annotation.Reference;
>>               import org.oasisopen.sca.annotation.Service;
>>
>>               /**
>>                *  *
>>                */
>>               public class MessageInterpreterImpl implements
>>        MessageInterpreter{
>>
>>               @Callback
>>               protected MessageInterpreterCallback
>>        messageInterpreterCallback;
>>               /* (non-Javadoc)
>>               * @see
>>
>>  org.acme.logix.MessageInterpreter#interpret(org.acme.logix.message.Message)
>>               */
>>               public void interpret(Message msg) {
>>               System.out.println("The message is being interpreted..");
>>               Interpretation ipr = new Interpretation();
>>               messageInterpreterCallback.onInterpret(ipr);
>>               }
>>
>>
>>
>>               /**
>>               * @return the messageInterpreterCallback
>>               */
>>               public MessageInterpreterCallback
>>        getMessageInterpreterCallback() {
>>               return messageInterpreterCallback;
>>               }
>>
>>
>>
>>               /**
>>               * @param messageInterpreterCallback the
>>               messageInterpreterCallback to set
>>               */
>>               public void setMessageInterpreterCallback(
>>               MessageInterpreterCallback messageInterpreterCallback) {
>>               this.messageInterpreterCallback =
>> messageInterpreterCallback;
>>               }
>>               }
>>
>>
>>
>>
>>
>>               ---- THE COMPOSITE -----------
>>
>>
>>
>>               <composite
>>        xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
>>                         targetNamespace="http://logistix"
>>                         xmlns:logistix="http://logistix"
>>                         name="AfnemerLogisticCenter">
>>
>>                  <component name="AfnemerHandlingAgentComponent">
>>               <implementation.java
>>        class="org.acme.logix.HandlingAgentImpl"/>
>>                        <reference name="logisticCenter" >
>>                       <binding.ws <http://binding.ws>
>>        <http://binding.ws> <http://binding.ws>
>>
>>                      uri="
>> http://127.0.0.1:8087/AfnemerHandlingAgentComponent"/>
>>      </reference>         <reference name="auditService"
>>               target="AuditServiceComponent"/>
>> </component>
>>
>>
>>
>>                  <component name="AfnemerLogisticCenterComponent">
>>                      <implementation.java
>>               class="org.acme.logix.LogisticCenterImpl"/>
>>                      <reference name="messageInterpreter">
>>               <interface.java
>>        interface="org.acme.logix.MessageInterpreter"
>>
>> callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>
>>               <binding.ws <http://binding.ws> <http://binding.ws>
>>        <http://binding.ws>
>>
>>                      uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>               <callback >
>>               <binding.ws <http://binding.ws> <http://binding.ws>
>>        <http://binding.ws>
>>
>>               uri="
>> http://localhost:8084/Client/MessageInterpreterCallback
>>               <http://localhost:8081/Client/MessageInterpreterCallback>"
>> />
>>
>>               </callback>
>>               </reference>
>>                      <reference name="auditService">
>>              <binding.jms
>>
>>  initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>>               jndiURL="tcp://localhost:61616">
>>                 <destination jndiName="AuditServiceQueue" />
>>                 </binding.jms>         </reference>
>>                       </component>
>>                      <component name="MessageInterpreterComponent">
>>                   <implementation.java
>>               class="org.acme.logix.MessageInterpreterImpl"/>
>>                       <service name="MessageInterpreter">
>>               <interface.java
>> interface="org.acme.logix.MessageInterpreter"
>>
>>  callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>               <binding.ws <http://binding.ws> <http://binding.ws>
>>        <http://binding.ws>
>>
>>                       uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>>               <callback>
>>               <binding.ws <http://binding.ws> <http://binding.ws>
>>        <http://binding.ws>
>>
>>               uri="
>> http://localhost:8084/Client/MessageInterpreterCallback
>>               <http://localhost:8081/Client/MessageInterpreterCallback
>> >"/>
>>
>>               </callback>
>>               </service>
>>                  </component>
>>
>>
>>                  <component name="AuditServiceComponent">
>>                      <implementation.java
>>               class="org.acme.logix.AuditServiceImpl"/>
>>                              <service name="AuditService">
>>                          <binding.jms
>>
>>  initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>>               jndiURL="tcp://localhost:61616">
>>                 <destination jndiName="AuditServiceQueue" />
>>               </binding.jms>         </service>
>>                  </component>
>>                  </composite>
>>
>>
>>
>>
>>
>>
>

Re: Callback and Tuscany 2.0 Samples

Posted by Simon Nash <na...@apache.org>.
Urso Wieske wrote:
> Hi Simon,
> 
> I adapted my code as you suggested. It seems like the error has 
> dissappeared, but I got new ones. 
> Well I removed the setter and getter of messageInterpreterCallback from 
> MessageInterpreterImpl. Now my MessageInterpreterImpl class contains 
> only the instance variable messageInterpreterCallback . I have made it a 
> protected variable.
> 
According to the SCA 1.1 specs, this variable should be private
in order to avoid having it treated as a reference.  Can you try
changing this and see if it makes any difference?

> I get a HTTP Internal Server ( error 500).
> I am still missing something.SCA runtime is supposed "automatically" 
> inject my callback instance in the messageInterpreterCallback member 
> variable of MessageInterpreterImpl. The MessageInterpreterImpl needs to 
> have a reference to some callback instance.
> I can;t seem to solve this problem.
> 
 From the stack trace it seems that the thread message context doesn't
contain the callback endpoint.  I'm not sure what could cause this.
However I noticed a problem in your composite that would be worth
fixing, and it's just possible that this might be related to the
problem that you're seeing.

The problem is that you have specified a callback URI for the
MessageInterpreter service in MessageInterpreterComponent, as follows:
   <service name="MessageInterpreter">
     <interface.java interface="org.acme.logix.MessageInterpreter"
         callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
     <binding.ws uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
     <callback>
       <binding.ws uri="http://localhost:8084/Client/MessageInterpreterCallback"/>
     </callback>
   </service>

There shouldn't be any callback URI in the service definition, because
this information is provided at runtime by the client invocation.  So
you should change the above to:
   <service name="MessageInterpreter">
     <interface.java interface="org.acme.logix.MessageInterpreter"
         callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
     <binding.ws uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
     <callback>
       <binding.ws/>
     </callback>
   </service>

If neither of these suggested changes fixes the problem, please
post the complete application as a zip file.

   Simon

> This is the error....
> ---------------------------------------
> SEVERE: Exception invoking injector - null
> org.oasisopen.sca.ServiceRuntimeException: Exception invoking injector - 
> null
> at 
> org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
> at 
> org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
> at 
> org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
> at 
> org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
> at 
> org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
> at 
> org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
> at 
> org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
> at 
> com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
> at 
> com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
> at 
> com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
> at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
> at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
> at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
> at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
> at 
> com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
> at 
> com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
> at 
> com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
> at 
> com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
> at 
> com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
> at 
> sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:662)
> Caused by: org.apache.tuscany.sca.core.factory.ObjectCreationException: 
> Exception invoking injector - null
> at 
> org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
> at 
> org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
> ... 27 more
> Caused by: java.lang.NullPointerException
> at 
> org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
> at 
> org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
> at 
> org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
> at 
> org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
> at 
> org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
> at 
> org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
> at 
> org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
> ... 28 more
> 10-jan-2011 1:39:26 
> com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube 
> processRequest
> SEVERE: The server sent HTTP status code 500: Internal Server Error
> com.sun.xml.internal.ws.client.ClientTransportException: The server sent 
> HTTP status code 500: Internal Server Error
> at 
> com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
> at 
> com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
> at 
> com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
> at 
> com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
> at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
> at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
> at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
> at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
> at com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
> at 
> com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
> at 
> org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
> at 
> org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
> at 
> org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
> at 
> org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
> at 
> org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
> at 
> org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
> at 
> org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
> at 
> org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
> at $Proxy50.interpret(Unknown Source)
> at 
> org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at 
> org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
> at 
> org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
> at 
> org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
> at 
> org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
> at 
> org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
> at 
> org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
> at 
> org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
> at 
> com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
> at 
> com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
> at 
> com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
> at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
> at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
> at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
> at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
> at 
> com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
> at 
> com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
> at 
> com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
> at 
> com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
> at 
> com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
> at 
> sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:662)
> -----------------------------------------
>  
> Hope you can help me. (?)
> 
> Kind Regards
> Urso
> 
> 2011/1/9 Simon Nash <nash@apache.org <ma...@apache.org>>
> 
>     Urso Wieske wrote:
> 
>         Hi
>         I am evaluating Tuscany 2.0 Beta1 and am trying to learn more
>         about Callbacks (Bi-Directional interface) of SCA 1.1. I
>         downloaded the Tuscany Sample files and started to explore the
>         callback implementations with webservice binding, i.e. the
>         Search and SearchCallback interfaces.
>         It took me a while before I realized that the Tuscany SCA
>         Samples were based on SCA v1.0.   Tuscany 2.0 Beta1 is based on
>         the SCA v1.1 specs.
>         After studying the sample sources, I have written my own callback.
> 
>         Unfortunately, I kept on getting a runtime exception after I
>         installed and deployed my contribution. By the way, I am using
>         Eclipse and the maven tuscany plugin.
> 
>         I can't find the problem and hope if someone can point me in the
>         right direction.
> 
>         This is the error (printed on my console) I am getting when I
>         try to run my program:
>         [ERROR] Failed to execute goal
>         org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>         (default-cli) on project handler-agent: Execution default-cli of
>         goal
>         org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>         failed: org.oasisopen.sca.ServiceRuntimeException: [Composite:
>         {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component:
>         MessageInterpreterComponent] - [ASM60033] No targets for
>         reference: Composite =
>         {http://docs.oasis-open.org/ns/opencsa/sca/200912} Reference =
>         messageInterpreterCallback -> [Help 1]
> 
>         I suspect that I am doing something wrong in the composite file.
>         I can't imagine I did something wrong in the java sources. (See
>         below for the sources.)
> 
>     Because the MessageInterpreterImpl class doesn't contain any
>     @Reference or
>     @Property annotations, SCA creates implicit references for all public
>     setter methods in this class whose type is a remotable SCA
>     interface, and
>     also for all public or protected fields in this class whose type is a
>     remotable SCA interface.
> 
>     There is a public setter method setMessageInterpreterCallback() and a
>     protected field messageInterpreterCallback, so SCA defines a reference
>     named messageInterpreterCallback.  This reference doesn't have a target
>     configured in the composite, hence the error message.
> 
>     To fix the problem, you need to remove the setter method (or make it
>     protected) and change the field from protected to private.
> 
>      Simon
> 
> 
>         Kind Regards,
> 
>         Urso
> 
> 
>         -------------------- THE SERVICE Interface With Callback
>         Interface association ----------
>         /**
>          *  */
>         package org.acme.logix;
> 
>         import org.acme.logix.message.Message;
>         import org.oasisopen.sca.annotation.Callback;
>         import org.oasisopen.sca.annotation.OneWay;
>         import org.oasisopen.sca.annotation.Remotable;
> 
>         /**
>          *  *
>          */
>         @Remotable
>         @Callback(MessageInterpreterCallback.class)
>         public interface MessageInterpreter {
> 
>         @OneWay
>         void interpret(Message msg);
>         }
> 
> 
>         /**
>          *  */
>         package org.acme.logix;
> 
>         import org.oasisopen.sca.annotation.OneWay;
>         import org.oasisopen.sca.annotation.Remotable;
> 
>         /**
>          *  *
>          */
>         @Remotable
>         public interface MessageInterpreterCallback {
>         void onInterpret(Interpretation ipr);
>         }
> 
> 
>         ---------- THE CLIENT implementing the callback interface
>         ------------
> 
>         /**
>          *  */
>         package org.acme.logix;
> 
>         import org.acme.logix.message.Message;
>         import org.oasisopen.sca.annotation.Reference;
> 
>         /**
>          *  */
>         public class LogisticCenterImpl implements LogisticCenter,
>         MessageInterpreterCallback {
>         private AuditService auditService;
>         @Reference
>         protected MessageInterpreter messageInterpreter;
> 
>         /* (non-Javadoc)
>         * @see
>         org.acme.logix.LogisticCenter#processMessage(org.acme.logix.message.Message)
>         */
>         public void processMessage(Message message) {
>         System.out.println("Processing message with payload " +
>         message.getPayload() );
>         auditService.logSentMessage(message);
>         messageInterpreter.interpret(message);
>         }
> 
>         /**
>         * @return the auditService
>         */
>         public AuditService getAuditService() {
>         return auditService;
>         }
> 
>         /**
>         * @param auditService the auditService to set
>         */
>         @Reference
>         public void setAuditService(AuditService auditService) {
>         this.auditService = auditService;
>         }
> 
>         /**
>         * @param messageInterpreter the messageInterpreter to set
>         */
>         public void setMessageInterpreter(MessageInterpreter
>         messageInterpreter) {
>         this.messageInterpreter = messageInterpreter;
>         }
> 
>         /**
>         * @return the messageInterpreter
>         */
>         public MessageInterpreter getMessageInterpreter() {
>         return messageInterpreter;
>         }
> 
> 
>                /**
>                *  THE CALLBACK method of MessageInterpreterCallback
>         interface
>                */
>         public void onInterpret(Interpretation ipr) {
>         System.out.println("Message has been interpreted.");
>         }
> 
>         }
> 
> 
>         ---------THE SERVICE WHICH IS CALLED BY THE CLIENT THROUGH
>         WEBSERVICE BINDING ---------
> 
>         /**
>          *  */
>         package org.acme.logix;
> 
>         import org.acme.logix.message.Message;
>         import org.oasisopen.sca.RequestContext;
>         import org.oasisopen.sca.ServiceReference;
>         import org.oasisopen.sca.annotation.Callback;
>         import org.oasisopen.sca.annotation.Context;
>         import org.oasisopen.sca.annotation.Reference;
>         import org.oasisopen.sca.annotation.Service;
> 
>         /**
>          *  *
>          */
>         public class MessageInterpreterImpl implements MessageInterpreter{
> 
>         @Callback
>         protected MessageInterpreterCallback messageInterpreterCallback;
>         /* (non-Javadoc)
>         * @see
>         org.acme.logix.MessageInterpreter#interpret(org.acme.logix.message.Message)
>         */
>         public void interpret(Message msg) {
>         System.out.println("The message is being interpreted..");
>         Interpretation ipr = new Interpretation();
>         messageInterpreterCallback.onInterpret(ipr);
>         }
> 
> 
> 
>         /**
>         * @return the messageInterpreterCallback
>         */
>         public MessageInterpreterCallback getMessageInterpreterCallback() {
>         return messageInterpreterCallback;
>         }
> 
> 
> 
>         /**
>         * @param messageInterpreterCallback the
>         messageInterpreterCallback to set
>         */
>         public void setMessageInterpreterCallback(
>         MessageInterpreterCallback messageInterpreterCallback) {
>         this.messageInterpreterCallback = messageInterpreterCallback;
>         }
>         }
> 
> 
> 
> 
> 
>         ---- THE COMPOSITE -----------
> 
> 
> 
>         <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
>                   targetNamespace="http://logistix"
>                   xmlns:logistix="http://logistix"
>                   name="AfnemerLogisticCenter">
> 
>            <component name="AfnemerHandlingAgentComponent">
>         <implementation.java class="org.acme.logix.HandlingAgentImpl"/>
>                  <reference name="logisticCenter" >
>                 <binding.ws <http://binding.ws> <http://binding.ws>
>         uri="http://127.0.0.1:8087/AfnemerHandlingAgentComponent"/>    
>              </reference>         <reference name="auditService"
>         target="AuditServiceComponent"/>                 </component>
> 
> 
> 
>            <component name="AfnemerLogisticCenterComponent">
>                <implementation.java
>         class="org.acme.logix.LogisticCenterImpl"/>
>                <reference name="messageInterpreter">
>         <interface.java interface="org.acme.logix.MessageInterpreter"  
>                            
>         callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
> 
>         <binding.ws <http://binding.ws> <http://binding.ws>
>         uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>         <callback >
>         <binding.ws <http://binding.ws> <http://binding.ws>
>         uri="http://localhost:8084/Client/MessageInterpreterCallback
>         <http://localhost:8081/Client/MessageInterpreterCallback>" />
> 
>         </callback>
>         </reference>
>                <reference name="auditService">                    
>          <binding.jms
>         initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>         jndiURL="tcp://localhost:61616">
>           <destination jndiName="AuditServiceQueue" />
>           </binding.jms>         </reference>
>                 </component>
>                <component name="MessageInterpreterComponent">
>             <implementation.java
>         class="org.acme.logix.MessageInterpreterImpl"/>
>                 <service name="MessageInterpreter">
>         <interface.java interface="org.acme.logix.MessageInterpreter"
>                    
>          callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>         <binding.ws <http://binding.ws> <http://binding.ws>
>          uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>         <callback>
>         <binding.ws <http://binding.ws> <http://binding.ws>
>         uri="http://localhost:8084/Client/MessageInterpreterCallback
>         <http://localhost:8081/Client/MessageInterpreterCallback>"/>
> 
>         </callback>
>         </service>
>            </component>
> 
> 
>            <component name="AuditServiceComponent">
>                <implementation.java
>         class="org.acme.logix.AuditServiceImpl"/>
>                        <service name="AuditService">
>                    <binding.jms
>         initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>         jndiURL="tcp://localhost:61616">
>           <destination jndiName="AuditServiceQueue" />
>         </binding.jms>         </service>
>            </component>
>            </composite>
> 
> 
> 


Re: Callback and Tuscany 2.0 Samples

Posted by Urso Wieske <uw...@gmail.com>.
Hi Simon,

I adapted my code as you suggested. It seems like the error has
dissappeared, but I got new ones.
Well I removed the setter and getter of messageInterpreterCallback from
MessageInterpreterImpl. Now my MessageInterpreterImpl class contains only
the instance variable messageInterpreterCallback . I have made it a
protected variable.

I get a HTTP Internal Server ( error 500).
I am still missing something.SCA runtime is supposed "automatically" inject
my callback instance in the messageInterpreterCallback member variable of
MessageInterpreterImpl. The MessageInterpreterImpl needs to have a reference
to some callback instance.
I can;t seem to solve this problem.

This is the error....
---------------------------------------
SEVERE: Exception invoking injector - null
org.oasisopen.sca.ServiceRuntimeException: Exception invoking injector -
null
at
org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:208)
at
org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
at
org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
at
org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
at
org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
at
org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
at
org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
at
com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
at
com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
at
com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
at
com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
at
com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
at
com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
at
com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
at
com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
at
sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.tuscany.sca.core.factory.ObjectCreationException:
Exception invoking injector - null
at
org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:235)
at
org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:106)
... 27 more
Caused by: java.lang.NullPointerException
at
org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.init(CallbackServiceReferenceImpl.java:64)
at
org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl.<init>(CallbackServiceReferenceImpl.java:47)
at
org.apache.tuscany.sca.core.invocation.impl.JDKProxyFactory.createCallbackProxy(JDKProxyFactory.java:137)
at
org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory.createCallbackProxy(ExtensibleProxyFactory.java:76)
at
org.apache.tuscany.sca.core.invocation.CallbackWireObjectFactory.getInstance(CallbackWireObjectFactory.java:45)
at
org.apache.tuscany.sca.implementation.java.injection.MethodInjector.inject(MethodInjector.java:55)
at
org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.injectCallbacks(JavaImplementationInvoker.java:230)
... 28 more
10-jan-2011 1:39:26
com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube
processRequest
SEVERE: The server sent HTTP status code 500: Internal Server Error
com.sun.xml.internal.ws.client.ClientTransportException: The server sent
HTTP status code 500: Internal Server Error
at
com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCodeOneway(HttpTransportPipe.java:207)
at
com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:164)
at
com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
at
com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
at com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
at
com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invokeOneWay(DispatchImpl.java:204)
at
org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invokeTarget(JAXWSBindingInvoker.java:224)
at
org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker.invoke(JAXWSBindingInvoker.java:149)
at
org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
at
org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:298)
at
org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:254)
at
org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:114)
at
org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.doInvokeSync(AsyncJDKInvocationHandler.java:238)
at
org.apache.tuscany.sca.core.invocation.impl.AsyncJDKInvocationHandler.invoke(AsyncJDKInvocationHandler.java:160)
at $Proxy50.interpret(Unknown Source)
at
org.acme.logix.LogisticCenterImpl.processMessage(LogisticCenterImpl.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:158)
at
org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:86)
at
org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
at
org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
at
org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:286)
at
org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:207)
at
org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider.invoke(JAXWSBindingProvider.java:61)
at
com.sun.xml.internal.ws.api.server.InstanceResolver$1.invokeProvider(InstanceResolver.java:245)
at
com.sun.xml.internal.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:145)
at
com.sun.xml.internal.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:67)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
at
com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:232)
at
com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:460)
at
com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:233)
at
com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:95)
at
com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:80)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
at
sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
-----------------------------------------

Hope you can help me. (?)

Kind Regards
Urso

2011/1/9 Simon Nash <na...@apache.org>

> Urso Wieske wrote:
>
>> Hi
>> I am evaluating Tuscany 2.0 Beta1 and am trying to learn more about
>> Callbacks (Bi-Directional interface) of SCA 1.1. I downloaded the Tuscany
>> Sample files and started to explore the callback implementations with
>> webservice binding, i.e. the Search and SearchCallback interfaces.
>> It took me a while before I realized that the Tuscany SCA Samples were
>> based on SCA v1.0.   Tuscany 2.0 Beta1 is based on the SCA v1.1 specs.
>> After studying the sample sources, I have written my own callback.
>>
>> Unfortunately, I kept on getting a runtime exception after I installed and
>> deployed my contribution. By the way, I am using Eclipse and the maven
>> tuscany plugin.
>>
>> I can't find the problem and hope if someone can point me in the right
>> direction.
>>
>> This is the error (printed on my console) I am getting when I try to run
>> my program:
>> [ERROR] Failed to execute goal
>> org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run
>> (default-cli) on project handler-agent: Execution default-cli of goal
>> org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run failed:
>> org.oasisopen.sca.ServiceRuntimeException: [Composite: {
>> http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component:
>> MessageInterpreterComponent] - [ASM60033] No targets for reference:
>> Composite = {http://docs.oasis-open.org/ns/opencsa/sca/200912} Reference
>> = messageInterpreterCallback -> [Help 1]
>>
>> I suspect that I am doing something wrong in the composite file. I can't
>> imagine I did something wrong in the java sources. (See below for the
>> sources.)
>>
> Because the MessageInterpreterImpl class doesn't contain any @Reference or
> @Property annotations, SCA creates implicit references for all public
> setter methods in this class whose type is a remotable SCA interface, and
> also for all public or protected fields in this class whose type is a
> remotable SCA interface.
>
> There is a public setter method setMessageInterpreterCallback() and a
> protected field messageInterpreterCallback, so SCA defines a reference
> named messageInterpreterCallback.  This reference doesn't have a target
> configured in the composite, hence the error message.
>
> To fix the problem, you need to remove the setter method (or make it
> protected) and change the field from protected to private.
>
>  Simon
>
>
>> Kind Regards,
>>
>> Urso
>>
>>
>> -------------------- THE SERVICE Interface With Callback Interface
>> association ----------
>> /**
>>  *  */
>> package org.acme.logix;
>>
>> import org.acme.logix.message.Message;
>> import org.oasisopen.sca.annotation.Callback;
>> import org.oasisopen.sca.annotation.OneWay;
>> import org.oasisopen.sca.annotation.Remotable;
>>
>> /**
>>  *  *
>>  */
>> @Remotable
>> @Callback(MessageInterpreterCallback.class)
>> public interface MessageInterpreter {
>>
>> @OneWay
>> void interpret(Message msg);
>> }
>>
>>
>> /**
>>  *  */
>> package org.acme.logix;
>>
>> import org.oasisopen.sca.annotation.OneWay;
>> import org.oasisopen.sca.annotation.Remotable;
>>
>> /**
>>  *  *
>>  */
>> @Remotable
>> public interface MessageInterpreterCallback {
>> void onInterpret(Interpretation ipr);
>> }
>>
>>
>> ---------- THE CLIENT implementing the callback interface ------------
>>
>> /**
>>  *  */
>> package org.acme.logix;
>>
>> import org.acme.logix.message.Message;
>> import org.oasisopen.sca.annotation.Reference;
>>
>> /**
>>  *  */
>> public class LogisticCenterImpl implements LogisticCenter,
>> MessageInterpreterCallback {
>> private AuditService auditService;
>> @Reference
>> protected MessageInterpreter messageInterpreter;
>>
>> /* (non-Javadoc)
>> * @see
>> org.acme.logix.LogisticCenter#processMessage(org.acme.logix.message.Message)
>> */
>> public void processMessage(Message message) {
>> System.out.println("Processing message with payload " +
>> message.getPayload() );
>> auditService.logSentMessage(message);
>> messageInterpreter.interpret(message);
>> }
>>
>> /**
>> * @return the auditService
>> */
>> public AuditService getAuditService() {
>> return auditService;
>> }
>>
>> /**
>> * @param auditService the auditService to set
>> */
>> @Reference
>> public void setAuditService(AuditService auditService) {
>> this.auditService = auditService;
>> }
>>
>> /**
>> * @param messageInterpreter the messageInterpreter to set
>> */
>> public void setMessageInterpreter(MessageInterpreter messageInterpreter) {
>> this.messageInterpreter = messageInterpreter;
>> }
>>
>> /**
>> * @return the messageInterpreter
>> */
>> public MessageInterpreter getMessageInterpreter() {
>> return messageInterpreter;
>> }
>>
>>
>>        /**
>>        *  THE CALLBACK method of MessageInterpreterCallback interface
>>        */
>> public void onInterpret(Interpretation ipr) {
>> System.out.println("Message has been interpreted.");
>> }
>>
>> }
>>
>>
>> ---------THE SERVICE WHICH IS CALLED BY THE CLIENT THROUGH WEBSERVICE
>> BINDING ---------
>>
>> /**
>>  *  */
>> package org.acme.logix;
>>
>> import org.acme.logix.message.Message;
>> import org.oasisopen.sca.RequestContext;
>> import org.oasisopen.sca.ServiceReference;
>> import org.oasisopen.sca.annotation.Callback;
>> import org.oasisopen.sca.annotation.Context;
>> import org.oasisopen.sca.annotation.Reference;
>> import org.oasisopen.sca.annotation.Service;
>>
>> /**
>>  *  *
>>  */
>> public class MessageInterpreterImpl implements MessageInterpreter{
>>
>> @Callback
>> protected MessageInterpreterCallback messageInterpreterCallback;
>> /* (non-Javadoc)
>> * @see
>> org.acme.logix.MessageInterpreter#interpret(org.acme.logix.message.Message)
>> */
>> public void interpret(Message msg) {
>> System.out.println("The message is being interpreted..");
>> Interpretation ipr = new Interpretation();
>> messageInterpreterCallback.onInterpret(ipr);
>> }
>>
>>
>>
>> /**
>> * @return the messageInterpreterCallback
>> */
>> public MessageInterpreterCallback getMessageInterpreterCallback() {
>> return messageInterpreterCallback;
>> }
>>
>>
>>
>> /**
>> * @param messageInterpreterCallback the messageInterpreterCallback to set
>> */
>> public void setMessageInterpreterCallback(
>> MessageInterpreterCallback messageInterpreterCallback) {
>> this.messageInterpreterCallback = messageInterpreterCallback;
>> }
>> }
>>
>>
>>
>>
>>
>> ---- THE COMPOSITE -----------
>>
>>
>>
>> <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
>>           targetNamespace="http://logistix"
>>           xmlns:logistix="http://logistix"
>>           name="AfnemerLogisticCenter">
>>
>>    <component name="AfnemerHandlingAgentComponent">
>> <implementation.java class="org.acme.logix.HandlingAgentImpl"/>
>>  <reference name="logisticCenter" >
>>         <binding.ws <http://binding.ws> uri="
>> http://127.0.0.1:8087/AfnemerHandlingAgentComponent"/>
>>  </reference>         <reference name="auditService"
>> target="AuditServiceComponent"/>                 </component>
>>
>>
>>
>>    <component name="AfnemerLogisticCenterComponent">
>>        <implementation.java class="org.acme.logix.LogisticCenterImpl"/>
>>        <reference name="messageInterpreter">
>> <interface.java interface="org.acme.logix.MessageInterpreter"
>>           callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>>
>> <binding.ws <http://binding.ws> uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>> <callback >
>> <binding.ws <http://binding.ws> uri="
>> http://localhost:8084/Client/MessageInterpreterCallback <
>> http://localhost:8081/Client/MessageInterpreterCallback>" />
>>
>> </callback>
>> </reference>
>>        <reference name="auditService">                      <binding.jms
>> initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>> jndiURL="tcp://localhost:61616">
>>   <destination jndiName="AuditServiceQueue" />
>>   </binding.jms>         </reference>
>>         </component>
>>        <component name="MessageInterpreterComponent">
>>     <implementation.java class="org.acme.logix.MessageInterpreterImpl"/>
>>         <service name="MessageInterpreter">
>> <interface.java interface="org.acme.logix.MessageInterpreter"
>>
>>  callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
>> <binding.ws <http://binding.ws>  uri="
>> http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
>> <callback>
>> <binding.ws <http://binding.ws> uri="
>> http://localhost:8084/Client/MessageInterpreterCallback <
>> http://localhost:8081/Client/MessageInterpreterCallback>"/>
>>
>> </callback>
>> </service>
>>    </component>
>>
>>
>>    <component name="AuditServiceComponent">
>>        <implementation.java class="org.acme.logix.AuditServiceImpl"/>
>>                <service name="AuditService">
>>            <binding.jms
>> initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
>> jndiURL="tcp://localhost:61616">
>>   <destination jndiName="AuditServiceQueue" />
>> </binding.jms>         </service>
>>    </component>
>>    </composite>
>>
>>
>

Re: Callback and Tuscany 2.0 Samples

Posted by Simon Nash <na...@apache.org>.
Urso Wieske wrote:
> Hi 
> 
> I am evaluating Tuscany 2.0 Beta1 and am trying to learn more about 
> Callbacks (Bi-Directional interface) of SCA 1.1. 
> I downloaded the Tuscany Sample files and started to explore the 
> callback implementations with webservice binding, i.e. the Search and 
> SearchCallback interfaces.
> It took me a while before I realized that the Tuscany SCA Samples were 
> based on SCA v1.0.   Tuscany 2.0 Beta1 is based on the SCA v1.1 specs.
> After studying the sample sources, I have written my own callback.
> 
> Unfortunately, I kept on getting a runtime exception after I installed 
> and deployed my contribution. By the way, I am using Eclipse and the 
> maven tuscany plugin.
> 
> I can't find the problem and hope if someone can point me in the right 
> direction.
> 
> This is the error (printed on my console) I am getting when I try to run 
> my program:
> [ERROR] Failed to execute goal 
> org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run 
> (default-cli) on project handler-agent: Execution default-cli of goal 
> org.apache.tuscany.maven.plugins:maven-tuscany-plugin:2.0-Beta1:run 
> failed: org.oasisopen.sca.ServiceRuntimeException: [Composite: 
> {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: 
> MessageInterpreterComponent] - [ASM60033] No targets for reference: 
> Composite = {http://docs.oasis-open.org/ns/opencsa/sca/200912} Reference 
> = messageInterpreterCallback -> [Help 1]
> 
> I suspect that I am doing something wrong in the composite file. I can't 
> imagine I did something wrong in the java sources. (See below for the 
> sources.) 
> 
Because the MessageInterpreterImpl class doesn't contain any @Reference or
@Property annotations, SCA creates implicit references for all public
setter methods in this class whose type is a remotable SCA interface, and
also for all public or protected fields in this class whose type is a
remotable SCA interface.

There is a public setter method setMessageInterpreterCallback() and a
protected field messageInterpreterCallback, so SCA defines a reference
named messageInterpreterCallback.  This reference doesn't have a target
configured in the composite, hence the error message.

To fix the problem, you need to remove the setter method (or make it
protected) and change the field from protected to private.

   Simon

> 
> Kind Regards,
> 
> Urso
> 
> 
> -------------------- THE SERVICE Interface With Callback Interface 
> association ---------- 
> 
> /**
>  * 
>  */
> package org.acme.logix;
> 
> import org.acme.logix.message.Message;
> import org.oasisopen.sca.annotation.Callback;
> import org.oasisopen.sca.annotation.OneWay;
> import org.oasisopen.sca.annotation.Remotable;
> 
> /**
>  * 
>  *
>  */
> @Remotable
> @Callback(MessageInterpreterCallback.class)
> public interface MessageInterpreter {
> 
> @OneWay
> void interpret(Message msg);
> }
> 
> 
> /**
>  * 
>  */
> package org.acme.logix;
> 
> import org.oasisopen.sca.annotation.OneWay;
> import org.oasisopen.sca.annotation.Remotable;
> 
> /**
>  * 
>  *
>  */
> @Remotable
> public interface MessageInterpreterCallback {
> void onInterpret(Interpretation ipr);
> }
> 
> 
> ---------- THE CLIENT implementing the callback interface ------------
> 
> /**
>  * 
>  */
> package org.acme.logix;
> 
> import org.acme.logix.message.Message;
> import org.oasisopen.sca.annotation.Reference;
> 
> /**
>  * 
>  */
> public class LogisticCenterImpl implements LogisticCenter, 
> MessageInterpreterCallback {
> private AuditService auditService;
> @Reference
> protected MessageInterpreter messageInterpreter;
> 
> /* (non-Javadoc)
> * @see 
> org.acme.logix.LogisticCenter#processMessage(org.acme.logix.message.Message)
> */
> public void processMessage(Message message) {
> System.out.println("Processing message with payload " + 
> message.getPayload() );
> auditService.logSentMessage(message);
> messageInterpreter.interpret(message);
> }
> 
> /**
> * @return the auditService
> */
> public AuditService getAuditService() {
> return auditService;
> }
> 
> /**
> * @param auditService the auditService to set
> */
> @Reference
> public void setAuditService(AuditService auditService) {
> this.auditService = auditService;
> }
> 
> /**
> * @param messageInterpreter the messageInterpreter to set
> */
> public void setMessageInterpreter(MessageInterpreter messageInterpreter) {
> this.messageInterpreter = messageInterpreter;
> }
> 
> /**
> * @return the messageInterpreter
> */
> public MessageInterpreter getMessageInterpreter() {
> return messageInterpreter;
> }
> 
> 
>         /**
>         *  THE CALLBACK method of MessageInterpreterCallback interface
>         */
> public void onInterpret(Interpretation ipr) {
> System.out.println("Message has been interpreted.");
> }
> 
> }
> 
> 
> ---------THE SERVICE WHICH IS CALLED BY THE CLIENT THROUGH WEBSERVICE 
> BINDING ---------
> 
> /**
>  * 
>  */
> package org.acme.logix;
> 
> import org.acme.logix.message.Message;
> import org.oasisopen.sca.RequestContext;
> import org.oasisopen.sca.ServiceReference;
> import org.oasisopen.sca.annotation.Callback;
> import org.oasisopen.sca.annotation.Context;
> import org.oasisopen.sca.annotation.Reference;
> import org.oasisopen.sca.annotation.Service;
> 
> /**
>  * 
>  *
>  */
> public class MessageInterpreterImpl implements MessageInterpreter{
> 
> @Callback
> protected MessageInterpreterCallback messageInterpreterCallback;
> /* (non-Javadoc)
> * @see 
> org.acme.logix.MessageInterpreter#interpret(org.acme.logix.message.Message)
> */
> public void interpret(Message msg) {
> System.out.println("The message is being interpreted..");
> Interpretation ipr = new Interpretation();
> messageInterpreterCallback.onInterpret(ipr);
> }
> 
> 
> 
> /**
> * @return the messageInterpreterCallback
> */
> public MessageInterpreterCallback getMessageInterpreterCallback() {
> return messageInterpreterCallback;
> }
> 
> 
> 
> /**
> * @param messageInterpreterCallback the messageInterpreterCallback to set
> */
> public void setMessageInterpreterCallback(
> MessageInterpreterCallback messageInterpreterCallback) {
> this.messageInterpreterCallback = messageInterpreterCallback;
> }
> }
> 
> 
> 
> 
> 
> ---- THE COMPOSITE -----------
> 
> 
> 
> <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
>            targetNamespace="http://logistix"
>            xmlns:logistix="http://logistix"
>            name="AfnemerLogisticCenter">
> 
>     <component name="AfnemerHandlingAgentComponent">
> <implementation.java class="org.acme.logix.HandlingAgentImpl"/>  
>         <reference name="logisticCenter" >
>          <binding.ws <http://binding.ws> 
> uri="http://127.0.0.1:8087/AfnemerHandlingAgentComponent"/>  
>         </reference> 
>         <reference name="auditService" 
> target="AuditServiceComponent"/>             
>     </component>
> 
> 
>     <component name="AfnemerLogisticCenterComponent">
>         <implementation.java class="org.acme.logix.LogisticCenterImpl"/>
>         
> <reference name="messageInterpreter">
> <interface.java interface="org.acme.logix.MessageInterpreter" 
>                      
>  callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
> 
> <binding.ws <http://binding.ws> 
> uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
> <callback >
> <binding.ws 
> <http://binding.ws> uri="http://localhost:8084/Client/MessageInterpreterCallback 
> <http://localhost:8081/Client/MessageInterpreterCallback>" />
> </callback>
> </reference>
>         <reference name="auditService">           
>            <binding.jms 
> initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" 
> jndiURL="tcp://localhost:61616">
>    <destination jndiName="AuditServiceQueue" />
>    </binding.jms> 
>         </reference>
>      
>     </component>
>     
>     <component name="MessageInterpreterComponent">
>      <implementation.java class="org.acme.logix.MessageInterpreterImpl"/>
>     
>      <service name="MessageInterpreter">
> <interface.java interface="org.acme.logix.MessageInterpreter"
>              
>  callbackInterface="org.acme.logix.MessageInterpreterCallback"/>
> <binding.ws <http://binding.ws> 
>  uri="http://localhost:8081/MessageInterpreterComponent/MessageInterpreter"/>
> <callback>
> <binding.ws 
> <http://binding.ws> uri="http://localhost:8084/Client/MessageInterpreterCallback 
> <http://localhost:8081/Client/MessageInterpreterCallback>"/>
> </callback>
> </service>
>     </component>
> 
> 
>     <component name="AuditServiceComponent">
>         <implementation.java class="org.acme.logix.AuditServiceImpl"/>
>         
>         <service name="AuditService">
>             <binding.jms 
> initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" 
> jndiURL="tcp://localhost:61616">
>    <destination jndiName="AuditServiceQueue" />
> </binding.jms> 
>         </service>
>     </component>
>     
> </composite>
>