For the JavaScript question the problem is the JavaScript container isn't included by default in the standalone distribution. As a work around for now you could either modify the assembly standalone.xml to include the JavaScript container when its building the distribution or you can manually copy the javascript-1.0-SNAPSHOT.jar to the launcher extension directory and its dependency jars js.jar and xbean.jar to the launcher boot directory.
...ant On 8/10/06, Chiond Huang <[EMAIL PROTECTED]> wrote:
Hi, all. We are faced to parsing exceptions in the loading phase on two occasions. I've changed a little of the run.bat of Supplychain into below to run the javascript sample: echo off rem set java_debug_set=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=3720,server=y,suspend=y mkdir target\standalone pushd target\standalone jar -xf "%USERPROFILE%\.m2\repository\org\apache\tuscany\standalone\1.0-SNAPSHOT\standalone- 1.0-SNAPSHOT-bin.zip" popd java %java_debug_set% -jar target\standalone\bin\launcher.jar --classpath "%USERPROFILE%\.m2\repository\org\apache\tuscany\samples\sca\sample-helloworld-javascript\1.0-SNAPSHOT\sample- helloworld-javascript-1.0-SNAPSHOT.jar" %* But when I ran it, it returned exception: C:\workspace\sandbox3\java\samples\sca\helloworldJavaScript>run C:\workspace\sandbox3\java\samples\sca\helloworldJavaScript>echo off Exception in thread "main" org.apache.tuscany.spi.loader.UnrecognizedElementExce ption: {http://tuscany.apache.org/xmlns/js/1.0}implementation.js [{ http://tuscan y.apache.org/xmlns/js/1.0}implementation.js] Context stack trace: [HelloWorldComponent] at org.apache.tuscany.core.loader.LoaderRegistryImpl.load( LoaderRegistryImpl.java:88) at org.apache.tuscany.core.loader.ComponentLoader.loadImplementation(Com ponentLoader.java:128) at org.apache.tuscany.core.loader.ComponentLoader.load( ComponentLoader.java:82) at org.apache.tuscany.core.loader.ComponentLoader.load( ComponentLoader.java:55) at org.apache.tuscany.core.loader.LoaderRegistryImpl.load (LoaderRegistry Impl.java:90) at org.apache.tuscany.core.implementation.composite.CompositeLoader.load (CompositeLoader.java:70) at org.apache.tuscany.core.implementation.composite.CompositeLoader.load (CompositeLoader.java:48) at org.apache.tuscany.core.loader.LoaderRegistryImpl.load( LoaderRegistryImpl.java:90) at org.apache.tuscany.core.loader.LoaderRegistryImpl.load (LoaderRegistry Impl.java:107) at org.apache.tuscany.core.implementation.system.loader.SystemCompositeComponentTypeLoader.loadFromSidefile (SystemCompositeComponentTypeLoader.java:62) at org.apache.tuscany.core.implementation.system.loader.SystemCompositeC omponentTypeLoader.load(SystemCompositeComponentTypeLoader.java:53) at org.apache.tuscany.core.implementation.system.loader.SystemCompositeC omponentTypeLoader.load(SystemCompositeComponentTypeLoader.java:35) at org.apache.tuscany.core.loader.LoaderRegistryImpl.loadComponentType( LoaderRegistryImpl.java:157) at org.apache.tuscany.core.deployer.DeployerImpl.load( DeployerImpl.java: 111) at org.apache.tuscany.core.deployer.DeployerImpl.deploy( DeployerImpl.java:90) at org.apache.tuscany.core.launcher.Launcher.bootApplication( Launcher.ja va:158) at org.apache.tuscany.core.launcher.MainLauncher.boot( MainLauncher.java: 138) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.tuscany.launcher.MainLauncherBooter.main (MainLauncherBoote r.java:67) Moreover, I faced a similar exception in another situation. In sample supplychain, which we can run the testcase successfully. Then we switched then annotation injection of reference into definition injection of reference in .componentType files. The details are below: 1. Remove the original annotations of reference in CustomerComponentImpl 2. Wrote a new CustomerComponentImpl.componentType and put it in the same dir of CustomerComponentImpl.java 3. Run the testcase of supplychain. The text of componentType is: <?xml version="1.0" encoding="ASCII"?> <componentType xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:xsd=" http://www.w3.org/2001/XMLSchema"> <service name="CustomerService" > <interface.java interface="supplychain.Customer"/> </service> <reference name="retailer"> <interface.java interface="supplychain.Retailer"/> </reference> </componentType> And the exception is: org.apache.tuscany.spi.loader.UnrecognizedElementException: { http://www.osoa.org/xmlns/sca/1.0}componentType [{ http://www.osoa.org/xmlns/sca/1.0}componentType] Context stack trace: [CustomerComponent] at org.apache.tuscany.core.loader.LoaderRegistryImpl.load( LoaderRegistryImpl.java:111) at org.apache.tuscany.core.implementation.java.JavaComponentTypeLoader.loadFromSidefile (JavaComponentTypeLoader.java:77) at org.apache.tuscany.core.implementation.java.JavaComponentTypeLoader.load( JavaComponentTypeLoader.java:62) at org.apache.tuscany.core.implementation.java.JavaComponentTypeLoader.load( JavaComponentTypeLoader.java:38) at org.apache.tuscany.core.loader.LoaderRegistryImpl.loadComponentType( LoaderRegistryImpl.java:157) at org.apache.tuscany.core.implementation.java.JavaImplementationLoader.load( JavaImplementationLoader.java:39) at org.apache.tuscany.core.loader.LoaderRegistryImpl.load( LoaderRegistryImpl.java:90) at org.apache.tuscany.core.loader.ComponentLoader.loadImplementation( ComponentLoader.java:128) at org.apache.tuscany.core.loader.ComponentLoader.load( ComponentLoader.java:82) at org.apache.tuscany.core.loader.ComponentLoader.load( ComponentLoader.java:55) at org.apache.tuscany.core.loader.LoaderRegistryImpl.load( LoaderRegistryImpl.java:90) at org.apache.tuscany.core.implementation.composite.CompositeLoader.load( CompositeLoader.java:75) at org.apache.tuscany.core.implementation.composite.CompositeLoader.load( CompositeLoader.java:50) at org.apache.tuscany.core.loader.LoaderRegistryImpl.load( LoaderRegistryImpl.java:90) at org.apache.tuscany.core.loader.LoaderRegistryImpl.load( LoaderRegistryImpl.java:107) at org.apache.tuscany.core.implementation.composite.CompositeComponentTypeLoader.loadFromSidefile (CompositeComponentTypeLoader.java:46) at org.apache.tuscany.core.implementation.composite.CompositeComponentTypeLoader.load (CompositeComponentTypeLoader.java:38) at org.apache.tuscany.core.implementation.composite.CompositeComponentTypeLoader.load (CompositeComponentTypeLoader.java:20) at org.apache.tuscany.core.loader.LoaderRegistryImpl.loadComponentType( LoaderRegistryImpl.java:157) at org.apache.tuscany.core.deployer.DeployerImpl.load(DeployerImpl.java :111) at org.apache.tuscany.core.deployer.DeployerImpl.deploy(DeployerImpl.java :90) at org.apache.tuscany.core.launcher.Launcher.bootApplication(Launcher.java :175) at org.apache.tuscany.test.SCATestCase.setUp(SCATestCase.java:63) at supplychain.SupplyChainClientTestCase.setUp( SupplyChainClientTestCase.java:33) at junit.framework.TestCase.runBare(TestCase.java:125) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run( JUnit3TestReference.java:128) at org.eclipse.jdt.internal.junit.runner.TestExecution.run( TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests( RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests( RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run( RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196) --------------------------------- Do you Yahoo!? Get on board. You're invited to try the new Yahoo! Mail Beta.