Announcement

Collapse
No announcement yet.

Unterschiede bei den JDK Versionen

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Es eht auch komplett ohne Sun J2EE, also nur zusammen mit dem JBoss. Denn: Es handelt sich in beiden Fällen nur um Implementierungen des J2EE-Standards, die eine ist so gut wie die andere.
    AAAAAber: Natürlich benötigt Eclipse in seinem Klassenpfad die Verweise auf die den Standard implementierenden Bibliotheken von JBoss. Das sind z.B. (Name der Jar-Datei, Pfad relativ zur JBoss-Installation):

    jboss-ejb3.jar <JBoss-4.0.2RC1-EJB3Preview5>/server/all/deploy/ejb3.deployer
    jboss-ejb3x.jar <JBoss-4.0.2RC1-EJB3Preview5>/server/all/deploy/ejb3.deployer
    jboss-j2ee.jar <JBoss-4.0.2RC1-EJB3Preview5>/server/all/lib
    commons-httpclient.jar <JBoss-4.0.2RC1-EJB3Preview5>/lib
    hibernate3.jar <JBoss-4.0.2RC1-EJB3Preview5>/server/all/deploy/ejb3.deployer
    jbossall-client.jar <JBoss-4.0.2RC1-EJB3Preview5>/client
    jboss-aop-jdk50.jar <JBoss-4.0.2RC1-EJB3Preview5>/server/all/deploy/jboss-aop-jdk50.deployer
    jboss-aspect-library-jdk50.jar <JBoss-4.0.2RC1-EJB3Preview5>/server/all/deploy/jboss-aop-jdk50.deployer
    jboss-remoting.jar <JBoss-4.0.2RC1-EJB3Preview5>/server/all/lib

    Wenn Du ein Java-Projekt in Eclipse hast (Eclispe 3.1!) und bei "Properties/Java Build Path/Libraries" alle obigen hinzufügst, muss Eclipse die @Annotations erkennen.
    Ebenfalls wichtig: Zu jeder @Annotation gehört immer auch ein import-Ausdruck, für @Stateful also immer auch ein "import import javax.ejb.Stateful;".

    Ich hoffe. das hilft weiter

    Comment


    • #17
      Vielen Dank Stefan...
      auch, wenn diese Danksagung etwas spät kommt, aber dein Beitrag war sehr informativ.
      Was mich auch sehr interessieren würde ist, wie man ohne IDEs arbeiten kann.
      Die meisten build.xml Dateien sind so aufgebläht, und man steigt da etwas schwer durch.
      Angenommen, man möchte mit jboss 4.0.3 und jdk 1.5.0.4, ohne andere Hilfsmittel (außer ANT) eine EJB3 .ear Datei erzeugen, wie geht man da vor?
      Nehmen wir das EJB3Trail Beispiel (zu finden unter http://www.jboss.com/docs/trailblazer)
      Dort werden die einzelnen Archive erklärt, aber leider nicht detailliert, sprich, wie man nur eine slsb + interface zu einem .ear Archiv macht, und wie man mit einer jsp Seite darauf zugreift...

      Hat das mal jemand gemacht? Ganz einfach ohne IDEs die benötigten Dateien erzeugen, daraus ein kleines Arhiv zu machen und deployen?

      Ich wäre Euch sehhhhr dankbar, für ein kleines Beispielchen.

      Gruß
      Davi

      Comment


      • #18
        Ich arbeite zwar nicht ohne IDE, aber innerhalb der IDE (z.B. Eclipse oftmals mit ANT). Nachfolgend eine Build.xml-Datei für ANT, die bei mir erfolgreich ein bestehendes Eclipse-Projekt nach JBoss 4.0.3RC1/EJB3Beta1 deployen kann. Inklusiuve JavaDoc (Muss ein wenig angepasst werden, weil im Beispiel eigene Taglets Verwendet werden) und JUnit-Test:


        <project name="TcsPersistentMessageServer" default="JBoss.deploy" basedir=".">



        <!-- System dependent -->

        <property name="ECLIPSE_HOME" value="p:/Eclipse/Eclipse3.1M7" />

        <property name="JDK_HOME" value="P:/JavaSDK" />

        <property name="JBOSS_HOME" value="P:/JBoss/jboss-4.0-EJB3" />

        <property name="JBOSS_DEPLOY_DIR" value="${JBOSS_HOME}/server/ejb3/deploy" />

        <!-- System relative -->

        <property name="JAVA_TOOLS" value="${JDK_HOME}/lib/tools.jar"/>

        <property name="JUNIT" value="${ECLIPSE_HOME}/plugins/org.junit_3.8.1/junit.jar"/>

        <!-- project dependant -->

        <property name="src.home" value="${basedir}/src" />

        <property name="build.home" value="${basedir}/bin" />

        <property name="build.distrib" value="${basedir}/distrib" />



        <!-- ================================================== ==================== -->

        <!-- =========================== Compile Target =========================== -->

        <!-- ================================================== ==================== -->

        <!-- =================== Compilation Control Options =================== -->

        <property name="compile.development.debug" value="true" />

        <property name="compile.distribution.debug" value="false" />

        <property name="compile.deprecation" value="false" />

        <property name="compile.develoopment.optimize" value="false" />

        <property name="compile.distribution.optimize" value="true" />



        <path id="compile.implementation.classpath">

        <pathelement location="${basedir}/lib/TcsInterface.jar"/>

        <pathelement location="${basedir}/lib/JavaLib.jar"/>

        <pathelement location="${JUNIT}"/>

        <pathelement location="${basedir}/lib/jboss-ejb3.jar"/>

        <pathelement location="${basedir}/lib/jboss-ejb3x.jar"/>

        <pathelement location="${basedir}/lib/ejb3-persistence.jar"/>

        <pathelement location="${basedir}/lib/jbossall-client.jar"/>

        </path>

        <path id="compile.JUnitTests.classpath">

        <pathelement location="${basedir}/lib/TcsInterface.jar"/>

        <pathelement path="${build.home}/implementation" />

        <pathelement location="${JUNIT}"/>

        </path>

        <path id="all.classpath">

        <pathelement location="${JUNIT}"/>

        <pathelement location="${basedir}/lib/TcsInterface.jar"/>

        <pathelement location="${basedir}/lib/JavaLib.jar"/>

        <pathelement path="${build.home}/implementation" />

        <pathelement path="${build.home}/JUnitTests" />

        <pathelement location="${basedir}/lib/jboss-ejb3.jar"/>

        <pathelement location="${basedir}/lib/jboss-ejb3x.jar"/>

        <pathelement location="${basedir}/lib/ejb3-persistence.jar"/>

        <pathelement location="${basedir}/lib/jbossall-client.jar"/>

        </path>



        <!-- ======================= Compilation Commands ====================== -->

        <target name="compile.development" description="Compile Java sources">

        <!-- Compile Java classes as necessary -->

        <delete dir="${build.home}/implementation" />

        <mkdir dir="${build.home}/implementation" />

        <delete dir="${build.home}/JUnitTests" />

        <mkdir dir="${build.home}/JUnitTests" />

        <javac srcdir="${src.home}/implementation" destdir="${build.home}/implementation" debug="${compile.development.debug}" deprecation="${compile.deprecation}" optimize="${compile.development.optimize}">

        <classpath refid="compile.implementation.classpath" />

        </javac>

        <javac srcdir="${src.home}/JUnitTests" destdir="${build.home}/JUnitTests" debug="${compile.development.debug}" deprecation="${compile.deprecation}" optimize="${compile.development.optimize}">

        <classpath refid="compile.JUnitTests.classpath" />

        </javac>

        </target>

        <target name="compile.distribution" description="Compile Java sources">

        <!-- Compile Java classes as necessary -->

        <delete dir="${build.home}/implementation" />

        <mkdir dir="${build.home}/implementation" />

        <javac srcdir="${src.home}/implementation" destdir="${build.home}/implementation" debug="${compile.distribution.debug}" deprecation="${compile.deprecation}" optimize="${compile.distribution.optimize}">

        <classpath refid="compile.implementation.classpath" />

        </javac>

        </target>





        <!-- ================================================== ==================== -->

        <!-- =========================== Javadoc Target =========================== -->

        <!-- ================================================== ==================== -->

        <target name="javadoc">

        <mkdir dir="${basedir}/doc" />

        <javadoc

        access="protected"

        &

        Comment


        • #19
          Nachtrag: Leider hat der Eingabedialog dieses forums sämtliche Kommentare eliminiert. Ich füge daher die Ant-Build.xml-Datei als Anhang bei

          Comment


          • #20
            Hallo Stefan,

            vielen vielen Dank für Dein Beispiel.

            Aber leider finde ich hier keinen Anhang mit Kommentaren usw., um alles zu verstehen.... und so sieht das Ding viel zu komplex aus...

            Könntest Du mir das mal an:

            mynews2001 AT gmx punkt net

            mailen? Das wäre toll... und vielleicht - bitte - eine kleine Erklärung über die die Applikation und die Struktur wäre auch ganz toll.

            Vielen Dank nochmal.

            Gru&#223

            Comment

            Working...
            X