Dennis,
Some comments inline.
Dennis Virt wrote:
Dear Simon and Luciano,
Thank you for your detailed replies and comments. I also got an
impression that trunk is maintained healthy and "buildable".
We have made changes to the trunk recently to make it easier to build.
Could you try the following?
cd tuscany/java
mvn
This should build the SDO, DAS and SCA runtimes. I just tried with
revision r531619 and they all built OK.
You can imagine how much frustration has brought to me my attempt to
build the web service WAR, since I did not know that war plugin was
not operational :-)
We're going to try to make it more clear that modules under
java/sca/contrib (including the WAR plugin) are old and not operational.
I started a discussion on that earlier today on tuscany-dev.
Pure M3 war plugin did not work because of contribution dependency on
2.0alpha tag. I tried to mix M3 SDO/DAS and 2.0alpha-incubating branch
from TSSS demo, M2 SCA and M3 SDO/DAS and finally came back to all M2
code. The latter yielded the same results as M2 SCA and M3 SDO/DAS (at
the very end of this message).
Mixing M3 and M2 will be tricky, I don't recommend that path. M3 SDO is
very close to a release, and we've started to put an SCA release
together, targeting a release in a few weeks, so I suggest that you try
the SCA code in trunk instead of SCA M2.
I want to bundle as WAR just enough SCA runtime needed to 1) feed data
to an AJAX client over a web service
Are you planning to use SOAP or JSON-RPC? Our SOAP binding is
operational now, the JSON-RPC binding is not up and running as of today
but I expect to see it running again later this week.
2) and resolve change summaries from the client to the database.
Ideally I wanted this WAR to be deployable to Tomcat, JBoss, IBM
WebSphere 6.1 and Bea WebLogic. I was aware that WebSphere and
WebLogic would've needed much more attention in preparing descriptors
and crafting dependencies. If I succeeded with proof of concept, I'd
be able to assign further packaging to specialists capable of
WebSphere and WebLogic parts.
Do you need a WAR or would you be OK to start with an embedded Tomcat?
With the embedded Tomcat configuration, we embed a minimal Tomcat
instance and boot it from inside Tuscany, instead of having the Tuscany
runtime installed on top of an existing Tomcat, with the SCA application
running in a WAR.
If you want to see how our embedded configuration works, you can take a
look at the test cases under java/sca/modules/binding-ws-axis2. They use
Jetty instead of Tomcat but I'm going to add a Web Service sample to
java/sca/samples later today which will show how to provide a Web
Service uing Tomcat. I'll post an update to this thread with a link to
the sample when it's ready.
Running an SCA application in a WAR should also be supported again soon,
probably sometime next week, as several Tuscany developers have already
indicated on our dev list that they were interested in getting this to
work for our upcoming release. I'm expecting our new Webapp packaging
story to be much simpler than before and not require a special Tuscany
WAR plugin anymore to create WARs.
I will try now with M3 code and SCA embedded in Jetty or Tomcat.
A few words about problem that stopped my advance with WAR packaging
of web service. Below are the pom.xml, WSDL, default.scdl, DAS
configuration and service implementation if anybody cares to glance
through and maybe point out any obvious mistakes. I stripped down some
comments. M2 SCA/SDO/DAS, just as M2 SCA and M3 SDO/DAS packaged as
WAR and deployed to Tomcat 5.5.23 give me the following message when I
try to invoke loadProcessFolderContent:
The error below is probably caused by a problem selecting the
Databinding to use in your application. I'm not too familiar with how
Databindings worked in M2 - maybe other Tuscany developers can help
here? - but I've seen the SDO databinding consistently work with Web
Services recently with the latest code in trunk.
java.lang.IllegalArgumentException: Complex type is not supported for
simple jav
a databinding.
at org.apache.tuscany.spi.databinding.extension.SimpleTypeMapperExtensio
n.toJavaObject(SimpleTypeMapperExtension.java:275)
at org.apache.tuscany.spi.databinding.extension.SimpleType2JavaTransform
er.transform(SimpleType2JavaTransformer.java:51)
at org.apache.tuscany.core.databinding.impl.MediatorImpl.mediate(Mediato
rImpl.java:95)
at org.apache.tuscany.core.databinding.impl.Input2InputTransformer.trans
form(Input2InputTransformer.java:197)
at org.apache.tuscany.core.databinding.impl.Input2InputTransformer.trans
form(Input2InputTransformer.java:47)
at org.apache.tuscany.core.databinding.impl.MediatorImpl.mediate(Mediato
rImpl.java:95)
at org.apache.tuscany.core.databinding.impl.DataBindingInteceptor.transf
orm(DataBindingInteceptor.java:105)
at org.apache.tuscany.core.databinding.impl.DataBindingInteceptor.invoke
(DataBindingInteceptor.java:69)
at org.apache.tuscany.binding.axis2.Axis2Service.invokeTarget(Axis2Servi
ce.java:215)
at org.apache.tuscany.binding.axis2.Axis2ServiceInOutSyncMessageReceiver
.invokeBusinessLogic(Axis2ServiceInOutSyncMessageReceiver.java:53)
at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(A
bstractInOutSyncMessageReceiver.java:39)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:493)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReq
uest(HTTPTransportUtils.java:319)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:2
47)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at org.apache.tuscany.binding.axis2.Axis2ServiceServlet.service(Axis2Ser
viceServlet.java:204)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.tuscany.runtime.webapp.ServletHostImpl.service(ServletHost
Impl.java:88)
at org.apache.tuscany.runtime.webapp.TuscanyServlet.service(TuscanyServl
et.java:56)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:269)
SERVICE IMPLEMENTATION: PFTServiceImpl.java
package pemr;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;
import org.apache.tuscany.das.rdb.Command;
import org.apache.tuscany.das.rdb.DAS;
import org.osoa.sca.annotations.Scope;
import org.osoa.sca.annotations.Service;
import commonj.sdo.DataObject;
import commonj.sdo.DataGraph;
@Service(PFTService.class)
public class PFTServiceImpl implements PFTService {
public PFTServiceImpl() {
}
private DAS das = DAS.FACTORY.createDAS(
getConfig("PEMRConfig.xml"), createConnection());
protected InputStream getConfig(String fileName) {
return getClass().getClassLoader().getResourceAsStream(fileName);
}
/**
* Method either returns unassigned processes and topmost folders OR
subfolders and
* contained processes for some given folder.
* @param folderId
* @param maxDepth
* @return
*/
public FolderList loadProcessFolderContent(Integer folderId) {
FolderList res = PemrFactory.INSTANCE.createFolderList();
Command foldersCmd, processDefsCmd;
processDefsCmd = das.getCommand("unassigned processes");
DataObject root = processDefsCmd.executeQuery();
Util.printDataObject(root, 0);
res.getProcessDef().addAll(root.getList("ProcessDef"));
return res;
}
/**
* Method applies changes passed in a data graph.
* @param dataGraph
*/
public void applyChanges(DataGraph dataGraph) {
das.applyChanges(dataGraph.getRootObject());
}
public void greet(String name) {
System.out.println("pemrSCA Greeter: Hello " + name + "!");
}
protected Connection createConnection() {
Properties p = new Properties();
try {
p.load(getConfig("db.properties"));
String driver = p.getProperty("jdbc.driverClassName");
Class.forName(driver).newInstance();
Connection con = DriverManager.getConnection(
p.getProperty("jdbc.url"),
p.getProperty("jdbc.username"),
p.getProperty("jdbc.password")
);
con.setAutoCommit(false);
return con;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
SERVICE COMPONENT DEFINITION: default.scdl
<?xml version="1.0" encoding="UTF-8"?>
<composite
xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance" name="PFTService">
<!-- <dbsdo:import.sdo
xmlns:dbsdo="http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0"
factory="pemr.PemrFactory"/> -->
<dbsdo:import.sdo
xmlns:dbsdo="http://incubator.apache.org/tuscany/xmlns/databinding/sdo/1.0-incubator-M2"
location="wsdl/pemr.wsdl" />
<!-- <dbsdo:import.sdo
xmlns:dbsdo="http://incubator.apache.org/tuscany/xmlns/databinding/sdo/1.0-incubator-M2"
location="wsdl/pemr.wsdl" /> -->
<service name="PFTService" target="http://pemr">
<interface.java interface="pemr.PFTService"/>
<!-- <interface.wsdl
xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
interface="http://pemr#wsdl.interface(PFTService)"
wsdli:wsdlLocation="http://pemr wsdl/pemr.wsdl" /> -->
<!--FIXME the location attribute is a really bad hack here! does not
follow to spec at all
-->
<binding.ws
endpoint="http://pemr#wsdl.endpoint(PFTService/PFTServiceSOAP)"
conformanceURIs="http://ws-i.org/profiles/basic/1.1"
location="wsdl/pemr.wsdl" />
<!-- <binding.ws
wsdlElement="http://pemr/PFTService#wsdl.service(PFTService)"
wsdli:wsdlLocation="http://pemr wsdl/pemr.wsdl"/> -->
<reference>PFTServiceComponent</reference>
</service>
<component name="PFTServiceComponent">
<implementation.java class="pemr.PFTServiceImpl" />
</component>
</composite>
WEB SERVICE WSDL: pemr.wsdl
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://pemr"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="PFTService"
targetNamespace="http://pemr">
<wsdl:types>
<xsd:schema targetNamespace="http://pemr"
xmlns:sdo="commonj.sdo" xmlns:sdoJava="commonj.sdo/java"
xmlns:sdoXML="commonj.sdo/XML">
<xsd:element name="greet">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="name" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="loadProcessFolderContent">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="folderId" type="xsd:int" nillable="true"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="loadProcessFolderContentResponse"
type="tns:FolderList" />
<xsd:complexType name="ProcessDef">
<xsd:sequence>
<xsd:element name="name" type="xsd:string" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:int" use="required" />
</xsd:complexType>
<xsd:complexType name="FolderList">
<xsd:sequence>
<xsd:element name="processDef" minOccurs="0"
maxOccurs="unbounded" type="tns:ProcessDef" sdoXML:name="processDefs" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="greetRequest">
<wsdl:part element="tns:greet" name="parameters" />
</wsdl:message>
<wsdl:message name="loadProcessFolderContentRequest">
<wsdl:part element="tns:loadProcessFolderContent"
name="parameters" />
</wsdl:message>
<wsdl:message name="loadProcessFolderContentResponse">
<wsdl:part element="tns:loadProcessFolderContentResponse"
name="parameters" />
</wsdl:message>
<wsdl:portType name="PFTService">
<wsdl:operation name="loadProcessFolderContent">
<wsdl:input message="tns:loadProcessFolderContentRequest"
name="loadProcessFolderContentRequest"/>
<wsdl:output message="tns:loadProcessFolderContentResponse"
name="loadProcessFolderContentResponse"/>
</wsdl:operation>
<wsdl:operation name="greet">
<wsdl:input message="tns:greetRequest" name="greetRequest" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="PFTServiceSOAP" type="tns:PFTService">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="loadProcessFolderContent">
<soap:operation soapAction="loadProcessFolderContent" />
<wsdl:input name="loadProcessFolderContentRequest">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="loadProcessFolderContentResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="greet">
<soap:operation soapAction="greet" />
<wsdl:input name="greetRequest">
<soap:body use="literal" />
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="PFTService">
<wsdl:port binding="tns:PFTServiceSOAP" name="PFTServiceSOAP">
<soap:address
location="http://localhost:8888/m2test/services/PFTService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
BUILD FILE: pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>m2test</groupId>
<artifactId>m2test</artifactId>
<packaging>war</packaging>
<version>0.0.1</version>
<build>
<finalName>${artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tuscany.sdo</groupId>
<artifactId>tuscany-sdo-plugin</artifactId>
<version>1.0-incubator-M2</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<schemaFile>
${basedir}/src/main/resources/wsdl/pemr.wsdl
</schemaFile>
<noEMF>true</noEMF>
<!-- <noNotification>true</noNotification>
<noContainer>true</noContainer>
<noUnsettable>true</noUnsettable> -->
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.tuscany.sca.plugins</groupId>
<artifactId>tuscany-plugin-wsdl2java</artifactId>
<version>1.0-incubator-M2</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<wsdlFile>
${basedir}/src/main/resources/wsdl/pemr.wsdl
</wsdlFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.tuscany.sca.plugins</groupId>
<artifactId>tuscany-war-plugin</artifactId>
<version>1.0-incubator-M2</version>
<executions>
<execution>
<id>tuscany-war</id>
<goals>
<goal>tuscany-war</goal>
</goals>
</execution>
</executions>
<configuration>
<loadExtensionDependencies>
false
</loadExtensionDependencies>
<extensions>
<dependency>
<groupId>org.apache.tuscany.sca.services.databinding</groupId>
<artifactId>
databinding-sdo
</artifactId>
<version>1.0-incubator-M2</version>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca.services.bindings</groupId>
<artifactId>
axis2
</artifactId>
<version>1.0-incubator-M2</version>
</dependency>
</extensions>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca.plugins</groupId>
<artifactId>tuscany-plugin-wsdl2java</artifactId>
<version>1.0-incubator-M2</version>
</dependency>
<dependency>
<groupId>org.osoa</groupId>
<artifactId>sca-api-r0.95</artifactId>
<version>1.0-incubator-M2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca.runtime</groupId>
<artifactId>webapp</artifactId>
<version>1.0-incubator-M2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.tuscany</groupId>
<artifactId>commonj-api_r1.1</artifactId>
<version>1.0-incubator-M2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>stax</groupId>
<artifactId>stax-api</artifactId>
<version>1.0.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>wstx-asl</artifactId>
<version>3.2.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sdo</groupId>
<artifactId>tuscany-sdo-impl</artifactId>
<version>1.0-incubator-M2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.tuscany.das</groupId>
<artifactId>tuscany-das-rdb</artifactId>
<version>1.0-incubator-M2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>
org.apache.tuscany.sca.services.databinding
</groupId>
<artifactId>databinding-sdo</artifactId>
<version>1.0-incubator-M2</version>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca.kernel</groupId>
<artifactId>tuscany-spi</artifactId>
<version>1.0-incubator-M2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.1</version>
</dependency>
</dependencies>
</project>
DAS CONFIGURATION:
<?xml version="1.0" encoding="UTF-8"?>
<!--
-->
<Config
xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
dataObjectModel="http://pemr">
<!-- <ConnectionInfo dataSource="java:comp/env/jdbc/pemr"/> -->
<!--
<Command name="topmost folders"
SQL="select * from folder where parent_folder_id is null"
kind="Select" />
<Command name="folder subfolders"
SQL="select * from folder where parent_folder_id=?" kind="Select" />
<Command name="folder processes"
SQL="select * from process_def where folder_id=?" kind="Select" />
<Command name="clean folders" SQL="delete from folder"
kind="Delete" />
-->
<Command name="unassigned processes"
SQL="select * from process_def" kind="Select" />
<Command name="clean processes" SQL="delete from process_def"
kind="Delete" />
<Table tableName="process_def" typeName="ProcessDef">
<Column columnName="id" primaryKey="true" generated="true" />
<!--
<Column columnName="folder_id" propertyName="folderId"/>
<Column columnName="original_process_id"
propertyName="originalProcessId"/>
-->
</Table>
<!--
<Table tableName="folder" typeName="ProcessFolder">
<Column columnName="id" primaryKey="true" generated="true" />
<Column columnName="parent_folder_id" propertyName="parentFolderId"/>
</Table>
<Relationship name="processFolder" primaryKeyTable="folder"
foreignKeyTable="process_def" many="true">
<KeyPair primaryKeyColumn="id" foreignKeyColumn="folder_id" />
</Relationship>
-->
<!--
<Relationship name="subfolders" primaryKeyTable="folder"
foreignKeyTable="folder" many="true">
<KeyPair primaryKeyColumn="id" foreignKeyColumn="parent_folder_id"/>
</Relationship>
<Relationship name="original_process" primaryKeyTable="process_def"
foreignKeyTable="process_def" many="true">
<KeyPair primaryKeyColumn="id" foreignKeyColumn="original_process_id"/>
</Relationship>
-->
</Config>
_________________________________________________________________
Download Messenger. Join the i’m Initiative. Help make a difference
today. http://im.live.com/messenger/im/home/?source=TAGHM_APR07
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Jean-Sebastien
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]