Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why is it giving "package does not exist error"  RSS feed

 
Ranjit Nair
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
 
Aravind Kumar
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
set j2ee.jar in your classpath
 
Paymon Asadinia
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)


 
Inesh Hettiarachchi
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
 
bala kiran
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?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!