• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

ejb hanging

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi frirends,
i have created a ejb and calling it through client program

which is deployed with the ejb application. on running it on

j2ee Application Server 8

i get errors on the home interface

the details: -

the remote interface


the home interface

the EJB class


the client program

[CODE}
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import java.math.BigDecimal;
public class ConverterClient {
public static void main(String [] args)){
try {
Context myEnv =
(Context)initial.lookup("java:comp/env");
Object objref =myEnv.lookup("ejb/SimpleConverter");
ConverterHome home =
(ConverterHome)PortableRemoteObject.narrow(objref,
ConverterHome.class);
Converter currencyConverter =home.create();
BigDecimal param =new BigDecimal ("100.00");
BigDecimal amount =
currencyConverter.dollarToYen(param);
System.out.println(amount);
amount =currencyConverter.yenToEuro(param);
System.out.println(amount);
System.exit(0);
}catch (Exception ex){
System.err.println("Caught an unexpected exception!");
ex.printStackTrace();
}
}
}
[/CODE]
in the ejb reference tab in the deploytool

Coded Name field -> ejb/SimpleConverter
EJB Type field -> Session
Interfaces field -> Remote
Home Interface field -> converter.ConverterHome
Local/Remote Interface field ->converter.Converter
JNDI Name field -> ConverterBean


on running the program
Appclient �client ConverterAppClient.jar

i get the error on the command line

any help
thanks
Pradyut
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Did you define the package "converter" in your code?
 
Pradyut Bhattacharya
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
on defining the package
converter.ConverterHome
still it's not working
the code

[CODE]
import converter.Converter;
import converter.ConverterHome;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import java.math.BigDecimal;


public class ConverterClient {
public static void main(String[] args) {
try {
Context initial = new InitialContext();
Context myEnv = (Context) initial.lookup("java:comp/env");
Object objref = myEnv.lookup("ejb/SimpleConverter");

ConverterHome home =
(ConverterHome) PortableRemoteObject.narrow(objref,
ConverterHome.class);

Converter currencyConverter = home.create();

BigDecimal param = new BigDecimal("100.00");
BigDecimal amount = currencyConverter.dollarToYen(param);

System.out.println(amount);
amount = currencyConverter.yenToEuro(param);
System.out.println(amount);

System.exit(0);
} catch (Exception ex) {
System.err.println("Caught an unexpected exception!");
ex.printStackTrace();
}
}
}
[CODE]
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Gabriel said, did you put "package converter;" in your Coverter classes?
What is the error you are getting now?
Your posting is titled "EJB hanging". What is that?

-Siplin
 
Pradyut Bhattacharya
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
this is in context to my problem

i have jdk5 installed in win xp sp2
when i do java <filename>
i get the error on my machine
Exception in thread "main" java.lang.NoClassDefFoundError: <filename>
i correct it by doing
java -cp . <filename>
then it runs fine.

but on running a client ejb program on the command line
AppClient -client <filename>
i again get the error
WARNING: ACC003: Application threw an exception.
java.lang.NoClassDefFoundError: converter.ConverterHome
where converter.ConverterHome is contained in the jar file

i do not get a solution to this problem
how can i correct the above problem or the overall problem such that
when i give the command
java <filename>
i get the output simply
any helps
Pradyut
 
I'm sure glad that he's gone. Now I can read this tiny ad in peace!
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic