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.
http://community.jboss.org/wiki/ClassCastExceptions
4 comments:
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.
-
Update 2021: Navigate to e-Services -> My Certificates -> Home Loan Int. Cert.(Prov) Update 2018: SBI has made some changes to their o...
-
Generating an online statement from LIC Housing Finance Ltd is very easy, simply follow the below steps to create an online account with LIC...
-
Are you searching for Induction Cook-top error codes? Here you can find the error codes of all popular induction cooktops and how to trouble...
Follow Us
Link List
About Us
Tag Cloud
2018
2019
2021
2022
2025
ai
Amazon Prime Video
Android
artificial intelligence
automation
Automobiles
aws
Bandwidth
Bangalore
Certificate
Chennai
Cochin
Data Usage
Database
Dealers
Delhi
DLNA
DMS
Education
Entertainment
Finance
Free Online Courses
Freelance sites
GigaFiber
h2
h2db
H5X
Home and Entertainment
Home Loan
housing loan
Income Tax
India
Insurance
Internet
Internet Usage
Investment
Inward Remittance
IPO
Java
jdbc
Jio
Kia
Kolkata
LIC
LICHFL
Mac
Madras IIT
make money online
Marketing
Maven
Mobile Phone
MotoG 4
msme
Mumbai
mybatis
National Pension Scheme
Nexon
NPS
NPTEL
Online courses India
ONT
postgresql
Pune
Purpose Code
Reviews
Router
S3
SBI
Seltos
Spring
Spring Batch
Spring Boot
Spring Cloud
springboot
Stock Market
Swayam
Tata
Technology
Tips & Tricks
Tomcat
Travel
UPI
Web Hosting
Wifi
Youtube
Youtube Kids
Popular Posts
-
Are you searching for Induction Cook-top error codes? Here you can find the error codes of all popular induction cooktops and how to trouble...
-
Generating an online statement from LIC Housing Finance Ltd is very easy, simply follow the below steps to create an online account with LIC...
-
Update 2021: Navigate to e-Services -> My Certificates -> Home Loan Int. Cert.(Prov) Update 2018: SBI has made some changes to their o...
Labels
- 2018 (4)
- 2019 (3)
- 2021 (1)
- 2022 (1)
- 2025 (1)
- ai (1)
- Amazon Prime Video (1)
- Android (12)
- artificial intelligence (1)
- automation (1)
- Automobiles (6)
- aws (3)
- Bandwidth (3)
- Bangalore (3)
- Certificate (1)
- Chennai (1)
- Cochin (1)
- Data Usage (3)
- Database (6)
- Dealers (1)
- Delhi (1)
- DLNA (1)
- DMS (1)
- Education (40)
- Entertainment (29)
- Finance (47)
- Free Online Courses (1)
- Freelance sites (1)
- GigaFiber (2)
- h2 (1)
- h2db (1)
- H5X (1)
- Home and Entertainment (66)
- Home Loan (2)
- housing loan (1)
- Income Tax (3)
- India (1)
- Insurance (1)
- Internet (55)
- Internet Usage (3)
- Investment (2)
- Inward Remittance (1)
- IPO (1)
- Java (34)
- jdbc (1)
- Jio (2)
- Kia (1)
- Kolkata (1)
- LIC (1)
- LICHFL (2)
- Mac (1)
- Madras IIT (1)
- make money online (2)
- Marketing (24)
- Maven (1)
- Mobile Phone (2)
- MotoG 4 (1)
- msme (1)
- Mumbai (1)
- mybatis (1)
- National Pension Scheme (3)
- Nexon (1)
- NPS (3)
- NPTEL (1)
- Online courses India (1)
- ONT (1)
- postgresql (1)
- Pune (1)
- Purpose Code (1)
- Reviews (31)
- Router (2)
- S3 (2)
- SBI (2)
- Seltos (1)
- Spring (3)
- Spring Batch (2)
- Spring Boot (2)
- Spring Cloud (1)
- springboot (1)
- Stock Market (1)
- Swayam (1)
- Tata (2)
- Technology (59)
- Tips & Tricks (4)
- Tomcat (2)
- Travel (9)
- UPI (1)
- Web Hosting (7)
- Wifi (2)
- Youtube (2)
- Youtube Kids (1)
Blog Archive
-
▼
2010
(24)
-
▼
April
(8)
- XML to XSD to Java Generation Using JAXB and Trang
- How to configure port forwarding in TATA Indicom W...
- My Dell Studio 1535 keeps on shutting down at vari...
- Own domain name for your Blogger blog?
- Host your website for free!
- Virtual Home Server to Host Your Website for Free
- Hogenakkal Water Falls - India's Niagara
- EJB3 Remote JNDI lookup - javax.naming.Reference c...
-
▼
April
(8)
Recent Posts
Definition List
- Definition list
- Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
- Lorem ipsum dolor sit amet
- Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Unordered List
- Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
- Aliquam tincidunt mauris eu risus.
- Vestibulum auctor dapibus neque.


You can not even imagine how much your post helped me .
ReplyDeleteThank you very much.
@Anonymous, good to know that my blog saved your time! Thanks for posting comments.
ReplyDeleteThis post worked for me too...
ReplyDeleteThank Sunil.
- Amit
This helped me ...thanks
ReplyDelete