• 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
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

error when compiling Home interface

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to create my first EJB.
My remote interface is like this:
package com.ejb.session;
import javax.ejb.EJBObject;
import java.rmi.RemoteException;
public interface First extends EJBObject
{
public String getTime() throws RemoteException;
}
My home interface:
package com.ejb.session;
import javax.ejb.EJBHome;
import javax.ejb.CreateException;
import java.rmi.RemoteException;
public interface FirstHome extends EJBHome {
public First create() throws CreateException, RemoteException;
}

When i compile First.java i receive no errors but when i compile FirstHome.java i receive an error. I have included the classpath for j2ee jar while compiling . i am using JBoss.
javac -verbose -classpath %CLASSPATH%;"D:\Program Files\jboss-3.2.3\client\jboss-j2ee.jar" -d "D:\Program Files\Projects\TomcatJBoss\EJB\FirstEJB\src\com\ejb\session\FirstHome.java"
Error: cannot resolve symbol
symbol: class First
location: interface com.ejb.session.FirstHome
public First create() throws CreateException, RemoteException;
Any ideas??
 
Shalu Ban
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No one knows what could be wrong??
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi shalu,
i tried copy/pasting u'r code and compiling them. and both the files compiled. i had also kept the directory hierarchy as required in the package listing. cant figure out what is the problem with u
Aju
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's a simple classpath problem when you're compiling the 2nd file; Try compiling all the classes at once, something like:
> cd EJB\FirstEJB
> mkdir build
> cd src
> javac -classpath "D:\Program Files\jboss-3.2.3\client\jboss-j2ee.jar" -d ..\build src\com\ejb\session\*.java
Hopefully you get the idea. All the files should now be compiled into a class-hierarchy within "build". Repeat with any other directories as necessary.
-Ade Barkah
ps. You may want to learn "Ant" at some point... seems more complicated at first but it would greatly simplify your builds later on.
 
Ade Barkah
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry that last line should probably be:
> javac -classpath "D:\Program Files\jboss-3.2.3\client\jboss-j2ee.jar" -d ..\build com\ejb\session\*.java
-Ade Barkah
 
Shalu Ban
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried compiling all the files at once but had received 6 errors . the errors were refering to code (like datalib or something) which wasnt there in my 3 java classes. so i tried compiling files individually.
U r rite, i am going to learn Ant soon. but was wondering why this is causing an error.
thank u guys!
 
The overall mission is to change the world. When you've done that, then you can read this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic