Override JNDI names in persistence.xml and @resource annotation

I have a Java EE 7 application that I am developing for use with both GlassFish and WildFly, but I have discovered that both application servers use a slightly different format for specifying JNDI names.
In GlassFish the persistence.xml file references the data source jdbc/myDataSouce, but in WildFly the data source needs to be java:/jdbc/myDataSource.The same is also true for classes that are annotated with @Resource. In GlassFish the annotation for a class using JavaMail would be @Resource(name = "mail/myMailSession"), but to deploy onto WildFly this would need to be @Resource(name = "java:mail/myMailSession").
The only solution I've got at present is using Maven to create two different releases of the EAR file, with one EAR file containing a persistence.xml file with the data source jdbc/myDataSouce for use with GlassFish, and the second EAR file containing a persistence.xml file with the data source java:/jdbc/myDataSource for use with WildFly. Unfortunately, I haven't found a solution for the @Resource annotation.
I've taken a look at the documentation for glassfish-application.xml and glassfish-ejb-jar.xml and have tried using resource-ref to override the JNDI names but the application fails to deploy due to an error in the name.
My question is does GlassFish provide any capability to override the JNDI names specified in the persistence.xml file and classes with the @resource annotation?
Many Thanks
Paul

Have you been able to solve this? I'm attempting to understand what Web Server 7 can do with regard to Java Persistence and what elements of it require Glassfish.
I've also spent great amounts of time in WS6.1 trying to figure out why a JNDI resource couldn't be found. The rules of thumb I've learned are:
- Try dropping the *'java:/comp/env/* prefix; just use jdbc/pact part
- Make sure all referrences (in web.xml and sun-web.xml) are identical with regard to that name.
I'm hoping you're not still dealing with this (it's been two months!) but if anybody else stumbles on this, maybe it'll help them.
Dave

Similar Messages

  • Files saved on memory stick on pc show as original file name followed by .XML and i cannot open why

    files saved on memory stick on pc show as original file name followed by .XML for example tester.doc.XML, is there any reason?  I cant open these on mac, if i put it back in PC is shows file as normal without .XML.  Confused.com any ideas.

    I have files on my work laptop (PC) e.g. document1.doc (word document), I then save it to my memory stick (which i have reformatted, I also tried my external disk drive) and then take that to my macbook, plug it in and in finder it then shows as document1.doc.XML, which i cannot open.  It happens to all types of files, it just seems to add .XML on the end of everything.

  • Orion-web.xml and resource-env-ref-mapping correct usage

    What happened to resource-env-ref-mapping element in orion-web.xml? I have a 9.0.4.1 server running several .EAR files containing web applications using this attribute to configure JMS related items. But when deploying the .EAR to newer versions (9.0.5.2) of the server this attribute doesn't appear to be valid any longer?
    Here it is in the 9.0.4 documentation:
    http://strogoff.unex.es/oradoc/form_y_report_10g/web.904/b10322/apdx_a.htm
    Any help would be appreciated?

    I should have been more clear about the issue. The error only occurs when running inside the embedded OC4J container of JDeveloper 10.1.2 build 1913. The error does NOT occur in JDeveloper 9.0.3. The application also runs fine when deployed to a 10.1.2 Enterprise application server. The error only occurs in JDeveloper.
    The following error occurs when validating my orion-web.xml file. The entry is:
    orion-web.xml:
    <orion-web-app>
    <resource-ref-mapping name="jms/mQueueConnectionFactory" location="jms/matchingQueueConnectionFactory"/>
    <resource-env-ref-mapping name="jms/mQueue" location="jms/matchingQueue"/>
    </orion-web-app>
    web.xml
    <resource-env-ref>
    <resource-env-ref-name>jms/mQueue</resource-env-ref-name>
    <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
    </resource-env-ref>
    java.lang.IllegalArgumentException: Unrecognized parent-elem combination: interface oracle.jdeveloper.xml.oc4j.war.OrionWebApp - resource-env-ref-mapping
         at oracle.javatools.xml.bind.XMLBinding.throwUnrecognizedElem(XMLBinding.java:127)
         at oracle.jdeveloper.xml.j2ee.war.WebAppBinding.elem2intImpl(WebAppBinding.java:637)
         at oracle.javatools.xml.bind.XMLBinding.elem2int(XMLBinding.java:104)
         at oracle.javatools.xml.bind.XMLBinding.insertBetween(XMLBinding.java:88)
         at oracle.javatools.xml.bind.BindingContext.insertNewElement(BindingContext.java:121)
         at oracle.javatools.xml.bind.BindingContext.insertElem(BindingContext.java:95)
         at oracle.javatools.xml.bind.BindingContext.setElement(BindingContext.java:71)
         at oracle.javatools.xml.bind.SetImpl.callSetterForUniqueElem(SetImpl.java:66)
         at oracle.javatools.xml.bind.SetImpl.callSetter(SetImpl.java:57)
         at oracle.javatools.xml.bind.SetImpl.invoke(SetImpl.java:26)
         at oracle.javatools.xml.bind.ElementProxy.invoke(ElementProxy.java:35)
         at $Proxy10.setWebApp(Unknown Source)
         at oracle.jdevimpl.runner.oc4j.Oc4jWorkspaceConfig.ensureLocalPageReposRootIsSet(Oc4jWorkspaceConfig.java:633)
         at oracle.jdevimpl.runner.oc4j.Oc4jWorkspaceConfig.transmogrifyConfigFiles(Oc4jWorkspaceConfig.java:269)
         at oracle.jdevimpl.runner.oc4j.Oc4jWorkspaceConfig.configureAll(Oc4jWorkspaceConfig.java:114)
         at oracle.jdevimpl.runner.oc4j.Oc4jStarter.preStart(Oc4jStarter.java:618)
         at oracle.jdevimpl.runner.oc4j.Oc4jStarter.start(Oc4jStarter.java:268)
         at oracle.ide.runner.RunProcess.startTarget(RunProcess.java:756)
         at oracle.jdeveloper.runner.JRunProcess.startTarget(JRunProcess.java:461)
         at oracle.ide.runner.RunProcess$2.run(RunProcess.java:699)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

  • Weblogic 10.3 - changing jndi-name with deployment plan fails

    I was trying to alter the global jndi name of a stateless ejb by using a deployment plan, but can't get it to work.
    - to be able to replace it later on with a deployment plan, I specify a jndi-name in weblogic-ejb-jar.xml (so I do not use the @mappedName)
    e.g.
    <?xml version="1.0" encoding="UTF-8"?>
    <weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/10.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/10.0 http://www.bea.com/ns/weblogic/10.0/weblogic-ejb-jar.xsd">
         <weblogic-enterprise-bean>
              <ejb-name>ExampleService</ejb-name>
              <enable-call-by-reference>true</enable-call-by-reference>
              <stateless-session-descriptor>
                   <business-interface-jndi-name-map>
                        <business-remote>com.example.ExampleServiceRemote</business-remote>
                        <jndi-name>com.example.ExampleService#com.example.ExampleServiceRemote</jndi-name>
                   </business-interface-jndi-name-map>
              </stateless-session-descriptor>
         </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    - during deployment I specify a deploymentPlan with following content:
    <variable-definition>
    <variable>
    <name>ejb_jndiname_ExampleService</name>
    <value>ExampleService</value>
    </variable>
    </variable-definition>
    <module-override>
    <module-name>ExampleService.jar</module-name>
    <module-type>ejb</module-type>
    <module-descriptor external="true">
    <root-element>weblogic-ejb-jar</root-element>
    <uri>meta-inf/weblogic-ejb-jar.xml</uri>
    <variable-assignment>
    <name>ejb_jndiname_ExampleService</name>
    <xpath>/weblogic-ejb-jar/weblogic-enterprise-bean/\[ejb-name="ExampleService"\]/stateless-session-descriptor/business-interface-jndi-name-map/\[business-remote="com.example.ExampleServiceRemote"\]/jndi-name</xpath>
    <operation>replace</operation>
    </variable-assignment>
    </module-descriptor>
    </module-override>
    - after deployment, the original jndi-name ("com.example.ExampleService#com.example.ExampleServiceRemote") is active in the jndi tree instead of "ExampleService"
    p.s. When I specified the jndi-name in weblogic-ejb.jar.xml as
         <weblogic-enterprise-bean>
              <ejb-name>ExampleService</ejb-name>
              <enable-call-by-reference>true</enable-call-by-reference>
              <jndi-name>com.example.ExampleService#com.example.ExampleServiceRemote</jndi-name>
         </weblogic-enterprise-bean>
    and the replace in the deployment plan as
    <variable-assignment>
    <name>ejb_jndiname_SecurityService</name>
    <xpath>/weblogic-ejb-jar/weblogic-enterprise-bean/\[ejb-name="ExampleService"\]/jndi-name</xpath>
    <operation>replace</operation>
    </variable-assignment>
    the replacement does work (checked by verifying the jndi-name within the deployed ear using the console), but the problem then is that the jndi-name does not appear in the jndi tree (that's why I tried the <business-interface-jndi-name-map>)
    Any ideas?
    Kind regards,
    Ben
    Edited by: user11230128 on 4-jun-2009 7:42

    After a Service Request and some trial and error, I got it to work after adding the following part in each 'jar module override' section of the deployment plan:
    <module-descriptor external="false">
    <root-element>ejb-jar</root-element>
    <uri>META-INF/ejb-jar.xml</uri>
    </module-descriptor>
    Apparantly this is needed even though there is no ejb-jar.xml in the jar.
    So the deployment plan has to be something like:
    <variable-definition>
    <variable>
    <name>ejb_jndiname_ExampleService</name>
    <value>ExampleService</value>
    </variable>
    </variable-definition>
    <module-override>
    <module-name>ExampleService.jar</module-name>
    <module-type>ejb</module-type>
    <module-descriptor external="false">
    <root-element>weblogic-ejb-jar</root-element>
    <uri>meta-inf/weblogic-ejb-jar.xml</uri>
    <variable-assignment>
    <name>ejb_jndiname_ExampleService</name>
    <xpath>/weblogic-ejb-jar/weblogic-enterprise-bean/[ejb-name="ExampleService"]/stateless-session-descriptor/business-interface-jndi-name-map/[business-remote="com.example.ExampleServiceRemote"]/jndi-name</xpath>
    <operation>replace</operation>
    </variable-assignment>
    </module-descriptor>
    <module-descriptor external="false">
    <root-element>ejb-jar</root-element>
    <uri>META-INF/ejb-jar.xml</uri>
    </module-descriptor>
    </module-override>
    ...

  • Persistence.XML configuration

    Hello,
    I develop web application and use it with following environment:
    Server: JBoss As 4.2.3.GA
    Technology: EJB 3.0
    Database : Oracle,SQLServer,MYSQL
    my problem is : when i deploy ear ,for some places i need to connect one type of database (Oracle for example), also for another places i need to connect to other databases and i have to change dialects for every database ,build it and then deploy.
    Is there any other way to build only once and connect to any of the databases without modifying persistence.xml for every time?

    Is the application accessing multiple databases at the same time? If so, you can define multiple persistence units in your persistence.xml.
    or is it that the application accesses only one database but you sometimes deploy it against different database types (perhaps a test environment vs a prod one). In that case you should look at supplying the hibernate and database configurations on the application server (details are application server specific). The persistence.xml would only contain the JNDI name of the datasource and then you only change the settings in datasource file on the server to point to different databases. Remember the dialect is actually optional as hibernate usually picks the right oneanyway.

  • Persistence.xml location

    Hi.
    I have an application, and want to be able to point it at a different db instance (same schema,etc).
    I could obviously change the persistence.xml in the jar, but this is cumbersome, and not very easy to do.
    Is it possible to place the persistence.xml outside of the jar and reference it in the classpath somehow?
    Regards,
    Andy Morton

    If you have a proper JEE application is deployed in some application server (eg Glassfish), simply don't put any database configuration in the persistence.xml and use a JDBC Connection configured in the application server console. Just include the data source name in the persistence.xml and configure your JDBC data source to have that name in the JNDI. For example we have:
    <jta-data-source>jdbc/OURJPADATASOURCE</jta-data-source>
    <mapping-file>META-INF/orm-live.xml</mapping-file>at the top of our persistence.xml, and that's it. The logical name is found in JNDI and the database can be altered externally.
    For our "test" environments, these can run against a variety of different databases, outside of a JEE server. So we use Spring to set up the objects necessary for JPA to work against the selected database for each test. This also has the advantage of allowing us to configure a special persistence.xml file used only for testing. For example, this Spring config causes our tests to run against an HSQL in-memory database (Our tests are subclassed from Spring's AbstractJpaTests class) :-
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:context="http://www.springframework.org/schema/context"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xmlns:util="http://www.springframework.org/schema/util"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                               http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
                               http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
                               http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
         <context:annotation-config/>
         <tx:annotation-driven  transaction-manager="h8TransactionManager"/>
         <alias alias="dataSource" name="hsqlDataSource"/>
         <bean id="hsqlDataSource"
               class="org.springframework.jdbc.datasource.DriverManagerDataSource">
              <property name="driverClassName"      value="org.hsqldb.jdbcDriver"/>          
              <property name="url"                value="jdbc:hsqldb:mem:testdb"/>          
              <property name="username"           value="sa"/>          
              <property name="password"           value=""/>     
         </bean>
         <bean id="h8JPAVendorAdapter"
               class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
              <property name="showSql"           value="false"/>
              <property name="generateDdl"           value="true"/>
              <property name="database"           value="HSQL"/>
         </bean>
         <alias alias="entityManagerFactory" name="h8EntityManagerFactory"/>
         <bean id="h8EntityManagerFactory"
               class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
             <property name="dataSource"              ref="dataSource"/>
             <property name="jpaVendorAdapter"        ref="h8JPAVendorAdapter"/>
             <property name="persistenceXmlLocation"  value="classpath:/test/jpa/persistence.xml"/>
             <property name="persistenceUnitName"     value="PUNAME"/>
         </bean>
         <alias alias="transactionManager" name="h8TransactionManager"/>
         <bean id="h8TransactionManager"
               class="org.springframework.orm.jpa.JpaTransactionManager">
              <property name="entityManagerFactory"      ref="h8EntityManagerFactory"/>
              <property name="dataSource"           ref="dataSource"/>
         </bean>
         <bean id="jpaType" class="biz.wss.jpa.JPAType" factory-method="valueOf">    
             <constructor-arg value="HIBERNATE"/>
         </bean>Hope that helps a bit...
    Ed
    Edited by: edrandall on Mar 20, 2009 9:24 AM

  • Java Persistence API and creation of databases

    Hi All
    I have designed a small address book application which uses a database to store the information. I have used the new Java Persistence API to take care of my transactions and querrys with the database. This works great for one set database which is generated the first time the application runs and is used all the time.
    However I would like to make it so that the user can create a new address book (database) with a different name, I am not sure how I would do this using the Java Persistence API. I know the persistence.xml file must be placed in the META-INF directory of the source, so how would I be able manipulate the file or could I place the file somewhere else.
    David

    I am using the Derby database. I can create a database by passing the create command when I create the entity Manager like so:
    Connection c = DriverManager.getConnection("jdbc:derby:AddressBook;create=true", "app", "app");My problem is that as I understand it the persistence.xml file must know the name of the database. Unless there is another way of setting this. The line in the persistence file I am referring to is:
    <property name="toplink.jdbc.url" value="jdbc:derby:AddressBook"/>I wonder if I can progamatically set this value so that I have a default database in the persistence.xml and others can then create there own.
    David

  • Question about persistence.xml

    Hi,
    I have two persistence units in one persistence.xml file. When I deploy my ejb3 file, my Car entity bean (@Entity) creates two tables in the database (one for each persistence-unit). I want the table created in only one persistence-unit. How I tell to the entity bean what persistence-unit it has to use and what it has not?
    Thanks
    Luiz Carlos

    Ok,
    I find a way.
    All I have to do was put the property
    <property name="hibernate.archive.autodetection" value="false"/>
    in the persistence.xml and define the classes I wanna to use with
    <class>SomeClass</class>
    <class>AnotherClass</class>
    It was too much work but was the only way I found..
    Thanks anyway
    Luiz Carlos

  • Multiple JNDI names for EJB?

    If I'm deploying a webapp that references an EJB, do I have to use the same JNDI
    name that is configured in the EJB descriptor?
    Why can't I reference the EJB using a seperate name (as in some J2EE examples)?
    Thanks,
    Darren

    darren <[email protected]> wrote:
    If I use a new JNDI name, rather than the one defined in weblogic-ejb-jar.xml,
    it does not show up in the JNDI tree.
    Does the JNDI name referenced in weblogic.xml need to be the same as that defined
    in weblogic-ejb-jar.xml? No. ejb-ref mechanism allows you to map an actual ejb jndi name to one used by your
    application - so, in theory, system administrator can change jndi names without
    touching your application code. You do not see it in the global JNDI tree because
    this mapping exists only in the context of your application.
    <[email protected]> wrote:
    That's what ejb-ref in web.xml is for - you can create an ejb-ref in
    web.xml
    and map it to an actual jndi name in weblogic.xml ejb-reference-description.
    Darren <[email protected]> wrote:
    If I'm deploying a webapp that references an EJB, do I have to usethe same JNDI
    name that is configured in the EJB descriptor?
    Why can't I reference the EJB using a seperate name (as in some J2EEexamples)?
    Thanks,
    Darren--
    Dimitri
    Dimitri

  • Cannot open persistence.xml nor orm.xml

    I had to kill JDev process after I realized Data Control could not be created on a session EJB since application was not created with JSF,EJB technology. JDev kept trying to create Data Control. I left it trying over night and in the morning I killed process. I restarted JDev and tried to open files persistence.xml and orm.xml, but JDev just showed up message "Loading...Please wait." and it was stuck with that message. I could open all other files except these two XML files.
    Is there a workaround?

    CG_AUDIO wrote:
    Has anyone been able to open a pages file that has the cannot open .xml required error?
    I opened a doc from pages'08 in pages'09 made some crucial changes saved as new name and cannot open it again now.
    I tried opening in '08 and of course no luck.
    I just finished 3 hours of writing and cannot do that again!!!
    3 hours of writing without no intermediate save in different files is silly.
    Attach the file to a mail
    send them to my maibox.
    I will try to revive the raw text.
    Click my blue name to get my address.
    IMPORTANT: search for the keystring _"backup, backup"_ in existing threads !
    Yvan KOENIG (VALLAURIS, France.) jeudi 20 août 2009 20:09:19

  • Cannot change table-name in persistent.xml

    I've successful deployed a Entity EJB on "SAP Enterprise Portal 6.0 SP4 NetWeaver Developer Sneak Preview"
    After changing the Table Name in persistent.xml and re-deploying the new EAR, the Entity EJB still writes to the old table.
    How can I get SAP Web AS to accept the new persistent.xml/persistent-ejb-map/entity-beans/entity-bean/table-name entry ?
    I've already tried:
    1) Re-deploy EAR and re-boot the server
    2) Delete all old copies of EAR directories and temporary files, reboot and re-deploy.
    Note: Expanding new EAR confirms that persistent.xml/table-name has been updated on the SAP Web AS.  However, EJB still writes to the old table.
    Alton

    In Web AS 6.40 the application data is stored in the database, therefore it is restored even if you delete the folders in the file system.
    To undeploy the application, you can use the Deploy Service runtime in Visual Administrator. Start the Visual Administrator using the <i>go</i> script file in <drive>:\usr\sap\<SID>\JC00\j2ee\admin. Then expand the <i>Services</i> tree under the server node, and choose <i>Deploy</i>. On the right-hand side of the screen switch to <i>Application</i> view, select your application, and choose <i>Remove</i>.
    Zornitsa

  • Rename persistence.xml

    I wrote a utility that will be reused by web-apps and relies on JPA. Those web-apps will likely also rely on JPA. This implies 2 persistence.xml files in the classpath... which can lead to conflicts (and according to posts I read - it does!).
    So I must rename persistence.xml and somehow tell the EntityManager to read the renamed file. I saw many posts on how to achieve it with Spring, but none on how to do it with vanilla JPA. I'd rather not go the Spring route since its JPA documentation is awful.
    Can it be done? If yes, how?
    Thanks

    I ended up solving the problem by using Spring. Spring has a mechanism that allows naming persistence.xml anything you want.

  • How to lookup EJB3 beans using JNDI names without defining ejb-ref in DD?

    Hi Kenneth,
    I am just continuing the topic:
    How Lookup SLSB from other SLSB? <HELP>
    http://forum.java.sun.com/thread.jspa?threadID=5117484&tstart=0
    (my original forums account failed, so I am using new one)
    if I am not seeking portability I should be able to lookup a bean directly through JNDI without using the ejb-ref. (I just want to see how it can be done)
    http://forum.java.sun.com/thread.jspa?forumID=13&threadID=751907
    http://www.theserverside.com/discussions/thread.tss?thread_id=16402
    I am using SJSAS PE 9.0 I am failing to lookup my beans from other beans directly without ejb-ref.
    Is there some sample code to look at?
    Thanks!

    Global JNDI names are vendor-specific and not known until deployment time. That is one
    of the main reasons the Java EE component environment model defines a level of
    indirection for accessing component dependencies. It is best to use either an ejb-ref
    or @EJB annotation when accessing EJBs from a Java EE component.
    If you choose not to, you just have to make sure the global JNDI name you use matches
    the one assigned to the target EJB. We have a lot of information on how this works
    in our EJB FAQ.
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
    If you're still encountering an error, please provide more specifics about your application,
    the code you're using for the lookup, and the error message you're receiving. Just
    saying "my looking fails" doesn't help us diagnose the problem :-)
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Adfm.xml and locating DataBindings

    I have some issues with this. This is the situation: Model and ViewController project. DataControls are used, made on a session bean in Model prject, referenced in ViewController project to display on a page etc. So it is standard use of data controls.
    Within embedded JDeveloper it works fine. Then I deploy it to Standalone OC4J. Error is:
    JBO-26001: XML File not found for the Container model/DataBindings.cpx
    So I figured out that the location that points to DataBindings is not correct. In Model project adfm.xml is, naturally, in the META-INF direktory, together with the persistence.xml and ejb-jar.xml.
    In the war file for the ViewController these files are also present. I guess that is because of dependency among projects, so the compiled source directory of Model project, together with the META-INF directory is under WEB-INF/classes/
    In war project adfm.xml is under WEB-INF/classes/META-INF, also persistence.xml and ejb-jar.xml.
    Now, when deployment starts, it just does not find jar files referenced in the persistence.xml. So I removed it, and deployment went on. But, once I get to display the page that uses bindings. I get error that it cannot locate DataBindings. I tried different combinations of paths, but it doesn't work.
    Without adfm.xml file, of course, application cannot locate bindings.
    So, here are the questions:
    1) What is the correct way to assemble this kind of project? Are the files ejb/jar.xml an persistence.xml needed in WEB-INF/classes/META-INF
    2) Where should the file adfm.xml be located in war archive and how should it reference the DataBindings?

    OK, after some trouble I have managed to get things up and running. I'm not sure how, but I have noticed one annoying thing with swtandalone tp4. If I deploy app, then undeploy it and deploy it again, the old version of module I changed with new deploy is not removed if I dont restart the server. So It happend I didnt notice some changes I made, then I made a clean start and it worked.
    Thanks anyway, Frank. The way things are going, I think Ill soon be here with more questions :)
    Message was edited by:
    mishaerror

  • Application deployment order with weblogic-ejb-jar.xml and jndi-name

    I have two applicatation working on Weblogic server v. 10.3.6.
    First of them creating one ejb stateless bean and creates JNDI maping for it (in weblogic-ejb-jar.xml file):
    <weblogic-enterprise-bean>
         <ejb-name>ConfigMenegerBean</ejb-name>
         <stateless-session-descriptor>
         <stateless-session-descriptor>
              <business-interface-jndi-name-map>
              <business-remote>package.ConfigurationSessionRemote</business-remote>
              <jndi-name>ConfigMeneger</jndi-name>
              </business-interface-jndi-name-map>
         </stateless-session-descriptor>
         <enable-call-by-reference>true</enable-call-by-reference>
         <jndi-name>ConfigMeneger</jndi-name>
    </weblogic-enterprise-bean>
    Second appication have to refer for this bean by JNDI using spring been lookup :
    <jee:jndi-lookup id="configManager" jndi-name="ConfigMeneger"/>
    I changed deployment order parameter for both apllication(first=100 and second=500) in order to first app start first and share bean by jndi to another application. Unfortuantelly I got an error :
    javax.naming.NameNotFoundException: Unable to resolve 'ConfigMeneger'. Resolved ''; remaining name 'ConfigMeneger'
    How can I configure deployment order that first application make jndi mapping for bean, before the second application will use it ?

    Ok in a way I have solved my problem (even if I am not completely satisfied by the way on how to proceed...). So thanks to message "JBuilder7.0 and Weblogic6.1" on EJB sun forum :
    http://forum.java.sun.com/thread.jsp?thread=285735&forum=13&message=1255488
    I have tried the following actions (mentionned in the other forum messages):
    - To preserve changes to weblogic*.xml, the safest way is to change the ejb-borland.xml.
    (I am not sure that I have applied this advice correctly, because I suppose that syntax is not similar in weblogic file or borland file).
    And you can MANUALLY update the weblogic file in your JAR archive.
    1. Open the EJB JAR file in Winzip and extract the weblogic-ejb-jar.xml file, so that a copy exists in your
    project directory.
    2. Open this file (in Notepad), add the WebLogic specific information, and then save the file.
    3. Now, when you are finished with the build cycle and are ready to deploy, you may open the EJB jar file
    and swap in the weblogic-ejb-jar.xml file."
    Good Luck.

Maybe you are looking for