Got javax.naming.NoInitialContextException if no jndi.properties while deploying seam to
jetty
----------------------------------------------------------------------------------------------
Key: JBSEAM-4763
URL:
https://issues.jboss.org/browse/JBSEAM-4763
Project: Seam
Issue Type: Bug
Affects Versions: 2.2.1.CR3
Reporter: Yang Yong
Note: the actual affect version is 2.2.2.EAP5 distributed with EAP5.1, but the Affects
Version doesn't have this version in select list.
When I was trying to deploy EAP5.1 admin-console.war to jetty, I got below exception if
with jndi disabled(no jndi.properties), if I manually add jndi.properties to
WAR/WEB-INF/classes and eanble jndi in jetty, the exception was gone .
I think the problem is the method Transaction.getUserTransaction doesn't handle the
javax.naming.NoInitialContextException.
And the confusion is although transaction manager was disabled by:
<component name="org.jboss.seam.core.init">
<property name="debug">false</property>
<!-- enable only when needed -->
<property
name="transactionManagementEnabled">false</property>
</component>
Seam still try to create a transaction manager by lookup jndi, this will cause Seam can
not be deployed in a pure web server which doesn't provide a jndi server or
jndi.properties..
FYI:
7417 [qtp19764978-35] ERROR org.jboss.seam.contexts.Contexts - could not discover
transaction status
7420 [qtp19764978-35] WARN org.jboss.seam.contexts.Contexts - Exception destroying
context
java.lang.RuntimeException: exception invoking: getTransaction
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:154)
at org.jboss.seam.Component.callComponentMethod(Component.java:2275)
at org.jboss.seam.Component.unwrap(Component.java:2301)
at org.jboss.seam.Component.getInstance(Component.java:2044)
at org.jboss.seam.Component.getInstance(Component.java:2003)
at org.jboss.seam.Component.getInstance(Component.java:1997)
at org.jboss.seam.Component.getInstance(Component.java:1970)
at org.jboss.seam.Component.getInstance(Component.java:1965)
at org.jboss.seam.transaction.Transaction.instance(Transaction.java:39)
at org.jboss.seam.util.Work.workInTransaction(Work.java:38)
at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:350)
at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:129)
at
org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:514)
at
org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:249)
at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:196)
at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:534)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1351)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:295)
at
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:373)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:500)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at org.jboss.on.embedded.LazyStartupFilter.doFilter(LazyStartupFilter.java:87)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:473)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:479)
at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:929)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:403)
at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:864)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:247)
at
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:151)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:114)
at org.eclipse.jetty.server.Server.handle(Server.java:352)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:596)
at
org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:1051)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:590)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:212)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:426)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:508)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.access$000(SelectChannelEndPoint.java:34)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:451)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.naming.NoInitialContextException: Need to specify class name in
environment or system property, or as an applet parameter, or in an application resource
file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.jboss.seam.transaction.Transaction.getUserTransaction(Transaction.java:82)
at
org.jboss.seam.transaction.Transaction.createUTTransaction(Transaction.java:74)
at org.jboss.seam.transaction.Transaction.getTransaction(Transaction.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
... 63 more
Source code URL:
http://viewvc.jboss.org/cgi-bin/viewvc.cgi/seam/tags/JBPAPP_5_1_0/src/mai...
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira