tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Werner Froidevaux (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TOMEE-38) java:comp/TransactionManager
Date Wed, 19 Oct 2011 12:16:11 GMT

    [ https://issues.apache.org/jira/browse/TOMEE-38?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13130532#comment-13130532
] 

Werner Froidevaux commented on TOMEE-38:
----------------------------------------

You can put the code below in a JSP of any WAR and watch the console output. 

<%
  String jndiName = null;
  try {
    javax.naming.Context context = new javax.naming.InitialContext();
    jndiName = "java:comp/UserTransaction";
    Object obj = context.lookup(jndiName);
    System.out.println("lookup of " + jndiName + " OK");
    jndiName = "java:comp/TransactionManager";
    obj = context.lookup(jndiName);
    System.out.println("lookup of " + jndiName + " OK");
  }
  catch(Exception e) {
    System.out.println("lookup of " + jndiName + " FAILED");
    e.printStackTrace();
  }
%>

E.g. I put it in ./webapps/openejb/index.jsp and get the following output:


lookup of java:comp/UserTransaction OK
lookup of java:comp/TransactionManager FAILED
javax.naming.NameNotFoundException: Name TransactionManager is not bound in this Context
        at org.apache.naming.NamingContext.lookup(NamingContext.java:803)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:145)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:814)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:159)
        at org.apache.naming.SelectorContext.lookup(SelectorContext.java:158)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at org.apache.jsp.index_jsp._jspService(index_jsp.java:94)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:185)
        at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:210)
        at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:85)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:269)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:300)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)

The lookup of  java:comp/UserTransaction is OK but not  java:comp/TransactionManager.

                
> java:comp/TransactionManager
> ----------------------------
>
>                 Key: TOMEE-38
>                 URL: https://issues.apache.org/jira/browse/TOMEE-38
>             Project: TomEE
>          Issue Type: Question
>    Affects Versions: 1.0.0-beta-2
>         Environment: Linux, JDK 6
>            Reporter: Werner Froidevaux
>
> With previous versions of Tomcat 5 + OpenEJB I was able to lookup the TransactionManager
as follows:
> Context context = new InitialContext();
> tm = context.lookup("java:comp/TransactionManager");
> A sample stack trace looks as follows:
> BasicException[1]
>     Class = org.apache.naming.NamingContext
>     Method = lookup
>     Line = 803
>     ExceptionClass = javax.naming.NameNotFoundException
>     ExceptionDomain = DefaultDomain
>     ExceptionCode = GENERIC
>     Description = Name TransactionManager is not bound in this Context
>     Timestamp = 2011-10-19T09:26:35.197Z
>     Paramaters:
> 	0:  explanation = Name TransactionManager is not bound in this Context
>     StackTrace:
> 	at org.apache.naming.NamingContext.lookup(NamingContext.java:803)
> 	at org.apache.naming.NamingContext.lookup(NamingContext.java:145)
> 	at org.apache.naming.NamingContext.lookup(NamingContext.java:814)
> 	at org.apache.naming.NamingContext.lookup(NamingContext.java:159)
> 	at org.apache.naming.SelectorContext.lookup(SelectorContext.java:158)
> 	at javax.naming.InitialContext.lookup(InitialContext.java:392)
> 	at org.openmdx.kernel.naming.ComponentEnvironment.lookup(ComponentEnvironment.java:100)
> 	at org.openmdx.base.rest.spi.ConnectionAdapter.getTransactionManager(ConnectionAdapter.java:179)
> 	...
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> 	at com.planetj.servlet.filter.compression.CompressingFilter.doFilter(CompressingFilter.java:217)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:185)
> 	at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
> 	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
> 	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
> 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:269)
> 	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
> 	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:662)
> This does not seem to work any more with TomEE. Is there another way to do the lookup?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message