Tuesday March 22, 2005
Bug in Duke's Bank example in the J2EE 1.4 Tutorial update 4, and workaround

There is a bug in NextIdBean.ejbCreate() in update 4 of the J2EE 1.4 Tutorial.

public Object ejbCreate() throws CreateException { return null; }

should be:

public String ejbCreate() throws CreateException { return null; }

This bug doesn't show up when using J2SE 5, only when using J2SE 1.4. J2SE 5 allows subclasses to have different return types. Look for a bug-fix update to the J2EE 1.4 Tutorial within a few weeks.

Trackback URL: http://blogs.sun.com/ievans/entry/bug_in_duke_s_bank
Comments:

Even with the recommended changes "Dukes Bank application" returns the following error: Your request cannot be completed. The server got the following error: javax.servlet.jsp.JspTagException: An error occurred while getting property "accounts" from an instance of class com.sun.ebank.web.CustomerBean Iff the CustomerHackFilter.class of http://blogs.sun.com/roller/page/ievans/20050322#bug_in_duke_s_bank is also installed in the WAR-File, everything works. JS

Posted by johannes steffen on April 08, 2005 at 03:20 AM PDT #

Hi Johannes. We're looking into this problem. I can reproduce the bug (which never showed up during development & testing back in December--hmm). Stay tuned. -ian

Posted by Ian Evans on April 09, 2005 at 04:14 PM PDT #

Hi I am using j2ee tutorial 14 .When i run the dukes bank application, the web client runs okay but there is problem when i run the appclient using appclient -client DukesBankAppClient.jar following errors appear in the command prompt at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:286 ) at javax.naming.InitialContext.lookup(InitialContext.java:351) at com.sun.ebank.util.EJBGetter.getAccountControllerHome(Unknown Source) at com.sun.ebank.appclient.DataModel.<init>(Unknown Source) at com.sun.ebank.appclient.EventHandle.<init>(Unknown Source) at com.sun.ebank.appclient.BankAdmin.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:23 7) at com.sun.enterprise.appclient.Main.<init>(Main.java:430) at com.sun.enterprise.appclient.Main.main(Main.java:99) Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection ref used: connect at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSock etFactory.java:336) at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>( SocketOrChannelConnectionImpl.java:191) ... 25 more Caused by: java.net.ConnectException: Connection refused: connect at sun.nio.ch.Net.connect(Native Method) at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:464) at java.nio.channels.SocketChannel.open(SocketChannel.java:146) at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSock etFactory.java:320) ... 26 more Dec 30, 2006 6:46:19 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectio nImpl <init> WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR _TEXT; hostname: dannu; port: 3700" org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(O RBUtilSystemException.java:2257) at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(O RBUtilSystemException.java:2278) at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>( SocketOrChannelConnectionImpl.java:208) at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>( SocketOrChannelConnectionImpl.java:221) at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.create Connection(SocketOrChannelContactInfoImpl.java:104) at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.begin Request(CorbaClientRequestDispatcherImpl.java:152) at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaC lientDelegateImpl.java:146) at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClie ntDelegateImpl.java:286) at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112) at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java :69) at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext. java:89) at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.jav a:128) at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288 ) at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl. java:725) at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.j ava:132) at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:286 ) at javax.naming.InitialContext.lookup(InitialContext.java:351) at com.sun.ebank.util.EJBGetter.getAccountControllerHome(Unknown Source) at com.sun.ebank.appclient.DataModel.<init>(Unknown Source) at com.sun.ebank.appclient.EventHandle.<init>(Unknown Source) at com.sun.ebank.appclient.BankAdmin.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:23 7) at com.sun.enterprise.appclient.Main.<init>(Main.java:430) at com.sun.enterprise.appclient.Main.main(Main.java:99) Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection ref used: connect at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSock etFactory.java:336) at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>( SocketOrChannelConnectionImpl.java:191) ... 25 more Caused by: java.net.ConnectException: Connection refused: connect at sun.nio.ch.Net.connect(Native Method) at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:464) at java.nio.channels.SocketChannel.open(SocketChannel.java:146) at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSock etFactory.java:320) ... 26 more Dec 30, 2006 6:46:20 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectio nImpl <init> WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR _TEXT; hostname: dannu; port: 3700" org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(O RBUtilSystemException.java:2257) at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(O RBUtilSystemException.java:2278) at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>( SocketOrChannelConnectionImpl.java:208) at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>( SocketOrChannelConnectionImpl.java:221) at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.create Connection(SocketOrChannelContactInfoImpl.java:104) at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.begin Request(CorbaClientRequestDispatcherImpl.java:152) at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaC lientDelegateImpl.java:146) at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClie ntDelegateImpl.java:286) at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112) at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java :69) at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext. java:89) at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.jav a:128) at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288 ) at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl. java:725) at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.j ava:132) at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:286 ) at javax.naming.InitialContext.lookup(InitialContext.java:351) at com.sun.ebank.util.EJBGetter.getAccountControllerHome(Unknown Source) at com.sun.ebank.appclient.DataModel.<init>(Unknown Source) at com.sun.ebank.appclient.EventHandle.<init>(Unknown Source) at com.sun.ebank.appclient.BankAdmin.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:23 7) at com.sun.enterprise.appclient.Main.<init>(Main.java:430) at com.sun.enterprise.appclient.Main.main(Main.java:99) Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection ref used: connect at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSock etFactory.java:336) at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>( SocketOrChannelConnectionImpl.java:191) ... 25 more Caused by: java.net.ConnectException: Connection refused: connect at sun.nio.ch.Net.connect(Native Method) at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:464) at java.nio.channels.SocketChannel.open(SocketChannel.java:146) at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSock etFactory.java:320) ... 26 more Dec 30, 2006 6:46:21 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectio nImpl <init> WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR _TEXT; hostname: dannu; port: 3700" org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(O RBUtilSystemException.java:2257) at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(O RBUtilSystemException.java:2278) at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>( SocketOrChannelConnectionImpl.java:208) at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>( SocketOrChannelConnectionImpl.java:221) at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.create Connection(SocketOrChannelContactInfoImpl.java:104) at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.begin Request(CorbaClientRequestDispatcherImpl.java:152) at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaC lientDelegateImpl.java:146) at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClie ntDelegateImpl.java:286) at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112) at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java :69) at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext. java:89) at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.jav a:128) at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288 ) at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl. java:725) at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.j ava:132) at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:286 ) at javax.naming.InitialContext.lookup(InitialContext.java:351) at com.sun.ebank.util.EJBGetter.getAccountControllerHome(Unknown Source) at com.sun.ebank.appclient.DataModel.<init>(Unknown Source) at com.sun.ebank.appclient.EventHandle.<init>(Unknown Source) at com.sun.ebank.appclient.BankAdmin.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:23 7) at com.sun.enterprise.appclient.Main.<init>(Main.java:430) at com.sun.enterprise.appclient.Main.main(Main.java:99) Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection ref used: connect at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSock etFactory.java:336) at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>( SocketOrChannelConnectionImpl.java:191) ... 25 more Caused by: java.net.ConnectException: Connection refused: connect at sun.nio.ch.Net.connect(Native Method) at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:464) at java.nio.channels.SocketChannel.open(SocketChannel.java:146) at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSock etFactory.java:320) ... 26 more javax.naming.CommunicationException: Can't find SerialContextProvider [Root exce ption is org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: N o] at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.jav a:135) at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288 ) at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl. java:725) at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.j ava:132) at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:286 ) at javax.naming.InitialContext.lookup(InitialContext.java:351) at com.sun.ebank.util.EJBGetter.getAccountControllerHome(Unknown Source) at com.sun.ebank.appclient.DataModel.<init>(Unknown Source) at com.sun.ebank.appclient.EventHandle.<init>(Unknown Source) at com.sun.ebank.appclient.BankAdmin.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:23 7) at com.sun.enterprise.appclient.Main.<init>(Main.java:430) at com.sun.enterprise.appclient.Main.main(Main.java:99) Caused by: org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(O RBUtilSystemException.java:2257) at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(O RBUtilSystemException.java:2278) at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>( SocketOrChannelConnectionImpl.java:208) at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>( SocketOrChannelConnectionImpl.java:221) at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.create Connection(SocketOrChannelContactInfoImpl.java:104) at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.begin Request(CorbaClientRequestDispatcherImpl.java:152) at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaC lientDelegateImpl.java:146) at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClie ntDelegateImpl.java:286) at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112) at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java :69) at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext. java:89) at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.jav a:128) ... 16 more Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection ref used: connect at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSock etFactory.java:336) at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>( SocketOrChannelConnectionImpl.java:191) ... 25 more Caused by: java.net.ConnectException: Connection refused: connect at sun.nio.ch.Net.connect(Native Method) at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:464) at java.nio.channels.SocketChannel.open(SocketChannel.java:146) at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSock etFactory.java:320) ... 26 more What does these reeors mean Please help

Posted by Shruti on February 01, 2007 at 03:08 PM PST #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed