Adding ejb.jars using ant

I am trying to write an ant build.xml file that adds some ejb.jar files to the classpath.
<project name="PRIMA Monitor" default="final stage" basedir=".">
     <!-- Init some path variables -->
     <target name="init">
          <echo message="Building PRIMA Monitor on ${os.name}" />
          <property name="src" location="ie/nuigalway/primamonitor"/>
          <property name="build" location="build"/>
          <property name="jars" location=" ./include/ejbBanHub.jar;include/kunststoff.jar;./include/jbcl.jar;.include/ejbPatient.jar;./include/ejbWearer.jar;./include/jbossall-client.jar"/>
          <property name="docs" location="docs"/>
          <property name="deploy" location="deploy"/>
     </target>
     <!-- Try and compile the source (in $src), dumping class files in the $build dir -->
     <target name="build" depends="init">
     <mkdir dir="${build}" />
          <javac srcdir="${src}"
               destdir="${build}"
               debug="true"
               classpath="${jars}"
               includes="**/*.java" />
     </target>
when i run the build.xml i get some compilation errors associated with the ejb jar files(which i dont get when i manually javac the files). Am i adding the jar files correctly in the build.xml.

typo error (";include/kunststoff.jar" or should be ";./include/kunststoff.jar") ?

Similar Messages

  • Signing jars using ant 1.7

    Hello,
    I want to sign jars using the ant 1.7. I am using the
    <signjar alias="E:\buildforcertify\filefolderupload.jar" keystore="myKeyStore.keystore" storepass="day" verbose="true"/>
    but it it doesnot work.
    Please help me in signing jars using ant. If u can provide an link, it would be of great help.
    TIA,
    Sarwa

    Yes It has to do with swing.
    I used the following command in ant.
    <target name="signjar" depends="cpappletjars">      
         <signjar jar="${dir.webapp}/fileupload/*.jar" alias="me" storepass="applet" keystore="${dir.webapp}/fileupload/myKeyStore"/>
         <delete file="${dir.webapp}/fileupload/myKeyStore"/>
    </target>
    It worked fine for windows but for linux it gives error as "unble to open file *.jar "
    Can u please let me know where I am gone wrong ?
    similar sort of problem seen at http://forum.java.sun.com/thread.jspa?threadID=5301675&messageID=10278840 But no solution.

  • Uploading EJB Jars using Enterprise Manager Console

    I realize most publish their EJBs as an "ear" and their web modules as "war
    But, what if I want to publish my ejb as a "jar" component? The Enterprise Manager Oc4J home has buttons for uploading WAR and EAR components only.
    Please suggest work arounds.

    Our forthcoming 10.1.3 release will support the additional deployment of standalone JAR files for EJB applications from Application Server Control (EM).
    In earlier releases you can either:
    1. Wrapper the JAR file witihn an EAR file and deploy that.
    2. Manually deploy your JAR file to the default application using the j2ee/home/application.xml file by adding an entry such as:
    <ejb-module id="jmsrouter_ejb" path="../../home/applications/jmsrouter-ejb.jar"/>
    Note that in an DCM managed environment, this form of manual deployment not a recommended option. Make sure you notify the DCM repository of this type of change using "dcmctl updateConfig".
    cheers
    -steve-

  • Building jars using ant and eclipse

    Note: If this post could be in a more appropriate forum category could someone please tell me which one is better.
    Vexing issue:
    I am using ANT so that it will take care of which classes have been modified and therefore which jars need to be updated.
    I noticed one way ANT can work is to look at the timestamp of the class files and then build the necessary jars. This works fine EXCEPT that eclipse has a nasty habit of sometimes recompiling everything, even when I dont ask it to. It would seem to make more sense basing the recompilation on the source files, and whether they have been modified. So I set this up with my build.xml, ie
    <target name="compile" depends="init"
    description="compile the source " >
    <!-- Compile the java code from ${src} into ${build} -->
    <javac srcdir="${src}" destdir="${build}" fork="true"/>
         </target>
    Now suppose I go and change one of my source files, ANT recompiles that file and that all works great. However, suppose that file had in it, which many do,
    public static String EXAMPLE_VARIABLE = "example";
    This static variable is referenced in many classes, and yet ANT only recompiles the one file, and thus there begins an inconsistency!
    Is there any way to get around this? I would have expected ANT to recompile all the files that depend on the class with the static variable but it doesnt.
    Any help much appreciated.
    Cel

    You know, that's a good question. I would think JVMs at runtime could resolve static variables, like when it compiles classes using that static variable it puts a placeholder "Hey, here I am using XXX, at runtime, figure it out and give me the value right at the start..". But I think it works like you suggest in that a static value is compiled into every location that uses it. The only thing I can think of is provide a target for a build-all in your ant and have it rebuild all.
    I agree though that the javac compiler should be smarter in how it compiles classes. Anytime a class has certain attributes that may be compiled in to other classes, it should check and recompile any class that depends on the static value that has changed.

  • Unable to delete WEB-INF\\lib\*.jar using ant

    Using ant to build struts.
    This is part of the build.xml for struts-example.war
    <property name="deploy.dir" value="${tomcat.home}/webapps"/>
    <target name="cleanWebApp">
    <delete file="${deploy.dir}/${war.file.name}" />
    <delete dir="${deploy.dir}/${war.file}" includeEmptyDirs="true" />
    </target>
    But when I try to build and reload it to tomcat, it gives me errors:
    cleanWebApp:
    [delete] Deleting: D:\jakarta-tomcat-5.5.7\webapps\struts-example.war
    [delete] Deleting directory D:\jakarta-tomcat-5.5.7\webapps\struts-example
    BUILD FAILED
    D:Java\code\struts\strutsexamples\build.xml:46: Unable to delete file D:\jakarta-tomcat-5.5.7\webapps\struts-example\WEB-INF\lib\commons-digester.jar
    Also lib\struts.jar(maybe more) can't be deleted.
    Now I have to stop tomcat, delete it manually, and reinstall the war.
    How can I fix this problem?

    All the advice above seems to make sense, but .....
    - Tomcat shutdown,
    - with all java processes shutdown,
    - after a full reboot,
    - with antiJARLocking="true" set in every context.xml I can find:
    [delete] Deleting directory C:\Program Files\Apache Software
    Foundation\Tomcat 5.5\webapps\myApp
    BUILD FAILED
    C:\myApp\build.xml:118: Unable to delete file C:\Program Files\Apache
    Software Foundation\Tomcat 5.5\webapps\myApp\WEB-INF\lib\antlr.jar
    But I CAN delete the jars using the normal Windows Explorer or from the DOS Command Prompt.
    And per the advice found here:
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=67&t=000574
    I've downloaded the Process Explorer from www.sysinternals.com and no windows processes appear to have a handle on there directory.
    I think the solution is indeed to exclude jar files from <delete> target.
    Regards,
    Stewart

  • Adding dependency jars to EAR

    Can anyone advise me on how to add a normal jar file to my EAR file? I have deployed
    the EAR on weblogic but the ejb does not get deployed becuase it cannot find a
    class. The class is included within a seperat jar file which does not have any
    EJBs in it. How do I add this to the application xml so it is available to all
    the ejb modules within the ear?
    Thanks in advance

    hi,
    unfortuantely i am using weblogic 7 thus have to put the class path entries into
    the manifest.
    I have done this but it still throws the classdefnotfound exception. I will outline
    what i have done if anyone can help. I have an Ear file called a.Ear. In it
    there is one EJB module called BEJB.jar. This jar has a dependecy on another
    jar called c.jar.
    The BEJB.jar and c.Jar are both contained within the EAR file and in the application.xml
    file I have put the following for the EJb module
    <module>
    <ejb>BEJB.jar</ejb>
    </module>
    In the manifest file I have added the following entry. This is the manifest file
    which is within the BEJB.jar
    Manifest-Version: 1.0
    Class-Path: c.jar
    The manifest file for the EAR i have not touched. I have built all the jars using
    ant. I have checked the manifest files and they are within the correct directory
    within the appropriate jar i.e meta-inf and contain the above information.
    This still throws the classdefnotfounderror.......Any ideas what i am missing?
    Thanks
    "Pat Bumpus" <[email protected]> wrote:
    >
    Hi,
    You don't add anything to your application.xml. I'm assuming that you
    are using
    WLS 8.1. In your EAR add an APP-INF/lib directory and place the jar
    there. Then
    when your EAR is deployed WLS will load the classes from that jar file.
    Before, WLS 8.1 you have to add class-path entries to your MANIFEST.MF
    file which
    is kind of a pain.
    Hope this helps,
    pat
    "fez" <[email protected]> wrote:
    Can anyone advise me on how to add a normal jar file to my EAR file?
    I have deployed
    the EAR on weblogic but the ejb does not get deployed becuase it cannot
    find a
    class. The class is included within a seperat jar file which does not
    have any
    EJBs in it. How do I add this to the application xml so it is available
    to all
    the ejb modules within the ear?
    Thanks in advance

  • Deployment Tool Error - unknown document type - Add to Application EJB jar

    I am creating a new application in the J2EE deployment tool and adding an EJB JAR to it. The jar contains the ejb-jar.xml file. This file has the standard doctype:
    <!DOCTYPE ejb-jar PUBLIC
    '-//Sun Microsystems, INC.//DTD Enterprise JavaBeans 1.1//EN'
    'file:/C:/j2sdkee1.3/lib/dtds/ejb-jar_2_0.dtd'>
    I get the Unknown Document Type error when I try to add this jar to the application:
    Error: Adding EJB JAR - java.lang.RuntimeException: Invalid XML : Unknown document type : org.apache.crimson.tree.Doctype@e8647
    The xml file validates fine in NetBeans 3.4. I use NetBeans to generate the jar file.
    Any ideas as to what is happening would be appreciated.

    Try replacing the DTD definition as specified below.
    http://java.sun.com/dtd/ejb-jar_2_0.dtd
    regards,
    Siddique

  • How to deploy jar file in WLS using ant script

    Hi,
    Im trying to deploy a jar file in weblogic 10.3 using ant script and am running into the below error.
    +[wldeploy] weblogic.management.DeploymentException: [J2EE:160177]The application at "/u01//RSJBObjects.jar" was not recognized as a valid application type. If this is an EAR file, please ensure the META-INF/application.xml exists. EJB-JARs should have a META-INF/ejb-jar.xml or corresponding annotations exist. If this is an exploded WAR, the name of directory must be end with ".war". RARs require a META-INF/ra.xml. A JMS deployment should be an XML file whose name ends with "-jms.xml". A JDBC deployment should be an XML file whose name ends with "-jdbc.xml". For other application types, please consult the WebLogic Server documentation.+
    When i try to deploy the same manually from the console, i get a warning stating that WLS thought this as a library and hence proceeding to deploy as a library. After this warning the deployment continues and completes.
    Problem is when i try to deploy using ant, it breaks at this point.
    Is there any means that we can deploy a jar to WLS using ant script. This has to be deployed as a library as other apps would be using this jar.
    Im unable to create a ear file for this single jar file.
    If there is any suggestion on can this be done, please share.
    Thanks,
    Vijay.

    Hi Sunil,
    Thanks for the reply, it worked.
    Another doubt on the same lines. Now that the jar has been deployed as a library in WLS, when i try to deploy a WAR which refers to this deployed jar library, im unable to. I run into and error stating that the library is inaccessible.
    I have to bounce the server and before doing that, i have to manually copy the library.jar from <WLS_domain>/servers/AdminServer/upload/ directory to <WLS_domain>/lib/ directory, once copied i then try to deploy the WAR, then the deployment goes fine.
    Is there any means that this deployed library jar be made available soon after deployment and also to avoid copying the file.
    Thanks,
    Vijay.

  • Packaging JAR's using Ant in Eclipse

    Hey,
    I'm new to Ant, and xml for that matter. I need to rmi compile & package a set of simple classes whose objects call eachother remotely. I need seperate jars for a "server" and one for "client" containing whatever classes are needed for each. Using Ant the classes should be compiled, packaged into the jars and then the jars should be copied to some other specified directory. And of course, the jars should be executable.
    The files I use are AddressBook (interface extends Remote), AddressBookImpl (extends UnicastRemoteObject implements AddressBook), BuddyInfoInterf (interface extends Remote), BuddyInfo (the implementation, extends Unicast... implements BuddyI...), and AddressBookUser.
    The AddressBook is created on the server-side (in main() found in AddressBookImpl) and is populated with BuddyInfo's also created server-side.
    AddressBookUser is just the client accessing some info from ABook or BInfo.
    So, anyway, here's the xml file I've written to do the tasks assigned. The classes compile fine, and the jar files seem to contain the proper files. My problem is that the jar files don't execute properly. The main() in AddressBookImpl creates the ABook and binds it to the rmiregistry. When I run the server.jar that is "initially" created during the process (the one in the base dir) it works fine but this only seems to work correctly because it's in the same dir as all of the compiled classes. The copied jar file in the other directory, or even if I manually copy the server.jar file in the base dir to some other dir, causes an exception when trying to bind the AddressBook to the registry saying it can't find a stub that is definitely located in the jar. And I'm running the rmiregistry in whatever dir the server.jar is in each time:
    Exception in thread "main" java.rmi.ServerException: RemoteException occurred in
    server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
    java.lang.ClassNotFoundException: AddressBookImpl_Stub
    at sun.rmi.server.....
    <?xml version="1.0"?>
    <project default="packaging">
    <!-- Change location(s) to desired path(s) where client and/or
    server jar files should be copied to, else will create folders
    "client" and "server" in project directory and copy them to
    there. -->
    <property name="serverDir" location="./server"/>
    <property name="clientDir" location="./client"/>
    <!-- performs all tasks -->
    <target name="packaging">
         <!-- Compiles all files in project directory. Necessary for
         AddressBookUser.java to be compiled -->
         <javac srcdir="."/>
         <!-- RMI compiles AddressBookImpl & BuddyInfo -->
         <rmic classname="AddressBookImpl" base="."/>
         <rmic classname="BuddyInfo" base="."/>
         <!-- Creates server jar file -->
         <jar destfile="./server.jar" basedir="." includes="**.class" excludes="AddressBookUser.**">
              <manifest>
                   <attribute name="Main-Class" value="AddressBookImpl"/>
                   <attribute name="Class-Path" value="."/>
              </manifest>
         </jar>
         <!-- Creates client jar file -->
         <jar destfile="./client.jar" basedir="." includes="**.class" excludes="AddressBookImpl.** BuddyInfo.** **Skel.class">
              <manifest>
                   <attribute name="Main-Class" value="AddressBookUser"/>
                   <attribute name="Class-Path" value="."/>
              </manifest>
         </jar>
         <!-- copy jar files to specified directories -->
         <copy file="./server.jar" todir="${serverDir}"/>
         <copy file="./client.jar" todir="${clientDir}"/>     
    </target>
    </project>
    Sorry bout the length. Just want to cover my bases. Thanks for any help.

    I am also having problem in building server.jar file using Ant. I am using EJB jar file in my web application, this jar file is called remotely from server to client. Client.jar file working correctly but the server.jar file contains error which is given below:
    15:30:47,296 WARN [verifier] EJB spec violation:
    Bean : Server
    Section: 22.2
    Warning: The Bean Provider must specify the fully-qualified name of the Java cla
    ss that implements the enterprise bean's business methods in the <ejb-class> ele
    ment.
    Info : Class not found on 'com.ejb.ServerBean': No ClassLoaders found for: com.ejb.ServerBean
    15:30:47,296 ERROR [MainDeployer] Could not create deployment: file:/C:/jboss-4.0.4.GA/server/default/deploy/server.jar
    org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
    In above error, "Class not found on 'com.ejb.ServerBean' " is given. Will there be all the classes of EJB jar file in server.jar ? I think only the interface class file i.e. Server.class and serverHome.class must be included, am I correct or not?
    Also the build.xml which I am using for creating server.jar is given below:
    <project name="ServerEJB" default="make_server_jar" basedir=".">
    <!-- Initialization variables -->
    <property environment="env" />
    <property name="app.name" value="${ant.project.name}"/>
    <property name="source.dir" value="ejbModule"/>
    <property name="build.dir" value="build"/>
    <property name="classes.dir" value="${build.dir}/classes"/>
    <property name="distribution.dir" value="dist"/>
         <property name="server.ejb.jar.name" value="server.jar"/>
    <target name="clean" description="Deletes compiled and generated code">
    <delete dir="${build.dir}"/>
    </target>
    <target name="make_server_jar" depends="" description="Builds a server.jar with stubs for apps to use">
    <mkdir dir="${distribution.dir}" />
    <jar destfile="${distribution.dir}/${server.ejb.jar.name}" basedir="${classes.dir}">
         <exclude name="**/*Bean.class"/>
    </jar>
    </target>     
    </project>
    I am using server.jar file in server as interface which will remotely call client.jar which will be kept at client location.
    Anybody, can you provide me with the solution for this problem?...
    Thank you.

  • Deployment problems when using several ejb-jar files

    Hello All,
    I am having problems with deployment of my J2EE application. My EAR file has several EJB-JARs, one for each entity bean. However I refer to the other EJBs in one EJB. Hence I included the <ejb-ref> element in the deployment descriptor of the entity bean. But I am getting the deployment error that "the bundle does not contain the bean name". I tried to change the <ejb-name> value (within the <ejb-ref> element) to the JNDI name of the EJB I am referring to, and also added the <ejb-link> tag specifying the location of the JAR file that has the EJB. None of the attempts worked.
    Can someone help me out on how I am supposed to go about when I have several ejb-jar files as opposed to a single one? I am deploying my app on Sun ONE AS 7.0.
    Thank you,
    PS: I am posting this message on several forum topics. Please disregard this message if you have seen/answered this message. Thanks.

    Hi ,
    It would help if you could post the relevant snippets of your
    ejb-jar.xml. In general, you definitely shouldn't use jndi-name
    for any of the linking information. jndi-name is not part of the
    standard deployment descriptor. The syntax for the ejb-link is
    [ejb-jar uri]#ejb-name
    K

  • Can't create a JAXB binding for ejb-jar.xml using xjc

    Hi all,
    I have been trying to build a JAXB binding for EJB deployment descriptors, mainly because I have to update a hand-cranked ejb-jar.xml file on the fly with some additions that have come from a code generator.
    I have tried to use
    xjc ejb-jar_2_1.xsd j2ee_1_4.xsd ejb-jar_2_1.xsd
    xjc on the schema definitions I found at http://java.sun.com/xml/ns/j2ee/ but I can't get it to work. It produces reams of errors, see below for a short extract.
    Of course, someone could put me out of my misery and tell me where to find a binding that someone else has done. I can't be the first chimp on the planet that has wanted to do this!
    Any help much appreciated.
    errors:
    [WARNING] warning: "blockDefault" attribute of <schema> is not supported
    line 3 of xml.xsd
    [WARNING] warning: "finalDefault" attribute of <schema> is not supported
    line 3 of xml.xsd
    [WARNING] warning: <key> identity constraint will be ignored by JAXB validation
    line 117 of j2ee_web_services_client_1_1.xsd
    [WARNING] warning: <key> identity constraint will be ignored by JAXB validation
    line 115 of ejb-jar_2_1.xsd
    [WARNING] warning: <keyref> identity constraint will be ignored by JAXB validation
    line 129 of ejb-jar_2_1.xsd
    [WARNING] warning: <key> identity constraint will be ignored by JAXB validation
    line 145 of ejb-jar_2_1.xsd
    [WARNING] warning: <keyref> identity constraint will be ignored by JAXB validation
    line 159 of ejb-jar_2_1.xsd

    Exception initializing 'oracle.dbtools.raptor.MonitorJDBCAddin' in extension 'Oracle SQL Developer': oracle.classloader.
    util.AnnotatedNoClassDefFoundError:
    Missing class: oracle.jdbc.OracleDriverThe Oracle driver is not on the classpath.

  • Can't I use the comment in weblogic-ejb-jar.xml?

    Hi, I am migrating to WebLogic Server 6.1 from 5.1.
    And for the weblogic-ejb-jar.xml,
    the following error occurs:
    ERROR: Error parsing 'META-INF/weblogic-ejb-jar.xml' line 14: An invalid XML character
    (Unicode: 0xb8) was found in the comment.
    ERROR: ejbc found errors
    The errorneous line is the following comment. (it's fine in 5.1)
    <!-- if false, ... -->
    Must I remove this comment?
    Thanks in advance.

    I used Korean language in comment.
    But the charset of XML was iso-8859-1.
    Sorry.
    "mariah" <[email protected]> wrote:
    >
    Hi, I am migrating to WebLogic Server 6.1 from 5.1.
    And for the weblogic-ejb-jar.xml,
    the following error occurs:
    ERROR: Error parsing 'META-INF/weblogic-ejb-jar.xml' line 14: An invalid
    XML character
    (Unicode: 0xb8) was found in the comment.
    ERROR: ejbc found errors
    The errorneous line is the following comment. (it's fine in 5.1)
    <!-- if false, ... -->
    Must I remove this comment?
    Thanks in advance.

  • Entity type "EJB-JAR" may not be used in public part "ejbjar_api"

    Experts,
    Can you please help me to identify why the error 'Entity type "EJB-JAR" may not be used in public part "ejbjar_api", unsupported purpose.' appears on NWDS while creating a project on a DC and how can this be resolved.
    Thanks in advance
    -Lave

    Hi Jain,
    is the error message that the public part is not found prefixed with [dcmake]? If yes that rather points in the direction that there is a problem with the metadata information. (PP name not correctly spelled, renamed after initial creation, perhaps even some problems with upper/lower-case letters depending on your platform.)
    What SP are you using? The log looks like some rather old build plugins are used on a newer NWDI installation.
    The warning from the [wdgen] task and the subsequent failure of the [wdminimizer] can be ignored. "ERROR: Non Fatal Error" is a bit quaint, but it really is not fatal. It just means that the minimizer didn't find the data required to operate. The [wdgen] warning means that the WebDynpro generator could not write the information. So the jar files in your public part are maybe a bit bigger than necessary but that's all.
    Best regards,
    Marc

  • Use of env-entry in ejb-jar

    In my ejb-jar.xml I have a Session bean with a env-entry:
    <env-entry>
    <env-entry-name>xslNameFile</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>pdftemplate.xsl</env-entry-value>
    </env-entry>
    In a class where I use the bean I make a lookup of this env-entry (using the same
    context):
    Context environment = (Context)ctx.lookup("java:comp/env/");
    val = (String)environment.lookup("xslNameFile");
    And I have the following Exception:
    javax.naming.NameNotFoundException: Unable to resolve 'comp/env/xslNameFile' Reso
    lved: 'comp/env' Unresolved:'xslNameFile' ; remaining name 'xslNameFile'
    What I m doing wrong??
    Could anyone help me?
    Thanks
    F.Canonica

    HI ,
    The Primary Purpose of <env-entry> tag
    is used to Customize your bean at Runtime
    and to Make your bean as an DataDriven one.
    ( instead of Storing it in DataBase )
    Regards
    Karthikeyan Gangadharan
    "Deepak Vohra" <[email protected]> wrote:
    >
    >
    >
    InitialContext ic = new InitialContext();
    String val = (String) ic.lookup("java:/comp/env/xslNameFile");
    "canonica" <[email protected]> wrote:
    In my ejb-jar.xml I have a Session bean with a env-entry:
    <env-entry>
    <env-entry-name>xslNameFile</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>pdftemplate.xsl</env-entry-value>
    </env-entry>
    In a class where I use the bean I make a lookup of this env-entry (using
    the same
    context):
    Context environment = (Context)ctx.lookup("java:comp/env/");
    val = (String)environment.lookup("xslNameFile");
    And I have the following Exception:
    javax.naming.NameNotFoundException: Unable to resolve 'comp/env/xslNameFile'
    Reso
    lved: 'comp/env' Unresolved:'xslNameFile' ; remaining name 'xslNameFile'
    What I m doing wrong??
    Could anyone help me?
    Thanks
    F.Canonica

  • Use of externally-defined/ in weblogic-ejb-jar.xml

    I am trying to use Global Roles defined via the Weblogic console to control access to EJB methods.
    I am using the <externally-defined/> tag in security role assignments, however when I deploy to Weblogic I get the following error :
    <8/09/2004 04:21:42 PM GMT+10:00> <Error> <Deployer> <BEA-149205> <Failed to initialize the application appsdirmars-marketdata_ear due to error weblogic.manag
    ement.ApplicationException: Prepare failed. Task Id = null
    Module Name: ejb-marketdata.jar, Error: [EJB:011024]The XML parser encountered an error in your deployment descriptor. Please ensure that your deployment descriptor corresponds to the format in the DTD. The error was:
    Error parsing file 'META-INF/weblogic-ejb-jar.xml' at line: 51 column: 26. Element type "externally-defined" must be declared..
    at weblogic.j2ee.J2EEApplicationContainer.checkForErrors(J2EEApplication
    Container.java:1612)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:1207)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:1051)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:823)
    at weblogic.management.deploy.slave.SlaveDeployer$Application.prepare(Sl
    aveDeployer.java:2925)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareAllApplications
    (SlaveDeployer.java:967)
    at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.j
    ava:349)
    at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resum
    e(DeploymentManagerServerLifeCycleImpl.java:229)
    at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
    at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:966)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:361)
    at weblogic.Server.main(Server.java:32)
    I am running Weblogic 8.1 SP3 on Windows XP Pro.
    The XML is valid for the specified DTD according to my XML editor.
    The relevevant fragment from weblogic-ejb-jar.xml is included below.
    Any help much appreciated.
    Gavin.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN" "http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd">
    <weblogic-ejb-jar>
    <security-role-assignment>
    <role-name>MarsAdmin</role-name>
    <externally-defined/>
    </security-role-assignment>
    <security-role-assignment>
    <role-name>MarsViewer</role-name>
    <externally-defined/>
    </security-role-assignment>
    </weblogic-ejb-jar>

    I tried using the <global-role/> tag instead - this does deploy without any errors - but when I call the secure EJB method I get the Security Violation error below.
    The DTD says using the <global-role/> tag is fine, albeit deprecated, but the Weblogic 8.1 manual says this has been replaced by <externally-defined/>, so I'm not sure if this should work or not.
    [EJB:010160]Security Violation: User: 'ghughes' has insufficient permission to access EJB: type=<ejb>, application=_appsdir_mars-marketdata_ear, module=ejb-marketdata.jar, ejb=marketdata.MarketDataManager, method=getEnergyOverview, methodInterface=Remote, signature={java.util.Date}.
    So on the whole I'd prefer to work out why Weblogic isn't recognising <externally-defined/> - I've included the full deployment descriptor below - I'm generating it using the latest snapshot of XDoclet - is the DTD specified correct for Weblogic 8.1 SP3 ? (It matches the one specified in http://e-docs.bea.com/wls/docs81/ejb/DDreference-ejb-jar.html - but I can't think of anything else that could be wrong).
    Any tips much appreciated as I need to enable an administrator to customise these roles at runtime rather than hard-coding the role - group mappings into the deployment descriptors.
    Thanks,
    Gavin.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN" "http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd">
    <weblogic-ejb-jar>
    <description><![CDATA[Generated by XDoclet]]></description>
    <weblogic-enterprise-bean>
    <ejb-name>marketdata.MarketDataManager</ejb-name>
    <stateless-session-descriptor>
    </stateless-session-descriptor>
    <reference-descriptor>
    </reference-descriptor>
    <jndi-name>marketdata.MarketDataManager</jndi-name>
    <local-jndi-name>marketdata.MarketDataManagerLocal</local-jndi-name>
    </weblogic-enterprise-bean>
    <weblogic-enterprise-bean>
    <ejb-name>marketdata.MessageManager</ejb-name>
    <message-driven-descriptor>
    <pool>
    <max-beans-in-free-pool>5</max-beans-in-free-pool>
    <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
    </pool>
    <destination-jndi-name>FileTopic</destination-jndi-name>
    <connection-factory-jndi-name>JMSConnectionFactory</connection-factory-jndi-name>
    <jms-polling-interval-seconds>10</jms-polling-interval-seconds>
    <jms-client-id>1</jms-client-id>
    </message-driven-descriptor>
    <transaction-descriptor>
    <trans-timeout-seconds>10</trans-timeout-seconds>
    </transaction-descriptor>
    <reference-descriptor>
    </reference-descriptor>
    <enable-call-by-reference>True</enable-call-by-reference>
    </weblogic-enterprise-bean>
    <!--
    To add enterprise beans that you have deployment descriptor info for, add
    a file to your XDoclet merge directory called weblogic-enterprise-beans.xml that contains
    the <weblogic-enterprise-bean></weblogic-enterprise-bean> markup for those beans.
    -->
    <!-- xdoclet merge file -> weblogic-ejb-jar.xml -->
    <security-role-assignment>
    <role-name>MarsAdmin</role-name>
    <externally-defined/>
    </security-role-assignment>
    <security-role-assignment>
    <role-name>MarsViewer</role-name>
    <externally-defined/>
    </security-role-assignment>
    <idempotent-methods>
    </idempotent-methods>
    </weblogic-ejb-jar>
    Message was edited by [email protected] at Sep 8, 2004 8:45 PM

Maybe you are looking for