]
Cheng Fang commented on WFLY-13697:
-----------------------------------
[~michpetrov] Yes, they share the same cause and marking as dup is fine. I'm not
actively working on it. So if you have ideas, feel free to explore and take it.
JBoss CLI can't find java:app/AppName
-------------------------------------
Key: WFLY-13697
URL:
https://issues.redhat.com/browse/WFLY-13697
Project: WildFly
Issue Type: Bug
Components: Batch, Management
Affects Versions: JBoss AS7 7.2.0.Final
Reporter: José Fernando Tepedino Martins
Assignee: Michal Petrov
Priority: Minor
Labels: CLI, JNDI
With a JEE aplication in a WAR package, when starting a functionality, as a Batch Job,
via CLI, CDI injection and JNDI lookup fail to find resources 'java:app/AppName'
and 'java:module/ModuleName'.
For example, a job listener or other job artifact with the following code
{code:java}
@Resource(lookup="java:app/AppName")
private String applicationName;{code}
or
{code:java}
private String applicationName;
@PostConstruct
protected void initialize() throws NamingException {
applicationName = InitialContext.doLookup("java:app/AppName");
}{code}
when the batch job is started from JBoss CLI, the following error will be logged:
{code:java}
javax.naming.NameNotFoundException: java:app/AppName
{code}