Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Why is it giving "package does not exist error"

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
I'm using jsdk1.4. The code for my remote interface is giving me this error. the code is as follows:

import javax.ejb.EJBObject;
import javax.rmi.RemoteException;

public interface song extends EJBObject
{
// Defining the business method
public String getsongID() throws RemoteException;
public String getcategory() throws RemoteException;
public String gettitle() throws RemoteException;
public String getartist() throws RemoteException;

}
The Error that it throws is:

song.java:3: package javax.ejb does not exist
import javax.ejb.EJBObject;
^
song.java:4: cannot resolve symbol
symbol : class RemoteException
location: package rmi
import javax.rmi.RemoteException;
^
song.java:6: cannot resolve symbol
symbol : class EJBObject
location: interface song
public interface song extends EJBObject
^
song.java:9: cannot resolve symbol
symbol : class RemoteException
location: interface song
public String getsongID() throws RemoteException;
^
song.java:10: cannot resolve symbol
symbol : class RemoteException
location: interface song
public String getcategory() throws RemoteException;
^
song.java:11: cannot resolve symbol
symbol : class RemoteException
location: interface song
public String gettitle() throws RemoteException;
^
song.java:12: cannot resolve symbol
symbol : class RemoteException
location: interface song
public String getartist() throws RemoteException;
^
7 errors
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
set j2ee.jar in your classpath
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I believe that your package declaration is incorrect in the import statement here "javax.rmi.RemoteException". It should be java.rmi.RemoteException.

SCJP (2)
SCWCD
SCBCD(In Progress)


 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sy befor u compile
do this
set JAVA_HOME=D:\j2sdk1.4.2_04\
set J2EE_HOME=D:\j2sdkee1.3\

set path=D:\j2sdk1.4.2_04\bin\;D:\j2sdkee1.3\bin\
set classpath=D:\j2sdkee1.3\lib\j2ee.jar;D:\j2sdk1.4.2_04\lib\dt.jar

D:\j2sdk1.4.2_04 is where my JDK is
D:\j2sdkee1.3 is where my J2ee is

if u dont have j2sdkee1.3 download it from sun
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm using weblogic 8.1 and i also get same exception "package javax.ejb does not exist". i already added weblogic.jar to the classpath manually. What else could be wrong?
    Bookmark Topic Watch Topic
  • New Topic