URL Resource and JNDI Replication

Do URLResources get replicated in the JNDI tree?

JDBC resource can be created using asadmin command.
Its a two step process.
First JDBC connection pool has to be created using following command.
asadmin create-jdbc-connection-pool user admin password adminadmin host fuyako port 7070 datasourceclassname XA restype jax.sql.DataSource
isolationlevel serializable isconnectvalidatereq=true validationmethod auto-commit description "XA Connection" --property DatabaseName="jdbc\:pointbase\:server\:\/\/local
host\/sample" :User=public:Password=public XA_connection_pool
Next JDBC resource has to be created using the following command.
asadmin create-jdbc-resource --user admin --password adminadmin --host fuyako --port 7070
--connectionpoolid XA_connection_pool --description
"creating a sample jdbc resource" sample_jdbc_resource
Please change the parameters as suitable to you.
The detailed description of these commands can be found as following URLs
http://java.sun.com/j2ee/1.4/docs/relnotes/cliref/hman1/create-connector-connection-pool.1.html
http://java.sun.com/j2ee/1.4/docs/relnotes/cliref/hman1/create-jdbc-resource.1.html

Similar Messages

  • EJB 3.0 @Stateless @EJB @Resource and JNDI clarity..

    Hi,
    I am trying to configure an EJB 3.0 but not able to do so properly.
    I have a single business interface and 2 bean implementation class of the same business interface doing different things. How do I access the EJB's if I have the same business interface class.I am getting JNDI error while trying to lookup.
    Also what does the "name" and "mappedName" in @Stateless(name ="...",mappedName="") signify.
    Then in case of Dependency injection,how should I look for the EJB? What would be it's JNDI name in this case?
    @EJB(name="",beanName="",mappedName="")
    private HelloEJB hello;
    What does the name,benaName and mappedName in case of an @EJB annotation signify??
    Please clear me with these attributes of @Stateless and @EJB and @Resource. I am getting toatlly confused with what should be the logic name and what is the JNDI name????
    Thanks

    In @Stateless, @name() is the annotation equivalent of <ejb-name> in ejb-jar.xml. It gives a unique bean name identifier to the component within the ejb-jar. It is completely independent of mappedName. If no @Stateless name() is specified, it defaults to the unqualified bean class name.
    In @Stateless, mappedName() is used to assign a global JNDI name to the bean's remote interface. This can be used to explicitly lookup the EJB reference to that interface or as one way to resolve a caller's EJB dependency.
    In @EJB, if the target of the dependency lives within the same application, you can always fully resolve it using only beanName(). beanName() takes the value specified in @Stateless name(), or the default as described above.
    @EJB name() assigns a name to the client dependency within the caller's component environment. It is optional. In most cases that value doesn't matter since if the dependency is being injected you never have to refer to the name() attribute anywhere else.
    @EJB mappedName() is used to resolve an EJB dependency that spans applications. It holds a global JNDI name, e.g. the one specified in @Stateless mappedName(). mappedName() is not required to be supported by all vendors.
    So, to sum it all up, it's fine to have two different beans that expose the same interface. E.g. :
    @Stateless(name="A1", mappedName="A1Global")
    public class A1 implements A { ... }
    @Stateless(mappedName="A2Global") // name() defaults to "A2"
    public class A2 implements A { ... }
    In a caller within the same application :
    @EJB(beanName="A1")
    private A a;
    @EJB(beanName="A2")
    private A a;
    In a caller within a different application :
    @EJB(mappedName="A1Global")
    private A a;
    @EJB(mappedName="A2Global")
    private A a;
    You can find additional information in our EJB FAQ :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#EJB_ejb-ref_ejb_local_ref

  • Jdbc resource and jndi

    1) How do I add a new jdbc resource.
    The tutorial
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/WebApp12.html#wp70019
    does it behind the scene with asant.
    2) What shall I do if I don't want to use a jdbc resource but a jndi resource which
    accesses a OpenLDAP server?

    JDBC resource can be created using asadmin command.
    Its a two step process.
    First JDBC connection pool has to be created using following command.
    asadmin create-jdbc-connection-pool user admin password adminadmin host fuyako port 7070 datasourceclassname XA restype jax.sql.DataSource
    isolationlevel serializable isconnectvalidatereq=true validationmethod auto-commit description "XA Connection" --property DatabaseName="jdbc\:pointbase\:server\:\/\/local
    host\/sample" :User=public:Password=public XA_connection_pool
    Next JDBC resource has to be created using the following command.
    asadmin create-jdbc-resource --user admin --password adminadmin --host fuyako --port 7070
    --connectionpoolid XA_connection_pool --description
    "creating a sample jdbc resource" sample_jdbc_resource
    Please change the parameters as suitable to you.
    The detailed description of these commands can be found as following URLs
    http://java.sun.com/j2ee/1.4/docs/relnotes/cliref/hman1/create-connector-connection-pool.1.html
    http://java.sun.com/j2ee/1.4/docs/relnotes/cliref/hman1/create-jdbc-resource.1.html

  • URL resources in weblogic

    Hi.
    Is there any way to setup java.net.URL resource on WebLogic server? I would like to acces it within EJB using JNDI lookup.
    IBM WebSphere has it (URL resources and URL providers), but I can't find any equivalent in WLS.
    Can anybody help me?
    Thanks!
    riva

    how about using virtual host?
    http://weblogic-wonders.com/weblogic/2010/11/19/virtual-hosts-configuration-with-weblogic-server/

  • How to configure a JNDI URL resource

    I am trying to replicate the Websphere's URL Resource provider functionality in Tomcat, but haven't been really successful. So what I would like to do is access a properties file from a URL. This provides a convenient approach to modifying prop files as apposed to residing within WAR file. Anyway back to my question, I have taken a stab at this and below is how my meta-inf\context.xml, web.xml, and jndi code snippet looks.
    CONTEXT.XML
    code:
    <?xml version="1.0" encoding="UTF-8"?><Context> <Resource name="url/wfresource" auth="Container" type="java.net.URL" url="http://localhost:8080/ibi_html/wfresource.properties"/></Context>
    WEB.XML
    code:
    <resource-env-ref>     <description>Object factory for MyBean instances.</description>     <resource-env-ref-name>url/wfresource</resource-env-ref-name>     <resource-env-ref-type>java.net.URL</resource-env-ref-type>     </resource-env-ref>
    JNDI Lookup code snippet
    code:
    //Get a handle to the JNDI environment naming contextContext env = (Context)new InitialContext().lookup("java:comp/env");//Get a single valuejava.net.URL destURL = (java.net.URL)env.lookup("url/wfresource");
    Its throwing an exception.
    My question is if URL resource configuration is possible in Tomcat 5.5, and if so how.
    thanks

    Problem solved in the original thread. If you are trying to do the same be sure to check it out (the SUN documentation is faulty):
    http://swforum.sun.com/jive/thread.jspa?threadID=62965&tstart=0
    I apologize for starting two threads on this.

  • Problem with creating Connection pool and JNDI, driver is not detected

    Hi,
    I have an issue with creating Connection Pool and JNDI.
    I'm using:
    - JDK 1.6
    - OS: Linux(ubuntu 8.10)
    - Netbeans IDE 6.5.1
    - Java EE 5.0
    - Apache Tomcat 6.0.18 Its lib directory contains all necessary jar files for Oracle database driver
    - Oracle 11g Enterprise
    My problem is that the Oracle database driver is not detected when I want to create a pool (it works pretty well and is detected without any problem when I create ordinary connection by DriverManager)
    Therefore after running:
    InitialContext ic = new InitialContext();
    Context context = (Context)ic.lookup("java:comp/env");
    DataSource dataSource = (DataSource)context.lookup("jdbc/oracle11g");
    Connection connection = dataSource.getConnection();and right after dataSource.getConnection() I have the following exception:
    org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'oracle.jdbc.OracleDriver'
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1136)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
    at servlets.Servlet1.doPost(Servlet1.java:47)
    at servlets.Servlet1.doGet(Servlet1.java:29)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1130)
    ... 17 more
    My application context file (context.xml) is:
    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="/WebApplication3">
      <Resource auth="Container"
                      driverClassName="oracle.jdbc.OracleDriver"
                      maxActive="8"
                      maxIdle="4"
                      name="jdbc/oracle11g"
                      username="scott"
                      password="tiger"
                      type="javax.sql.DataSource"
                      url="jdbc:oracle:thin:@localhost:1521:database01" />
    </Context>and my web.xml is:
        <resource-ref>
            <description>Oracle Datasource example</description>
            <res-ref-name>jdbc/oracle11g</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
        </resource-ref>
    ...I found similar threads in different forums including sun, such as
    http://forums.sun.com/thread.jspa?threadID=567630&start=0&tstart=0
    http://forums.sun.com/thread.jspa?threadID=639243&tstart=0
    http://forums.sun.com/thread.jspa?threadID=5312178&tstart=0
    , but no solution.
    As many suggest, I also tried to put context directly in the server.xml (instead of my application context) and referencing it by <ResourceLink /> inside my application context but it didn't work and instead it gave me the following message:
    org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '   ' for connect URL 'null'
    Has anyone succeeded in creating a connection pool with JNDI by using Tomcat 6 or higher ? If yes, could kindly explain about the applied method.
    Regards,

    Hello again,
    Finally I managed to run my application also with Tomcat 6.0.18. There was only two lines that had to be modified
    in the context.xml file (the context of my application project and not server's)
    Instead of writing
    <Context antiJARLocking="true" path="/WebApplication2">
        type="javax.sql.DataSource"
        factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
    </Context>we had to write:
    <Context antiJARLocking="true" path="/WebApplication2">
        type="oracle.jdbc.pool.OracleDataSource"
        factory="oracle.jdbc.pool.OracleDataSourceFactory"
    </Context>- No modification was needed to be done at server level (niether server.xml nor server context.xml)
    - I just added the ojdbc6.jar in $CATALINA_HOME/lib (I didn't even need to add it in WEB-INF/lib of my project)
    - The servlet used to do the test was the same that I presented in my precedent post.
    For those who have encountered my problem and are interested in the format of the web.xml and context.xml
    with Tomcat 6.0, you can find them below:
    Oracle server: Oracle 11g Enterprise
    Tomcat server version: 6.0.18
    Oracle driver: ojdbc.jar
    IDE: Netbeans 6.5.1
    The context.xml file of the web application
    <?xml version="1.0" encoding="UTF-8"?>
    <Context antiJARLocking="true" path="/WebApplication2">
        <Resource name="jdbc/oracle11g"
                  type="oracle.jdbc.pool.OracleDataSource"
                  factory="oracle.jdbc.pool.OracleDataSourceFactory"
                  url="jdbc:oracle:thin:@localhost:1521:database01"
                  driverClassName="oracle.jdbc.OracleDriver"
                  userName="scott"
                  password="tiger"
                  auth="Container"
                  maxActive="100"
                  maxIdle="30"
                  maxWait="10000"
                  logAbandoned="true"
                  removeAbandoned="true"
                  removeAbandonedTimeout="60" />
    </Context>The web.xml of my web application
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
        <resource-ref>
            <description>Oracle Database 11g DataSource</description>
            <res-type>oracle.jdbc.pool.OracleDataSource</res-type>
            <res-auth>Container</res-auth>
            <res-ref-name>jdbc/oracle11g</res-ref-name>
        </resource-ref>
        <servlet>
            <servlet-name>Servlet1</servlet-name>
            <servlet-class>servlets.Servlet1</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>Servlet1</servlet-name>
            <url-pattern>/Servlet1</url-pattern>
        </servlet-mapping>
        <session-config>
            <session-timeout>
                30
            </session-timeout>
        </session-config>
        <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
    </web-app>Ok, now I'm happy as the original problem is completely solved
    Regards

  • EclipseLink Error looking up external Transaction resource under JNDI name

    I want to verify my EJB 3.0 setup for a Java EE project to be deployed on Weblogic 10.3.3 (11gR2) - however when trying to run the JUnit test from eclipse I keep getting the following exception :
    Exception [EclipseLink-23004] (Eclipse Persistence Services - 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.TransactionException
    Exception Description: Error obtaining the Transaction Manager
    Internal Exception: Exception [EclipseLink-23001] (Eclipse Persistence Services - 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.TransactionException
    Exception Description: Error looking up external Transaction resource under JNDI name [weblogic.transaction.TransactionManager]
    Internal Exception: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
         at org.eclipse.persistence.exceptions.TransactionException.errorObtainingTransactionManager(TransactionException.java:125)
         at org.eclipse.persistence.transaction.JTATransactionController.<init>(JTATransactionController.java:69)
         at org.eclipse.persistence.transaction.wls.WebLogicTransactionController.<init>(WebLogicTransactionController.java:27)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at java.lang.Class.newInstance0(Class.java:355)
         at java.lang.Class.newInstance(Class.java:308)
         at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.newInstanceFromClass(PrivilegedAccessHelper.java:354)
         at org.eclipse.persistence.platform.server.ServerPlatformBase.initializeExternalTransactionController(ServerPlatformBase.java:247)
         at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.preConnectDatasource(DatabaseSessionImpl.java:656)
         at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:581)
         at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:228)
         at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:369)
         at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:151)
         at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:207)
         at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:195)
         at com.junit.ejb.orclperf.EjbValidation.setUp(EjbValidation.java:27)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
         at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
         at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
         at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
         at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
         at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
         at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
         at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
         at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
         at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
         at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
    Caused by: Exception [EclipseLink-23001] (Eclipse Persistence Services - 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.TransactionException
    Exception Description: Error looking up external Transaction resource under JNDI name [weblogic.transaction.TransactionManager]
    Internal Exception: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
         at org.eclipse.persistence.exceptions.TransactionException.jndiLookupException(TransactionException.java:47)
         at org.eclipse.persistence.transaction.AbstractTransactionController.jndiLookup(AbstractTransactionController.java:434)
         at org.eclipse.persistence.transaction.wls.WebLogicTransactionController.acquireTransactionManager(WebLogicTransactionController.java:35)
         at org.eclipse.persistence.transaction.JTATransactionController.<init>(JTATransactionController.java:67)
         ... 40 more
    Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
         at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at org.eclipse.persistence.transaction.AbstractTransactionController.jndiLookup(AbstractTransactionController.java:432)
         ... 42 more
    [EL Finest]: 2010-05-23 21:29:36.629--ServerSession(30149247)--Thread(Thread[main,5,main])--End deploying Persistence Unit PERFEJB; session file:/C:/Users/owner/workspace/PERFEJB/build/classes/_PERFEJB; state Deployed; factoryCount 2The code for the JUnit test is the following:
    package com.junit.ejb.orclperf;
    import static org.junit.Assert.*;
    import java.util.Calendar;
    import java.util.Date;
    import javax.persistence.EntityManager;
    import javax.persistence.EntityManagerFactory;
    import javax.persistence.Persistence;
    import javax.persistence.Query;
    import org.junit.Before;
    import org.junit.Test;
    import eJBgetSet.Attachment;
    import eJBgetSet.Request;
    public class EjbValidation {
         private static final String PERSISTENCE_UNIT_NAME="PERFEJB";
         private EntityManagerFactory factory;
         @Before
         public void setUp() throws Exception {
              factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
              EntityManager em = factory.createEntityManager();
              em.getTransaction().begin();
              Query q = em.createQuery("select r from Request r");
              Calendar c = Calendar.getInstance();
              c.add(Calendar.DAY_OF_MONTH,5);
              Date dnow = c.getTime();
              String[] type= {"Databank","SQL File","Script","Scenario Recording","Other"};
              byte[] junitattachment  = (byte[])"abcdefghijklmnopqrstuvwxyz".getBytes();
              boolean createNewEntries = (q.getResultList().size()==0);
              if(createNewEntries){
                   assertTrue(q.getResultList().size() == 0);
                   Request request = new Request();
                   request.setRequestid(0);
                   request.setReqdescription("JUnit Testing record addition with JPA");
                   request.setReqjustification("Validate EclipseLink/WebLogic/EJB 3.0 setup for this project");
                   request.setProjectreference("Development Task Performance Analysis 1");
                   request.setReqresultdate(dnow);
                   request.setReqstatus(0);
                   em.persist(request);
                   int x=0;
                   for(int i=0; i<10;i++){
                        Attachment attachment = new Attachment();
                        attachment.setAttachmentid(i);
                        attachment.setAttachname("File"+i);
                        attachment.setAttachdate(c.getTime());
                        if(i==5){
                             x=0;
                        }else{
                             x++;
                        attachment.setAttachtype(type[x]);
                        attachment.setAttachuser("User"+i);
                        attachment.setAttachsize(String.valueOf(junitattachment.length));
                        attachment.setAttachfile(junitattachment);
                        em.persist(attachment);
                        request.getPerfAttachments().add(attachment);
                        em.persist(attachment);
                        em.persist(request);
                   em.getTransaction().commit();
                   em.close();
         @Test
         public void testFindAll() {
              EntityManager em = factory.createEntityManager();
              Query q = em.createQuery("select a from perf_attachment a");
              assertTrue(q.getResultList().size() == 10);
              em.close();
         @Test
         public void testSave() {
              EntityManager em = factory.createEntityManager();
              Query q = em.createQuery("select r from req_perf_header");
              assertTrue(q.getResultList().size() == 1);
              assertTrue(((Request) q.getResultList()).getPerfAttachments().size() ==10);
              em.close();
    }Finally the persistence.xml file being used is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.0"
         xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
         <persistence-unit name="PERFEJB" transaction-type="JTA">
              <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
              <jta-data-source>jdbc/ORCLPERF</jta-data-source>
              <class>eJBgetSet.User</class>
              <class>eJBgetSet.Transaction</class>
              <class>eJBgetSet.Request</class>
              <class>eJBgetSet.PerfStatus</class>
              <class>eJBgetSet.Attachment</class>
              <class>eJBgetSet.Approver</class>
              <properties>
                   <property name="eclipselink.target-server" value="WebLogic_10" />
                   <property name="eclipselink.logging.level" value="FINEST" />
                   <property name="eclipselink.jdbc.driver" value="oracle.jdbc.OracleDriver" />
                   <property name="eclipselink.jdbc.platform"
                        value=" org.eclipse.persistence.platform.database.oracle.OraclePlatform " />
                   <property name="eclipselink.jdbc.url"
                        value="jdbc:oracle:thin:@localhost:1521:orcl11g:create=true" />
                   <property name="eclipselink.jdbc.user" value="<username>" />
                   <property name="eclipselink.jdbc.password" value="<password>" />
                   <property name="eclipselink.logging.level" value="ALL" />
                   <property name="eclipselink.logging.timestamp" value="true" />
                   <property name="eclipselink.logging.exceptions" value="true" />
                   <property name="eclipselink.logging.session" value="true" />
                   <property name="eclipselink.ddl-generation" value="drop-and-create-tables" />
                   <property name="eclipselink.ddl-generation.output-mode"
                        value="database" />
              </properties>
         </persistence-unit>
    </persistence>Any help would be much appreciated. Many Thanks

    You have it set to run on the WebLogic platform so it is looking up the TransactionManager from JNDI, but are running the test from within the EclipseIDE. Try deploying it to Weblogic and running it there, or change your persistence.xml settings so that it can connect/run outside the server.
    Best Regards,
    Chris

  • Bug in form based authorization ( url-patter /* and loginform in /*)

    Try this:
    examples\weapp\security
    default web.xml file for this webapp has url-pattern =
    <url-pattern>/admin/*</url-pattern>
    try to register this web application as default webApplication ( this can be
    done only by editing config.xml manualy - this is feature or bug ? =) )
    and change url-pattern to <url-pattern>/*</url-pattern> and try to run this
    example. Weblogic falls to recursion when executing this example. Porblem is
    that access to loginform is protected by /* but in order to access resouces
    in /* i need autorization which can be performed only by using loginform
    PS: sorry for my poor english
    Regards,
    Giedrius Trumpickas

    in the web.xml, you can specify some security setting , also the the protected
    resources are grouped by url pattern, so to avoid that ,you can group the protected
    url pattern to exclude the form resource, so the form resource page don't need
    to protected. or if weblogic is really smart , they should in default to leave
    the form page or error page or welcome page unprotected.
    Hope that helps.
    Yaodong Hu
    "Giedrius Trumpickas" <[email protected]> wrote:
    Try this:
    examples\weapp\security
    default web.xml file for this webapp has url-pattern =
    <url-pattern>/admin/*</url-pattern>
    try to register this web application as default webApplication ( this
    can be
    done only by editing config.xml manualy - this is feature or bug ? =)
    and change url-pattern to <url-pattern>/*</url-pattern> and try to run
    this
    example. Weblogic falls to recursion when executing this example. Porblem
    is
    that access to loginform is protected by /* but in order to access resouces
    in /* i need autorization which can be performed only by using loginform
    PS: sorry for my poor english
    Regards,
    Giedrius Trumpickas

  • JNDI replication within a cluster

    Hi to all of you,
    we successfully enabled HTTP Session replication and tested the failover. We would also like to setup a JNDI replication, so that we can use it as a storage for some shared data -- as stated in http://download.oracle.com/docs/cd/B10464_05/web.904/b10324/cluster.htm this should be enabled automatically, once EJB replication is enabled.
    With some problems we finally enabled EJB replication (we configured it through orion-application.xml) and the required replication policy is propagated to our statful beans. Anyway, the JNDI is still not replicated over the machines.
    We are running latest OAS 10g, cluster is MultiCast on RedHat Enterprise, replication policy for Stateful beans is set to 'onRequestEnd' (we tried all the options :), our application is normal ear with 1 ejb and 1 war archive and apart from JNDI replication, it works as expected.
    Is there some trick that is not mentioned or that we may overlooked in documentation to enable JNDI replication?
    Kind Regards,
    Martin

    Hopefully solved -- though the documentation explicitly mentions rebinding as not working, after any changes made to value stored in JNDI context you should just re-bind the value to the JNDI context; the value is replicated to other JNDI contexts.
    m.

  • VoiceOver Resources and Links

    Here’s some VoiceOver resources and links:
    http://home.adelphia.net/~bmss/vo/
    Please let me know what you think!

    From URL: http://www.sighted.com/software/macosx.htm
    Index Braille and Sighted Electronics Announce Braille for Mac
    OS X version 10.4 “Tiger”
    November 15, 2005. Index Braille AB located in Gammelstadt Sweden and
    Sighted Electronics Inc. located in Westwood New Jersey, have collaborated to
    make a Braille translation application for Mac OS X Tiger. Using the Index
    Braille Embosser (printer), any user will now have complete Braille embossing
    capabilities for Mac OS X applications.
    Per Burman, Director of Engineering at Index Braille, stated, "We have
    developed the CUPS (Common UNIX Printer Driver) for the Index line of Braille
    embossers enabling full Unicode support for Grade Two Braille for Mac OS X.”
    According to Mr. Burman, "By January we will have Grade Two Braille
    translation with limited Braille formatting providing computer Braille production for the first time in Mac OS X.” A complete formatting functionality will ship in March.
    Because of Apple’s strong presence in the school systems it was decided to
    concentrate on Mathematics functions and the Nemeth Braille Mathematics
    code as we progress with future development.
    Apple’s Mac OS X Tiger desktop technology with the VoiceOver feature
    enables equal access for the Blind.
    By David Pillischer
    Sighted Electronics, Inc.

  • JNDI replication in cluster

    Is there a way to force the JNDI replication?
              

    It is on by default, unless you specifically disabled it:
              http://e-docs.bea.com/wls/docs61/javadocs/weblogic/jndi/WLContext.html
              REPLICATE_BINDINGS
              public static final java.lang.String REPLICATE_BINDINGS
              Cluster-specific: Specifies whether tree modifications are replicated
              and is only applicable when connecting to WebLogic Servers that are running
              in a cluster. By default, any modification to the naming tree is replicated
              across the cluster, which ensures that any server can act as a naming server
              for the entire cluster. Setting this property to false changes this behavior
              and should be done with extreme caution: a false setting means that modifications
              to the tree caused by bind, unbind, createSubcontext, and destroySubcontext
              will not be replicated.
              Understand the implications of this property before changing its default (true).
              Pothiraj <[email protected]> wrote:
              > Is there a way to force the JNDI replication?
              Dimitri
              

  • Sun JSAS P.E 9.0 and JNDI connection

    Hi all I am guessing this is probably in the wrong spot, so please correct me if there is a better place to put it. I am trying to setup a JNDI connection to a database, but am confused by the parameters that are required.
    I am expected to fill in the following:
    Resource Type:
    JNDI Lookup:
    Factory Class:
    But I haven't the faintest idea what these are supposed to represent. Could anyone point me to either a site with an example configuration or give me an idea of what this means ?
    thanks in advance.
    Ps. I have tried to search the web with no real results, but if they are out there let me know and I will go back to searching.

    The JDBC forum is a more appropriate place than the
    new to java. However, you have not given much
    information for anyone to work with.
    How are you setting up the connection? parameters for
    what? etc.I want to use JNDI and I am setting up it under external resources in the Server.
    It gives this: "Create an external JNDI resource so that applications can gain access to resources stored in an external respository."
    And the items I listed are those things that are required for the server.
    I am listing as much as I am aware of at this time. (Sorry if it is insufficient to help)
    PS. (Is there a method to move this post to the JDBC forum ? )
    Message was edited by:
    Aknibbs

  • Global JDBC Resource in JNDI

    How would I create a global JNDI JDBC name pointing to a Database Resource? Currently I have a Database Resource that points to a Connection Pool. All this works as long as I deploy a servlet with the JNDI JDBC name configured in the WAR file. Once I deploy this WAR file, the JDBC name becomes visible in the JNDI browsing utility in Sun App Server Admin Console. My real question here is how do I get that name to always be present in the JNDI browsing utility with ZERO deployed applications running. I want it to always be there and I don't want to be forced in configuring the naming in every application that I deploy.

    I'm not following you. Once you bind the resource to JNDI, it's there, that's it, anyone can use it. It will stay until removed or the server/registry is killed, right?
    When you deploy an application, it must know the name/id of the resource it wants right? The best solution I can offer is to put the name in a database or properties file and then when you deploy your apps, they can read the file at runtime and this way you can change the name and all deployed apps will dynamically get updated once they are restarted. And if you don't want to restart the applications, you could have the applications check the properties file or database once in awhile to check for changes.

  • Cluster-wide JNDI replication

    I have a question about cluster wide JNDI replication. I am on weblogic
              7.0 sp2, solaris 8. I have 2 weblogic servers in a cluster and two
              asynchronous JVM's connect to this cluster. The two weblogic servers
              would be w1 and w2 and the JVMs would be j1
              w1 creates a stateful ejb. The handle to this ejb is put on the JNDI
              tree. A JMS message is created which contains the key to the handle
              object. A JMS message is sent which is picked up by one of the JVM's say
              j1. j1 tries to do a lookup of the handle using the key in the JMS
              message and it is not able to find the handle object.
              The reason is that j1 is trying to connect to the w2 to find the handle.
              The change to the jndi tree is not propagated to w2 yet and hence the
              error. Any ideas on why it would take so long to communicate the jndi
              tree? My jndi tree has hardly anything in it. There are a couple of JMS
              connection factories and 3 ejbs and couple of JMS queues.
              Would appreciate any kind of help. I am going to migrate storing the ejb
              handles to another persistent store instead of the jndi tree but till
              then any insight into this problem would be helpful.
              Please don't advice solutions like using Thread.sleep and trying again
              Thanks,
              Shiva.
              

    Shiva,
              > I have a question about cluster wide JNDI replication. I am on weblogic
              > 7.0 sp2, solaris 8. I have 2 weblogic servers in a cluster and two
              > asynchronous JVM's connect to this cluster. The two weblogic servers
              > would be w1 and w2 and the JVMs would be j1
              >
              > w1 creates a stateful ejb. The handle to this ejb is put on the JNDI
              > tree. A JMS message is created which contains the key to the handle
              > object. A JMS message is sent which is picked up by one of the JVM's say
              > j1. j1 tries to do a lookup of the handle using the key in the JMS
              > message and it is not able to find the handle object.
              >
              > The reason is that j1 is trying to connect to the w2 to find the handle.
              > The change to the jndi tree is not propagated to w2 yet and hence the
              > error. Any ideas on why it would take so long to communicate the jndi
              > tree? My jndi tree has hardly anything in it. There are a couple of JMS
              > connection factories and 3 ejbs and couple of JMS queues.
              That's an interesting problem. The handle should have enough information
              to locate the EJB. Are you explicitly trying to connect to W2 from J1 or
              something? That part didn't make sense to me.
              (While it's a different approach, if you need to share data real-time in a
              cluster, use our Coherence Java clustered cache software.)
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com/coherence.jsp
              Tangosol Coherence: Clustered Replicated Cache for Weblogic
              "Shiva P" <[email protected]> wrote in message
              news:[email protected]...
              >
              

  • JNDI replication\lookup problems

              Hi,
              We have a WL5.1 SP12 cluster that until today consisted of 2 Solaris boxes running
              8 WL instances on the 2.6 OS.
              Today we attempted to add a third Solaris box, running 2 SP12 WL instances on the
              2.8 OS. These two new instances were identical to the other 8 in all respects apart
              from one ejb jar which they did not deploy (because of Solaris 2.8\JNI\JDK1.3.1 incompatiblilities).
              We figured that these new JVM could lookup this bean via the clustered JNDI and execute
              on one of the original 8 JVMs, so we did not deploy on these new servers. This worked
              fine on test (a 3 way cluster, on one box running Solaris 2.8 and SP10).
              However when we cut the new box in this morning we got javax.naming.NameNotFoundExceptions
              from the new JVMs.
              These new JVMs apeared to start fine, and everything looked as it should on the console,
              but still the error.
              so :
              what could it be :
              OS related - a clustering spanning 2.6 and 2.8 OSs
              SP 12 related ?
              Anybody encountered anything like this before ?
              Thanks in advance.
              Justin
              

              Yes, the EJB classes are in the server classpath.
              I assumed that JNDI replication occured as a resulting of enabling clustering.
              "Sabha" <[email protected]> wrote:
              >Are the ejb home/remote interfaces in the server classpath of the 2 newer
              >JVMs? Is jndi replication turned off?
              >
              >-Sabha
              >
              >"Justin" <[email protected]> wrote in message
              >news:[email protected]...
              >>
              >> Hi,
              >>
              >> We have a WL5.1 SP12 cluster that until today consisted of 2 Solaris boxes
              >running
              >> 8 WL instances on the 2.6 OS.
              >>
              >> Today we attempted to add a third Solaris box, running 2 SP12 WL instances
              >on the
              >> 2.8 OS. These two new instances were identical to the other 8 in all
              >respects apart
              >> from one ejb jar which they did not deploy (because of Solaris
              >2.8\JNI\JDK1.3.1 incompatiblilities).
              >> We figured that these new JVM could lookup this bean via the clustered
              >JNDI and execute
              >> on one of the original 8 JVMs, so we did not deploy on these new servers.
              >This worked
              >> fine on test (a 3 way cluster, on one box running Solaris 2.8 and SP10).
              >>
              >> However when we cut the new box in this morning we got
              >javax.naming.NameNotFoundExceptions
              >> from the new JVMs.
              >>
              >> These new JVMs apeared to start fine, and everything looked as it should
              >on the console,
              >> but still the error.
              >>
              >> so :
              >>
              >> what could it be :
              >>
              >> OS related - a clustering spanning 2.6 and 2.8 OSs
              >> SP 12 related ?
              >>
              >> Anybody encountered anything like this before ?
              >>
              >> Thanks in advance.
              >>
              >> Justin
              >>
              >>
              >>
              >
              >
              

Maybe you are looking for

  • Satellite M70 - Can't install from recovery disk

    Hi, I had to remove the HDD from Toshiba Satellite M70 to use it on my Compaq laptop (Compaq HDD crashed). I had to install XP and other stuff after creating 2 partions and used it with Compaq Laptop without any problem. Now I got a new HDD for compa

  • Setting a jpanel as a background image

    i have managed to load the image into a jpanel but now need to know how to set the jpanel as a background image, to allow my jbuttons and textfields to be seen over the top

  • How to delete BDC session ?

    hi gurus, In my scenario , Before runnning BDC ( calll transaction ) , I firstly create a session ( use : BDC_OPEN_GROUP) with group name = the file that used to upload data for BDC execution , Then I check If the BDC run without error I will use BDC

  • Can global commands be created for Anchored Frames?

    I am migrating a rather large documentation suite from one FM template to another. One of the changes is larger anchored frames (95%  are sized the same). Since there are numerous graphics per document (100+) one of the rather monotonous tasks involv

  • Global correlation can't updated

    version is IPS7.0, asa5520-aip-ssm. Singatrue and  IME can be sucessfully updated, Global correlation can't updated, the Status of global correlation is Critical. I saw the website http://www.cisco.com/en/US/docs/security/ips/7.0/configuration/guide/