dimanche 28 juin 2015

Wildfly local jndi property

I am currently migrating my maven ear from glassfish 4 to wildfly 8.2. The problem i am facing right now are the jndi properties. In my ejb package i have in the META-INF folder following file:

ejb-jar.xml:

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns = "http://ift.tt/nSRXKP" 
         version = "3.1"
         xmlns:xsi = "http://ift.tt/ra1lAU" 
         xsi:schemaLocation = "http://ift.tt/nSRXKP http://ift.tt/1zK8E6E">
    <enterprise-beans>
        <session>
            <ejb-name>HelloWorldEJB</ejb-name>
            <env-entry>
                <description>Some description</description>
                <env-entry-name>HelloWorld</env-entry-name>
                <env-entry-type>java.lang.String</env-entry-type>
                <env-entry-value>testvalue</env-entry-value>
            </env-entry>
        </session>
    </enterprise-beans>
</ejb-jar>

And i inject the property in my ejb like that:

@Stateless
@LocalBean
public class HelloWorldEJB {

    @Resource(name = "HelloWorld")
    private String helloWorld;

}

Anybody an idea?

Aucun commentaire:

Enregistrer un commentaire