java ee - env-entry in ejb-jar.xml not being injected with @Resource when deployed inside WAR file -


i have maven web application has dependency on ejb project.

   <dependency>         <groupid>${project.groupid}</groupid>         <artifactid>soar-ejb</artifactid>         <version>1.0</version>         <type>jar</type>     </dependency> 

in ejb project there i've added env-entry in ejb-jar.xml such:

<?xml version="1.0" encoding="utf-8"?> <ejb-jar xmlns = "http://java.sun.com/xml/ns/javaee"       version = "3.1"          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/ejb-jar_3_1.xsd">     <enterprise-beans>         <session>             <env-entry>                 <description>config file</description>                 <env-entry-name>configfilelocation</env-entry-name>                 <env-entry-type>java.lang.string</env-entry-type>                 <env-entry-value>dropbox-config.properties</env-entry-value>             </env-entry>         </session>     </enterprise-beans> </ejb-jar> 

i've tested ejb project, using arquillian, , able inject value using @resource such: @resource(name = "configfilelocation") private string configfile;

now, when build .war ejb dependency, .war ejb project .jar inside web-inf\lib. within ejb project (i.e. inside .jar) ejb-jar.xml file in proper meta-inf directory.

but now, when deploy server @resource injection never works. string null. according have read have ejb-jar.xml in correct location, both within ejb project , within .war maven produces.

would have idea of i've configured incorrectly?

thanks!

edit:

modified session element

<session>         <description>an ejb loads configuration file</description>         <display-name>configurationproducer</display-name>         <ejb-name>configurationproducer</ejb-name>         <ejb-class>com.trf.util.dropboxconfigfileproducer</ejb-class>         <session-type>stateless</session-type>         <env-entry>             <description>location of config file</description>             <env-entry-name>configfilelocation</env-entry-name>             <env-entry-type>java.lang.string</env-entry-type>             <env-entry-value>dropbox-config.properties</env-entry-value>         </env-entry>     </session> 

the session element of ejb-jar.xml doesn't contain ejb-name property, try put 1 name matching bean interface name. i've edited answer show example.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -