ニコスは私に正しい解決策を教えてくれました:クラスパス(src\main\resources\META-INF)にejb-jar.xmlが必要です
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar 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/ejb-jar_3_1.xsd"
version="3.1">
<enterprise-beans>
<session>
<ejb-name>FooServiceImpl </ejb-name>
<resource-ref>
<res-ref-name>foovalue</res-ref-name>
<res-type>java.lang.String</res-type>
</resource-ref>
</session>
</enterprise-beans>
</ejb-jar>
WAS 8.x を使用する場合は、リソースをibm-ejb-jar-bnd.xmlファイルに宣言する必要があることに注意してください。
<?xml version= "1.0" encoding="UTF-8"?>
<ejb-jar-bnd xmlns="http://websphere.ibm.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-ejb-jar-bnd_1_0.xsd" version="1.0">
<session name="FooServiceImpl" >
<resource-ref name="foovalue" binding-name="foovalue"/>
</session>
</ejb-jar-bnd>
参照 foo-value は、次のように WAS 8 に宣言されます。
管理コンソールを開き、[環境] > [名前空間バインディングの管理] に移動します。スコープを選択し、
- バインディング タイプ = 文字列
- バインディング識別子 = foovalue
- 名前空間の名前 = foovalue
- 文字列値 = helloworld