Uploaded image for project: 'IronJacamar'
  1. IronJacamar
  2. JBJCA-1265

Cannot deploy "datasource.xml" file into embedded IronJacamar container

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 1.1.0.Beta5
    • Embedded
    • None
    • User Experience
    • Hide

      Do not use "datasource.xml" as a name of a file for deployment

      Show
      Do not use "datasource.xml" as a name of a file for deployment

      I cannot deploy file with name "datasource.xml" into embedded container.
      Got the following in stack trace while loading JNDI component:
      Caused by: javax.naming.NameNotFoundException: PostgresDS not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
      at javax.naming.InitialContext.lookup(InitialContext.java:417)
      at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:155)
      at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
      at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
      at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:179)
      at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
      at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:106)
      at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:231)
      at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:217)

      The fun this is that it's actual just for name "datasource.xml". If I change it to some other name the file will be deployed without any problems.

      Seems "datasource.xml" is hardcoded in some way in embedded container.

      Sample code:
      System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
      System.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
      Embedded container; // initialized with Spring <bean id="container" class="org.jboss.jca.embedded.EmbeddedFactory" factory-method="create"/>
      container.startup();
      container.deploy("jdbc-xa.rar");
      container.deploy("datasource.xml");

              jpederse@redhat.com Jesper Pedersen
              caries_jira Nickolay Laptev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: