Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Inconvertible types error!!!

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Can someone pinpoint why I am getting this error?
TIA!!!
Jai
________________________________________________________________________
D:\projects\advice>javac -classpath %CLASSPATH%;AdviceAppClient.jar AdviceClient.java
AdviceClient.java:20: inconvertible types
found : java.lang.Object
required: AdviceHome
AdviceHome home = (AdviceHome)PortableRemoteObject.narrow(o, AdviceHome.class);
^
AdviceClient.java:22: cannot resolve symbol
symbol : method create ()
location: class AdviceHome
Advice advisor = home.create();
^
AdviceClient.java:23: cannot resolve symbol
symbol : method getAdvice ()
location: class Advice
System.out.println(advisor.getAdvice());
^
3 errors
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think javac is not finding your AdviceAppClient.jar - try putting in the full path to it: d:\projects\advice\AdviceAppClient.jar
If that doesn't work, copy the relevant portions of the classpath variable (.;c:\jdk1.3.1_09\jre\lib\rt.jar;C:\j2sdkee1.3.1\lib\j2ee.jar) adding the jar as a full path and retry the compile without using %classpath% (For me it didn't like my classpath varible because I had database drivers that had directory names containing spaces.)
 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lu
I think the jar file is set right otherwise he wud have got a NamingNotFound exception. I guess its a problem with the deployment. Might be that he did not specify the Home interface correctly while deployment. Jai try that. Try redeploying and make sure u specify the home and component interfaces correctly.
Also as a general case make sure that ur paths are set correctly. use this link below
http://www.oreilly.com/catalog/hfjejb/errata/hfjejb.help
 
Jai Verma
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added D:\projects\advice to the CLASSPATH and now I can compile it after seeing a solution on this forum today.
Thanks,
Jai
 
You've gotta fight it! Don't give in! Read this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic