• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem on hfejsb page 57

 
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when i try to compile AdviceClient.java, ising the javac command on page 57 i get this error -



i tried adding c:\projects\advice\classes to the CLASSPATH, but this did not solve the problem.

whats worng ?
i believe this is a core java problem, but whats wrong
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i also tired adding this to the CLASSPATH -

c:\projects\advice\AdviceAppClient.jar

and then compiling as

c:\projects\advice>javac AdviceClient.java, but still i get the same error

so i tried the unconvetional way

toop all the .java to c:\j2sdk_dir\bin
compiled there
got the AdviceClient.class
and pasted it in c:\projects\advice

and tird this

c:\projects\advice>java AdviceClient
but got this error -
Exception in thread "main" java.lang.NoClassDefFoundError: AdviceClient

guys, please help me !
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i got this server log on the console, when i deployed the bean

Deploy the application in C:\projects\advice\AdviceApp.ear on the server localho
st saving the client jar as C:\projects\advice\AdviceAppClient.jar
Sender object Deploy Tool : Deploy AdviceApp on localhost
Remote message: Contacted Server....
Remote message: Application AdviceApp transferred.
Remote message: AdviceApp has 1 ejbs, 0 web components to deploy.
Remote message: Deploying Ejbs....
Remote message: Processing beans ....
Remote message: Compiling wrapper code ....
Remote message: Compiling RMI-IIOP code ....
Remote message: Making server JARs ....
Remote message: Making client JARs ....
Remote message: Deployment of AdviceApp is complete..
Sender object Deploy Tool : client code at http://10.168.110.71:9191/AdviceAppCl
ient.jar
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i tried restarting the server, got this on the command prompt, and got this trace -

C:\j2sdkee1.3.1\bin>j2ee -verbose
J2EE server listen port: 1050
Naming service started:1050
Binding DataSource, name = jdbc/Cloudscape, url = jdbc:cloudscape:rmi:Cloudscape
DB;create=true
Binding DataSource, name = jdbc/DB2, url = jdbc:cloudscape:rmi:CloudscapeDB;crea
te=true
Binding DataSource, name = jdbc/InventoryDB, url = jdbc:cloudscape:rmi:Cloudscap
eDB;create=true
Binding DataSource, name = jdbc/EstoreDB, url = jdbc:cloudscape:rmi:CloudscapeDB
;create=true
Binding DataSource, name = jdbc/DB1, url = jdbc:cloudscape:rmi:CloudscapeDB;crea
te=true
Binding DataSource, name = jdbc/XACloudscape, url = jdbc/XACloudscape__xa
Binding DataSource, name = jdbc/XACloudscape__xa, dataSource = COM.cloudscape.co
re.RemoteXaDataSource@82751
Starting JMS service...
Initialization complete - waiting for client requests
Binding: < JMS Destination : jms/Topic , javax.jms.Topic >
Binding: < JMS Destination : jms/Queue , javax.jms.Queue >
Binding: < JMS Cnx Factory : jms/QueueConnectionFactory , Queue , No properties
>
Binding: < JMS Cnx Factory : QueueConnectionFactory , Queue , No properties >
Binding: < JMS Cnx Factory : jms/TopicConnectionFactory , Topic , No properties
>
Binding: < JMS Cnx Factory : TopicConnectionFactory , Topic , No properties >
Starting web service at port: 8000
Starting secure web service at port: 7000
J2EE SDK/1.3.1
Starting web service at port: 9191
J2EE SDK/1.3.1
Loading jar:/C:/j2sdkee1.3.1/repository/hpp6062/applications/AdviceApp1171297764
441Server.jar
J2EE server startup complete.

recompiled the AdviceClient.jar but got same 6 errors as above.

tried to re run,
but again got a Exception in main( ) error

guys please help me
 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what command did you use to get server side class files?
[ February 12, 2007: Message edited by: Rajan Murugan ]
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i got the code from wickedlysmart.com
unziped the file to get two folders - advice, customer
copied the advice folder to c: ad
c:\projects\advice
made sure that all the folder strucutre is as per the book

actually i never needed to compile anything as the downloaded code has
.class files also

but i have probles as mentioned in posts above

please help

i am stuck here !

thanks in advance !
 
Ranch Hand
Posts: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I remember getting this error too.

I modified the command, like this :

javac -classpath c:\j2sdkee1.3.1\lib\j2ee.jar;AdviceAppClient.jar AdviceClient.java

with AdviceAppClient.jar in the same path of course.
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i ahve already added the j2ee.jar to the classpath
do i need to add AdviceAppClient.jar in the classpath ?

if yes, does this mean, every .jar related to my bean development needs to be added like this


please help me out guys
why am i seeing myself beg in this bcd forum ?
the wcd forum was so hot and happening

please help
 
Celinio Fernandes
Ranch Hand
Posts: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i added it in the command line.
Forget the CLASSPATH environment variable, it's buggy in that case as you can see.
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
javac -classpath c:\j2sdkee1.3.1\lib\j2ee.jar;AdviceAppClient.jar AdviceClient.java

this is compiling fine now.

but the

java -cp AdviceAppClient.jar AdviceClient sint working
even if i append the class path in it
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
guys
still the same issues -

1. cant compile AdviceClient.java
2. cant run it ( though i do have the pre compiled class file with me )
from wickedly smart

in 1 in get cannot resolve symbol for Advice and AdviceHome
in 2 i get NoClassDefFound error

he he ... this is what i feel -
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Niranjan,

NOt sure if you got past the problem you have specified.If not, see if following can help.(I am able to compile fine without any problem).

1.If you are getting NoClassDefError it generally means it is able to find the jar file but the other jar files that it depends on are not found.

2.In the HFEJB book the syntax for the classpath was for unix environment.For windows use ";" instead of ":" and %classpath% instead of "$CLASSPATH".

3.Try adding -verbose and see if it gives any useful information

(
I have a seperate issue though , I get an error when running the client (java -cp.... ).Compiles fine.I have posted here.
https://coderanch.com/t/162655/java-EJB-SCBCD/certification/HELP-HFEJB-AdviceClient-Error-javax
)

-Rahul

[ February 17, 2007: Message edited by: Rahul Toaikani ]
[ February 17, 2007: Message edited by: Rahul Toaikani ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic