문제

So I created a custom reference in the domain.xml

<custom-resource res-type="java.lang.String" jndi-name="jndi/myResource" factory-class="org.glassfish.resources.custom.factory.PrimitivesAndStringFactory">
        <property name="value" value="myValue"/>
</custom-resource>

And referencing it through @Resource(lookup = "jndi/myResource") in a @ApplicationScoped bean.

I am also starting the server with the endorsed directory(containing the endorsed-api.jar). Still when I reference the resource, its not injecting and throwing a null.

Looks like everything is setup correctly, not sure what I am missing here. And yes, I have beans.xml in the Meta-inf directory too.

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top