[EJB 3.0] - Re: Bundle jars within EAR?
by asack
"oskar.carlstedt" wrote : Deploying the same file again, but without the jars log4j and commons-logging. Wolla!!, It seems to work.
|
| Isn't this a classloader bug/error? What I mean is. The files I put in my ear are those I want to use, especially in isolated mode. It shall not matter if a put a log4j jar in my ear, it shall override the one in the server/default/lib folder.
|
| I think this is very important when delivering ready to install archives (an archive I can send to a customer just telling him "drop the ear in the deploy folder and that's it").
|
| //Oskar
|
No I don't its a bug per se but a JBoss behavior/choice. Java works on class loader parent delegation so if the jar is already in server/default/lib, it will pick that one up FIRST before it loads yours. Your manifest entries just put these classes on the path for the loader to find them. However, again, classloader is going to look at the parent loader which will contain log4j and pick that one first before it even attempts to load the one you package. Now, I TOTALLY agree with you that there should be a way to get around this on a per EAR level but I don't think thats covered by the spec at this point (and yes I voiced this opinion to the group at one point a while ago).
I noticed that unlike 4.0.4.GA, 4.0.5 finally puts back jaxen which was something we had to manually do to get access to XPath.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4029531#4029531
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4029531
19Â years, 1Â month
[JBoss Seam] - Re: ExceptionFilter without UserTransaction
by dan.j.allen
I realize that it may seem silly to use Seam in a non-JTA environment because of all the wonderful features it offers when the app runs under that umbrella. However, I am experimenting with Seam in a completely stateless environment, where all transaction and session related stuff are hidden behind Spring services. In this case, I am using Seam strictly for its JSF enhancements and not for its persistence enhancements. I don't intend to use Seam this way for all applications, just for this particular one. I just feel it is strange that the ExceptionFilter has to complain so loudly.
It bails, but only in the background.
2007-03-19 18:22:27,439 ERROR [org.jboss.seam.web.ExceptionFilter] - <could not roll back transaction>
| javax.naming.NamingException: Cannot create resource instance
| at org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:112)
| at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
| at org.apache.naming.NamingContext.lookup(NamingContext.java:792)
| at org.apache.naming.NamingContext.lookup(NamingContext.java:139)
| at org.apache.naming.NamingContext.lookup(NamingContext.java:780)
| at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
| at org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at org.jboss.seam.util.Transactions.getUserTransaction(Transactions.java:153)
| at org.jboss.seam.util.Transactions.isUTTransactionActiveOrMarkedRollback(Transactions.java:122)
| at org.jboss.seam.util.Transactions.isTransactionActiveOrMarkedRollback(Transactions.java:50)
| at org.jboss.seam.web.ExceptionFilter.rollbackTransactionIfNecessary(ExceptionFilter.java:128)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:63)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
| at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
| at java.lang.Thread.run(Thread.java:595)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4029527#4029527
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4029527
19Â years, 1Â month
[JBoss Portal] - Re: access to outer request/session from within portlet
by Antoine_h
About the session : store the locale in the session, for easy access in other places than the portlet.
- from the login.jsp, to have a i18n login page
- in other jsp or jsf pages
or to have the current choosen localed store somewhere global, if the user does not allow the cookie.
I have not used it really yet, but when storing the locale in a cookie, i anticipated this and store it also in the session.
for the login.jsp, I will soon...
About the HttpServletRequest and Response :
- for the session
- for setting and retrieving a cookie.
cookie to store the locale, from one visit to another.
I am not keen on using this, as it is not JSR-168 compliant, but... is there a compliant way ?
(working on two portal projects, different companies, both need i18n... and locale stored between two visits).
may be with a servlet wrapper and playing with a parameter to trigger the work ?
or with an interceptor on the portlets or the portal container ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4029525#4029525
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4029525
19Â years, 1Â month
[JBossWS] - Server-side NullpointerException when using ws-security
by openyourmind
Hello,
I have some problems using ws-security.
My WS runs correctly without wssecurity, but when I activate it I get an strange server-side NullPointerException.
My config is :
- jboss 4.0.5.GA EJB3 config
- jbossws-1.2.0.GA
- jdk 1.5_08
This is what we get in the server log from the server start up until the exception.
|
| 2007-03-19 22:21:38,895 INFO [org.jboss.system.server.Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)] Started in 48s:327ms
| 2007-03-19 22:29:00,239 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 450000
| 2007-03-19 22:29:01,749 DEBUG [org.jboss.ws.core.server.ServiceEndpoint] WSDL request, using host: chaponniere-linux
| 2007-03-19 22:29:01,791 DEBUG [org.jboss.ws.core.server.ServiceEndpoint] WSDL request, using host: chaponniere-linux
| 2007-03-19 22:29:05,181 DEBUG [org.jboss.ws.core.server.AbstractServiceEndpointServlet] doPost: /procedures-beans/PstProcedureManager
| 2007-03-19 22:29:05,189 DEBUG [org.jboss.ws.core.soap.MessageContextAssociation] pushMessageContext: org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS@1757322 (Thread http-0.0.0.0-8080-1)
| 2007-03-19 22:29:05,190 DEBUG [org.jboss.ws.core.server.ServiceEndpoint] BEGIN handleRequest: jboss.ws:context=procedures-beans,endpoint=PstProcedureManager
| 2007-03-19 22:29:05,220 DEBUG [org.jboss.ws.core.soap.MessageFactoryImpl] createMessage: [contentType=text/xml; charset=UTF-8]
| 2007-03-19 22:29:05,245 DEBUG [javax.xml.soap.FactoryLoader] Load from Service API META-INF/services/javax.xml.soap.SOAPFactory: org.jboss.ws.core.soap.SOAPFactoryImpl
| 2007-03-19 22:29:05,245 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@12c4d8f, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@c6948c{ url=null ,addedOrder=0}
| 2007-03-19 22:29:05,265 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callRequestHandlerChain: PRE
| 2007-03-19 22:29:05,266 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: PRE
| 2007-03-19 22:29:05,266 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] Clear handler map: {}
| 2007-03-19 22:29:05,268 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] addHandler: [service=null,port=null,binding=http://schemas.xmlsoap.org/wsdl/soap/http]... Handler
| 2007-03-19 22:29:05,268 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: ENDPOINT
| 2007-03-19 22:29:05,268 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] Clear handler map: {}
| 2007-03-19 22:29:05,268 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: POST
| 2007-03-19 22:29:05,268 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] Clear handler map: {}
| 2007-03-19 22:29:05,268 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] getHandlerChain: [type=PRE,info=[service={http://procedure.procedures/}PstProcedureManagerS...]
| 2007-03-19 22:29:05,268 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] add protocol handlers: [WSSecurity Handler]
| 2007-03-19 22:29:05,274 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Create a handler executor: [WSSecurity Handler]
| 2007-03-19 22:29:05,274 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Enter: handleRequest
| 2007-03-19 22:29:05,279 DEBUG [org.jboss.ws.core.soap.SOAPMessageDispatcher] getDispatchDestination: null
| 2007-03-19 22:29:05,279 ERROR [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Exception during handler processing
| java.lang.NullPointerException
| at org.jboss.ws.extensions.security.WSSecurityDispatcher.handleInbound(WSSecurityDispatcher.java:130)
| at org.jboss.ws.extensions.security.jaxws.WSSecurityHandler.handleInboundSecurity(WSSecurityHandler.java:59)
| at org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerServer.handleInbound(WSSecurityHandlerServer.java:41)
| at org.jboss.ws.core.jaxws.handler.GenericHandler.handleMessage(GenericHandler.java:55)
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:276)
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleRequest(HandlerChainExecutor.java:112)
| at org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS.callRequestHandlerChain(HandlerDelegateJAXWS.java:65)
| at org.jboss.ws.core.server.AbstractServiceEndpointInvoker.callRequestHandlerChain(AbstractServiceEndpointInvoker.java:106)
| at org.jboss.ws.core.server.AbstractServiceEndpointInvoker.invoke(AbstractServiceEndpointInvoker.java:140)
| at org.jboss.ws.core.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:204)
| at org.jboss.ws.core.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java:440)
| at org.jboss.ws.core.server.AbstractServiceEndpointServlet.doPost(AbstractServiceEndpointServlet.java:114)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| at org.jboss.ws.core.server.AbstractServiceEndpointServlet.service(AbstractServiceEndpointServlet.java:75)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
| 2007-03-19 22:29:05,280 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Exit: handleRequest with status: false
| 2007-03-19 22:29:05,282 ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] SOAP request exception
| javax.xml.ws.WebServiceException: java.lang.NullPointerException
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.processHandlerFailure(HandlerChainExecutor.java:262)
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleRequest(HandlerChainExecutor.java:124)
| at org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS.callRequestHandlerChain(HandlerDelegateJAXWS.java:65)
| at org.jboss.ws.core.server.AbstractServiceEndpointInvoker.callRequestHandlerChain(AbstractServiceEndpointInvoker.java:106)
| at org.jboss.ws.core.server.AbstractServiceEndpointInvoker.invoke(AbstractServiceEndpointInvoker.java:140)
| at org.jboss.ws.core.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:204)
| at org.jboss.ws.core.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java:440)
| at org.jboss.ws.core.server.AbstractServiceEndpointServlet.doPost(AbstractServiceEndpointServlet.java:114)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| at org.jboss.ws.core.server.AbstractServiceEndpointServlet.service(AbstractServiceEndpointServlet.java:75)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: java.lang.NullPointerException
| at org.jboss.ws.extensions.security.WSSecurityDispatcher.handleInbound(WSSecurityDispatcher.java:130)
| at org.jboss.ws.extensions.security.jaxws.WSSecurityHandler.handleInboundSecurity(WSSecurityHandler.java:59)
| at org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerServer.handleInbound(WSSecurityHandlerServer.java:41)
| at org.jboss.ws.core.jaxws.handler.GenericHandler.handleMessage(GenericHandler.java:55)
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:276)
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleRequest(HandlerChainExecutor.java:112)
| ... 28 more
|
|
My client-side code
|
| wsdlURL = new URL("http://chaponniere-linux:8080/procedures-beans/PstProcedureManager?wsdl");
| URL securityURL = new File("jboss-wsse-client.xml").toURL();
| QName serviceName = new QName("http://procedure.procedures/", "PstProcedureManagerService");
|
| Service service = Service.create(wsdlURL, serviceName);
| ((ServiceExt)service).setSecurityConfig(securityURL.toExternalForm());
|
| PstProcedureManager port = (PstProcedureManager)service.getPort(PstProcedureManager.class);
| //Hello port = (Hello)service.getPort(Hello.class);
| ((StubExt)port).setConfigName("Standard WSSecurity Client");
|
|
| Map<String, Object> reqContext = ((BindingProvider)port).getRequestContext();
| //reqContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:8080/jaxws-samples-wssecurity-encrypt");
| reqContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://chaponniere-linux:8080/procedures-beans/PstProcedureManager?wsdl");
|
| String procedureNumber = port.getProcedure(1).getNumber();
| System.out.println(procedureNumber);
|
|
And finally my WS.
|
| @WebService
| @EndpointConfig(configName = "Standard WSSecurity Endpoint")
| public class PstProcedureManager implements PstProcedureInterface {
|
| @PersistenceContext
| protected EntityManager em;
|
| @WebMethod
| public PstProcedureBean getProcedure(int pId) {
| Collection procedureCol =
| em.createQuery("from PstProcedureBean procedureBean where procedureBean.id = :id")
| .setParameter ("id", pId)
| .getResultList();
|
|
| return (PstProcedureBean)procedureCol.iterator().next();
| }
| }
|
|
I cannot see where the problem might come from and I would greatly appreciate your help with this issue.
Thanks in advance
M.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4029524#4029524
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4029524
19Â years, 1Â month