G
Gast
Gast
hallo,
ich hab eine EJB 3.0 Anwendung geschrieben, die ich auf dem JBoss AS als JAR-File deploye. Das Deployment verläuft Fehlerlos, wenn ich aber versuche den client zu starten bekomme ich folgende Fehlermeldung:
[/color]
Sowohl der JBoss als auch das Eclipse Project laufen in der selben JVM.
Was kann das sein?
TextBean.class
Client Klasse:
Local Interface:
Ich hab keine Ahnung woran das noch liegen und bin für jede Hilfe dankbar.
Gruss
Markus
ich hab eine EJB 3.0 Anwendung geschrieben, die ich auf dem JBoss AS als JAR-File deploye. Das Deployment verläuft Fehlerlos, wenn ich aber versuche den client zu starten bekomme ich folgende Fehlermeldung:
Code:
[color=orange]
javax.ejb.EJBException: Invalid invocation of local interface (null container)
at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:75)
at $Proxy0.getText(Unknown Source)
at de.einsundeins.ccsys.client.CompressedClient.main(CompressedClient.java:17)
Sowohl der JBoss als auch das Eclipse Project laufen in der selben JVM.
Was kann das sein?
TextBean.class
Code:
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.ejb.Local;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import org.jboss.annotation.ejb.RemoteBinding;
import de.einsundeins.ccsys.util.DBConnection;
import de.einsundeins.ccsys.interfaces.*;
@Stateless
//@Remote({TextRemote.class})
//@RemoteBinding (jndiBinding="CompressedApp/TextBean/remote")
@Local(TextHome.class)
@Remote(TextHome.class)
public class TextBean implements TextHome, TextRemote {
private static final String QRY_TEXT_SEL = "select text.data from textandbinary.text LIMIT 100";
public String getText() {
try {
Connection ConMySQL = DBConnection.dbMysql(DBConnection.MySQLURL);
PreparedStatement prepStmt = ConMySQL.prepareStatement(QRY_TEXT_SEL);
ResultSet rs = prepStmt.executeQuery();
String text = "";
while(rs.next()){
text = text + rs.getString("data");
}
return text;
}
catch(ClassNotFoundException ex){
ex.printStackTrace();
}catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
}
Client Klasse:
Code:
package de.einsundeins.ccsys.client;
import de.einsundeins.ccsys.interfaces.*;
import javax.naming.InitialContext;
public class CompressedClient {
public static void main(String args[]){
try{
InitialContext ctx = new InitialContext();
TextHome home = (TextHome)ctx.lookup("TextBean/local");
//TextRemote remote = (TextRemote)ctx.lookup("TextBean/remote");
System.out.println(home.getText());
}
catch(Exception e){
e.printStackTrace();
}
}
}
Local Interface:
Code:
package de.einsundeins.ccsys.interfaces;
public interface TextHome{
public String getText();
}
Ich hab keine Ahnung woran das noch liegen und bin für jede Hilfe dankbar.
Gruss
Markus