我目前正在将我的maven耳朵从glassfish 4迁移到wildfly 8.2。我现在面临的问题是访问ejb-jar.xml中指定的自定义env-entry
值。在我的ejb包中,我有以下文件中的META-INF文件夹:
ejb-jar.xml中:
<?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>
<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>
我在我的ejb中注入了这个属性:
@Stateless
@LocalBean
public class HelloWorldEJB {
@Resource(name = "HelloWorld")
private String helloWorld;
}
有人有想法吗?