[jboss-jira] [JBoss JIRA] Updated: (JBAS-4116) JRMPInvokerHA fails with a NPE when no JRMPInvoker is setup on the server
Brian Stansberry (JIRA)
jira-events at lists.jboss.org
Fri Feb 23 17:11:36 EST 2007
[ http://jira.jboss.com/jira/browse/JBAS-4116?page=all ]
Brian Stansberry updated JBAS-4116:
-----------------------------------
Fix Version/s: JBossAS-4.2.0.CR1
I asked about the use case that exposes this issue; I never said I wouldn't fix it and don't particularly appreciate the implication that I was trying to get out of it. When a bug gets fixed is a different issue, particularly as we are at or somewhat over a cutoff point for a release and putting fixes in _now_ for bugs only exposed by bizarre use cases is not IMHO justified.
That said, Andy, thank you for the report and the comment on the use case. You are right that the presence of jrmpha in standardjboss.xml makes this not a bizarre use case. So, I'll be fixing this today for 4.2.0.CR1 (unless Dimitris rules its too late.)
Thanks, Adrian for the analysis. I'll fix this along the lines you suggested.
> JRMPInvokerHA fails with a NPE when no JRMPInvoker is setup on the server
> -------------------------------------------------------------------------
>
> Key: JBAS-4116
> URL: http://jira.jboss.com/jira/browse/JBAS-4116
> Project: JBoss Application Server
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Clustering
> Affects Versions: JBossAS-4.0.5.GA, JBossAS-4.0.5.CR1, JBossAS-4.0.4.GA
> Environment: SuSE Linux 10.2 XEN Instance, AMD64 Dual Core 5000+, 1GB Memory
> Reporter: Andreas Schaefer
> Assigned To: Brian Stansberry
> Priority: Minor
> Fix For: JBossAS-4.2.0.CR1
>
>
> When JRMPInvokerHA is used but instead of the JRMPInvoker another Invoker like the Pooled is used then the JRMPInvokerHA will fail with a NPE on the invoke() method of the JRMPInvokerHA accessing the importTPC() method of the JRMPInvoker:
> Caused by: java.lang.NullPointerException
> at org.jboss.invocation.jrmp.server.JRMPInvoker.importTPC(JRMPInvoker.java:595)
> at org.jboss.invocation.jrmp.server.JRMPInvokerHA.invoke(JRMPInvokerHA.java:151)
> The problem was dormant until now because the variable called 'tcpImporter' is static and so any instance of JRMPInvoker will set it. Unfortunately the variable is not set by the JRMPInvokerHA by itself because the method startService() is overwriten and does not call the super method.
> I fixed that issue this way:
> 1) Extract the setting of the tcpImporter in the JRMPInvoker in its own, protected method:
> protected void createTPCInvoker() {
> // FIXME marcf: This should not be here
> // and the transaction propagation context importer
> tpcImporter = TransactionPropagationContextUtil.getTPCImporter();
> }
> 2). Call this method from within the startService() method of the JRMPInvoker (a) and the JRMPInvokerHA (b):
> a)
> protected void startService() throws Exception
> {
> loadCustomSocketFactories();
> if (log.isDebugEnabled())
> {
> log.debug("RMI Port='" +
> (rmiPort == ANONYMOUS_PORT ? "Anonymous" :
> Integer.toString(rmiPort)) + "'");
> log.debug("Client SocketFactory='" +
> (clientSocketFactory == null ? "Default" :
> clientSocketFactory.toString()) + "'");
> log.debug("Server SocketFactory='" +
> (serverSocketFactory == null ? "Default" :
> serverSocketFactory.toString()) + "'");
> log.debug("Server SocketAddr='" +
> (serverAddress == null ? "Default" :
> serverAddress) + "'");
> log.debug("SecurityDomain='" +
> (sslDomain == null ? "Default" :
> sslDomain) + "'");
> }
> InitialContext ctx = new InitialContext();
> createTPCInvoker();
> // Set the transaction manager and transaction propagation
> // context factory of the GenericProxy class
> Invoker delegateInvoker = createDelegateInvoker();
> // Make the remote invoker proxy available for use by the proxy factory
> Registry.bind(support.getServiceName(), delegateInvoker);
> // Export CI
> exportCI();
> log.debug("Bound JRMP invoker for JMX node");
> ctx.close();
> }
> b)
> protected void startService() throws Exception
> {
> loadCustomSocketFactories();
> if (log.isDebugEnabled())
> {
> log.debug("RMI Port='" + (rmiPort == ANONYMOUS_PORT ?
> "Anonymous" : Integer.toString(rmiPort)+"'"));
> log.debug("Client SocketFactory='" + (clientSocketFactory == null ?
> "Default" : clientSocketFactory.toString()+"'"));
> log.debug("Server SocketFactory='" + (serverSocketFactory == null ?
> "Default" : serverSocketFactory.toString()+"'"));
> log.debug("Server SocketAddr='" + (serverAddress == null ?
> "Default" : serverAddress+"'"));
> log.debug("SecurityDomain='" + (sslDomain == null ?
> "None" : sslDomain+"'"));
> }
> createTPCInvoker();
> exportCI();
> Registry.bind(support.getServiceName(), this);
> }
> I also don't think that the tcpInvoker should be static and I tested it without being static and it worked for me but that is another story.
> -Andy
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list