Académique Documents
Professionnel Documents
Culture Documents
import org.jboss.annotation.ejb.LocalBinding;
import javax.ejb.*;
@Stateless
public class StatelessTekst1 implements tekst1
{
public String podajTekst(int numer)
{
if(numer==1)
return "Hej, udalo sie!";
}
}
I put this files to <JAVA_HOME>/bin directory. But, when I want to compile the StatelessTekst1.java file, I get an
errors:
-------------------------------------------------------------------------------------
C:\Program Files\Java\jdk1.5.0_05\bin>javac StatelessTekst1.java
StatelessTekst1.java:1: package org.jboss.annotation.ejb does not exist
import org.jboss.annotation.ejb.LocalBinding;
^
StatelessTekst1.java:2: package javax.ejb does not exist
import javax.ejb.*;
^
StatelessTekst1.java:4: cannot find symbol
symbol: class Stateless
@Stateless
^
3 errors
-------------------------------------------------------------------------------------
So, I add the classpath to the javac:
You will have to include the jar containing the org.jboss.annotation.ejb.LocalBinding class, in
your classpath. I dont exactly remember the name of that jar but i guess it is something like
jboss-annotations.jar.
import org.jboss.annotation.ejb.LocalBinding;
import javax.ejb.*;
@Stateless
public class StatelessTekst1 implements tekst1
{
public String podajTekst(int numer)
{
if(numer==1)
return "Hej, udalo sie!";
}
}
On second thoughts, i dont see the need of the following import statement in your code:
import org.jboss.annotation.ejb.LocalBinding;
Remove this import statement and your code should compile fine.
Yes, You are right! I remowe this import and everything goes OK.
Thanks!