You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Anne Stellingwerf (JIRA)" <ji...@apache.org> on 2015/07/17 14:59:05 UTC

[jira] [Created] (TOMEE-1616) EJBs cannot be found in InitialContext with custom WebappLoader

Anne Stellingwerf created TOMEE-1616:
----------------------------------------

             Summary: EJBs cannot be found in InitialContext with custom WebappLoader
                 Key: TOMEE-1616
                 URL: https://issues.apache.org/jira/browse/TOMEE-1616
             Project: TomEE
          Issue Type: Bug
          Components: TomEE Core Server
    Affects Versions: 1.7.2
         Environment: Linux and Windows
            Reporter: Anne Stellingwerf


Since TomEE 1.7.2, I am unable to locate my EJB in an InitialContext when I use a custom loader. My real loader has more logic, among which is adding a custom class loader. But for the sake of this ticket, I've created a WebappLoader which does nothing, except subclassing {{WebappLoader}}.
Then I have a EJB, and a JAX RS service that is looking up that bean:
{code}Context context = new InitialContext();
GreetingServiceEjb greetingServiceEjb = (GreetingServiceEjb) context.lookup("java:global/tomee172loaderbug/GreetingServiceEjb");
return greetingServiceEjb.getGreeting();{code}
This is working fine in TomEE 1.7.1 but works no longer in 1.7.2.

PFA:
* {{tomee172loaderBug.jar}}, containing class and source files for the Loader
* {{tomee172loaderBug.war}}, containing the bean, JAX RS service, and context.xml for choosing the custom loader
* {{tomee172loaderBug.log}}, with the full stack trace

STR:
# Copy tomee172loaderBug.jar into {{TomEE 1.7.1 home/lib/}}
# Copy {{tomee172loaderBug.war}} into {{TomEE 1.7.1 home/webapps/}}
# Start TomEE
# In a browser, navigate to {{http://localhost/tomee172loaderBug/hello}}
## Note that the response equals "Hello !!"
# Now repeat these steps, but now on TomEE 1.7.2
## Note a instead of Hello, an HTTP 500 is thrown: {{HTTP Status 500 - Error processing webservice request}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)