Search This Blog

Standalone Client
From a standalone client, when I was doing a remote JNDI lookup for a EJB3 remote bean, I was getting the following exception:

Exception in thread "main" java.lang.ClassCastException: javax.naming.Reference cannot be cast to sample.SampleRemote
at sample.Client.main(Client.java:14)

Sample bean was deployed in jboss-5.1.0.GA in a remote machine and I was running the client from my local machine. Initially I was suspecting the JNDI name I was using to do the lookup(JBoss' default remote jndi: <ejb-name>/remote) but after a few hours of research, I realized the issue is with the class loader.

The client was referring client classes of JBoss 5.0.1.GA which are not compatible with JBoss client classes in 5.1.0.GA.

So, I gave class path reference to 5.1.0.GA for my client and the lookup went fine!

Web Client
You may get a ClassCastException while trying to lookup/cast your EJB3 bean, the reason is described here.

Post a Comment

Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to our feed and get articles like this delivered automatically to your feed reader? Like our Facebook Page.

Whirlpool Induction Cooker Error CodesError CodeErrorSolutionF0An internal error was detected.Disconnect power. Wait 5 seconds before reconnecting power. If the symbol appears again, call for service.F2The surface cooking area is too hot and has turned off.Remove the pans from the surface cooking area. "F2" will disappear when the surface cooking area has cooled. If you turn the surface cooking area back on and "F2" reappears, the cooktop is still too hot. Turn off the surface cooking area and allow it to cool.F4The po…

Generating an online statement from LIC Housing Finance Ltd is very easy, simply follow the below steps to create an online account with LICHFL and generate statements online! You may use the online generated statement as a proof for principal paid for a housing loan(under section 80C) and interest paid(under section 24) while filing income tax returns.* Want to know how to save maximum income tax? Read our most read article how to save maximum income tax (opens in new tab).* Paying high interest to LICHFL? Learn how to reduce interest on your existing home loan (opens in new tab).Before reading further, make sure you have the following information with you: Your Loan Account NumberSanctioned AmountStep 1 - Open LICHFL websiteVisit LICHFL website and click on the 'New Customers? Click Here' link(refer the below screenshot). Step 2 - Enter your loan account detailsFill in the following details: New Loan NumberSanctioned AmountDate of BirthSecurity Codeand click on the Submit b…