On 10/16/07, Ana Belén Antón Gironés <[EMAIL PROTECTED]> wrote:
>
> Dear Simon,
>
> Sorry, but I haven't got success. I have tried to run the "mynewsample"
> but
> it doesn't work. I am very lost.
>
> Before, I was trying to run it from my IDE (Eclipse), but as I had too
> much
> troubles with this, now I am trying it from a command prompt because I got
> to run the calculator sample following this way.
>
> I have created a new sample directory with the same structure which you
> provided me. Regarding the pom.xml I have had a look at the pom.xml of the
> other sample and I copied it. My pom.xml is:
>
>
> ===========================================================================
> <?xml version="1.0" encoding="UTF-8"?>
> <!--
>     * Licensed to the Apache Software Foundation (ASF) under one
>     * or more contributor license agreements.  See the NOTICE file
>     * distributed with this work for additional information
>     * regarding copyright ownership.  The ASF licenses this file
>     * to you under the Apache License, Version 2.0 (the
>     * "License"); you may not use this file except in compliance
>     * with the License.  You may obtain a copy of the License at
>     *
>     *   http://www.apache.org/licenses/LICENSE-2.0
>     *
>     * Unless required by applicable law or agreed to in writing,
>     * software distributed under the License is distributed on an
>     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>     * KIND, either express or implied.  See the License for the
>     * specific language governing permissions and limitations
>     * under the License.
> -->
> <project>
>     <modelVersion>4.0.0</modelVersion>
>     <parent>
>         <groupId>org.apache.tuscany.sca</groupId>
>         <artifactId>tuscany-sca</artifactId>
>         <version>1.0-incubating</version>
>         <relativePath>../../pom.xml</relativePath>
>     </parent>
>     <artifactId>sample-mynewsample</artifactId>
>     <name>Apache Tuscany SCA mynew Sample</name>
>
>     <repositories>
>        <repository>
>           <id>apache.incubator</id>
>           <url>http://people.apache.org/repo/m2-incubating-repository
> </url>
>        </repository>
>     </repositories>
>
>     <dependencies>
>         <dependency>
>             <groupId>org.apache.tuscany.sca</groupId>
>             <artifactId>tuscany-host-embedded</artifactId>
>             <version>1.0-incubating</version>
>         </dependency>
>
>         <dependency>
>             <groupId>org.apache.tuscany.sca</groupId>
>             <artifactId>tuscany-implementation-java-runtime</artifactId>
>             <version>1.0-incubating</version>
>             <scope>runtime</scope>
>         </dependency>
>
>         <dependency>
>             <groupId>junit</groupId>
>             <artifactId>junit</artifactId>
>             <version>4.2</version>
>             <scope>test</scope>
>         </dependency>
>
>     </dependencies>
>
>     <build>
>        <finalName>${artifactId}</finalName>
>     </build>
> </project>
>
>
> ===========================================================================
>
>
>
> I don´t know if it is right. What is the pom.xml?
>
> When I try to run the buil.xml I navigate to my sample directory
> (C:\TUSCANY\tuscany-sca-1.0-incubating\samples\mynewsample) and I do
>
> ant run-classes
>
> but I get this:
>
> run-classes:
>      [java] java.lang.NoClassDefFoundError: Client/isClient
>      [java] Exception in thread "main"
>      [java] Java Result: 1
>
> BUILD SUCCESSFUL
> Total time: 0 seconds
>
>
> Do you know what I have missed?
>
> Best regards and thank you very much for your help,
>
> Ana Belen.
>
>
>
>
> -----Mensaje original-----
> De: Ana Belén Antón Gironés [mailto:[EMAIL PROTECTED]
> Enviado el: lunes, 15 de octubre de 2007 17:17
> Para: tuscany-user@ws.apache.org
> Asunto: RE: ServiceUnavailableException: No service invoker is available
> for
> reference default
>
>
> Dear Simon,
>
> I have checked if I am available to run the samples that come with Tuscany
> and it runs without any problem. I am going to review "mynewsample"
> directory again. I will let you know my progress! Thanks
>
> Best regards,
>
> Ana Belen
>
>
> -----Mensaje original-----
> De: Simon Laws [mailto:[EMAIL PROTECTED]
> Enviado el: lunes, 15 de octubre de 2007 15:17
> Para: tuscany-user@ws.apache.org
> Asunto: Re: ServiceUnavailableException: No service invoker is available
> for
> reference default
>
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> > Hi Ana Belen
>
> 1) This looks like the same error as you were reporting before. Let's
> concentrate on the second one first as maybe that will highlight the
> underlying problem.
>
> 2). Tuscany is saying it can't find
> eu.services.information.rh.InformationServiceImpl. Can you check that the
> class is in that package and is available on the classpath that the
> Tuscany
> runtime (isClient) is being run with.
>
> Can you tell me if you are able to run the samples that come with Tuscany
> SCA V1.0. For example, the Calculator sample? It's good to run the sample
> and confirm that there is nothing fundamentally wrong with the
> installation.
> When I tried the example files from this thread I downloaded Tuscany SCA
> V1.0 and created a new sample directory for them.  So under
> sca1.0installdir/samples/mynewsample
> I have.
>
> 4    ./build.xml
> 4    ./pom.xml
> 4    ./src/main/java/Client/isClient.java
> 4    ./src/main/java/Client
> 1
>
> ./src/main/java/eu/services/information/exceptions/ISNotFoundException.java
> 1    ./src/main/java/eu/services/information/exceptions
> 1    ./src/main/java/eu/services/information/io/InformationObject.java
> 1    ./src/main/java/eu/services/information/io
> 1    ./src/main/java/eu/services/information/is/InformationService.java
> 1    ./src/main/java/eu/services/information/is
> 1    ./src/main/java/eu/services/information/rh/InformationObjectImpl.java
>
> 4    ./src/main/java/eu/services/information/rh/InformationServiceImpl.java
> 5    ./src/main/java/eu/services/information/rh
> 8    ./src/main/java/eu/services/information
> 8    ./src/main/java/eu/services
> 8    ./src/main/java/eu
> 76    ./src/main/java
> 1    ./src/main/resources/Information.composite
> 1    ./src/main/resources
> 77    ./src/main
> 81    ./src
>
> And I run it with the ant target I included in my previous mail that is in
> the build.xml file.
>
> Regards
>
> Simon
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
Hi

We use the maven tool to build the Tuscany source code. You will find a
pom.xml file in each module in our source tree. This file holds the
information that maven requires to build the module. It holds things like
the set of dependencies that the module has and what its parent module is.
It looks a little complicated but the hierarchy of pom.xml files means you
can pretty much go into any module or sample directory and type "mvn" and
that part of the code base should be compiled, tested and package for you.

As maven can be a little complicated we ship the more familiar ant
build.xmlfiles with our samples. As you have found with the Calculator
sample you can
use "ant compile" and "ant run" to compile and run a sample. The
build.xmlfile assumes that the files are going to be organized  in the
way that they
are for maven to work (so that we can use either maven or ant), i.e. the
java source comes from src/main/java and compiled classes are written to
target/classes. There are both run and run-classes targets generally so that
the sample can be run from either the packaged jar or from the
target/classes directory respectively.

Looking at the error you are getting it's possible that Client/isClient has
not compiled correctly. If you look at the ant build.xml files in the
samples, e.g. the Calculator sample, you will see that it provides a compile
target and compiles all of the source code to a directory called
target/classes. Note is also creates this directory before is compiles
anything.

So

1/ check that you have a target/classes dir and that it has suitable .class
files in it. If not then you need to compile your source using ant compile.

2/ check that the ant target you are using to run the sample (run-classes)
references the target/classes directory on the classpath.

When I made a build.xml file to try your sample I just copied one from one
of the other samples and modified it to point to the new sample client (
Client.isClient). Here is what I'm using.

<project name="calculator" default="compile">
    <property name="test.class" value="Client.isClient" />
    <property name="test.jar"   value="sample-calculator.jar" />

    <target name="init">
        <mkdir dir="target/classes"/>
    </target>

    <target name="compile" depends="init">
        <javac srcdir="src/main/java"
               destdir="target/classes"
               debug="on"
               source="1.5"
               target="1.5">
            <classpath>
                <pathelement location="../../lib/tuscany-sca-manifest.jar"/>
            </classpath>
        </javac>
        <copy todir="target/classes">
            <fileset dir="src/main/resources"/>
        </copy>
        <jar destfile="target/${test.jar}" basedir="target/classes">
            <manifest>
                <attribute name="Main-Class" value="${test.class}" />
            </manifest>
        </jar>
    </target>

    <target name="run-classes">
        <java classname="${test.class}"
              fork="true">
            <classpath>
                <pathelement path="target/classes"/>
                <pathelement location="../../lib/tuscany-sca-manifest.jar"/>
            </classpath>
        </java>
    </target>

    <target name="run">
        <java classname="${test.class}"
              fork="true">
            <classpath>
                <pathelement path="target/${test.jar}"/>
                <pathelement location="../../lib/tuscany-sca-manifest.jar"/>
            </classpath>
        </java>
    </target>

    <target name="clean">
        <delete quiet="true" includeemptydirs="true">
            <fileset dir="target"/>
        </delete>
    </target>
</project>

Hope that helps. Let me know how you get on.

Simon

Reply via email to