public interface Hello extends javax.ejb.EJBObject { public String hello() throws java.rmi.RemoteException;
}
HelloBean.java:
import javax.ejb.*; abstract public class HelloBean implements javax.ejb.SessionBean { private SessionContext ctx; public void ejbCreate() {System.out.println("ejbcreate");} public void ejbRemove() {System.out.println("ejbremove");} public void ejbActive() {System.out.println("ejbActive");} public void ejbPassivate() {System.out.println("ejbPassivate");} public void setSessionContext(javax.ejb.SessionContext ctx) {this.ctx=ctx;}
public String hello() { System.out.println("hello()"); return "Hello, World"; } }
C:\CBD\test>jar tvf HelloWorlddd.jar 0 Mon Dec 13 19:06:06 CET 2004 META-INF/ 68 Mon Dec 13 19:06:06 CET 2004 META-INF/MANIFEST.MF 343 Sun Dec 12 15:15:40 CET 2004 ejb-jar.xml 210 Mon Dec 13 18:26:28 CET 2004 Hello.class 891 Mon Dec 13 18:26:34 CET 2004 HelloBean.class 239 Mon Dec 13 18:26:40 CET 2004 HelloHome.class
C:\CBD\test>jar tvf HelloWorlddd.jar 0 Mon Dec 13 19:06:06 CET 2004 META-INF/ 68 Mon Dec 13 19:06:06 CET 2004 META-INF/MANIFEST.MF 343 Sun Dec 12 15:15:40 CET 2004 ejb-jar.xml 210 Mon Dec 13 18:26:28 CET 2004 Hello.class 891 Mon Dec 13 18:26:34 CET 2004 HelloBean.class 239 Mon Dec 13 18:26:40 CET 2004 HelloHome.class
0 Mon Dec 13 19:29:36 CET 2004 META-INF/ 68 Mon Dec 13 19:29:36 CET 2004 META-INF/MANIFEST.MF 210 Mon Dec 13 18:26:28 CET 2004 Hello.class 891 Mon Dec 13 18:26:34 CET 2004 HelloBean.class 239 Mon Dec 13 18:26:40 CET 2004 HelloHome.class 343 Sun Dec 12 15:15:40 CET 2004 META-INF/ejb-jar.xml
_2_6 date=200410140106)] Started in 39s:166ms 19:45:50,405 ERROR [XmlFileLoader] XmlFileLoader: File jar:file:/C:/jboss-3.2.6/ server/default/tmp/deploy/tmp54436HelloWorld.jar!/META-INF/ejb-jar.xml process f atal error. Line: 9. Error message: The element type "tansaction-type" must be t erminated by the matching end-tag "</tansaction-type>". 19:45:50,405 ERROR [XmlFileLoader] The element type "tansaction-type" must be te rminated by the matching end-tag "</tansaction-type>".:31:9 org.xml.sax.SAXParseException: The element type "tansaction-type" must be termin ated by the matching end-tag "</tansaction-type>". at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:293) at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:247) at org.jboss.metadata.XmlFileLoader.getDocumentFromURL(XmlFileLoader.jav a:219) at org.jboss.metadata.XmlFileLoader.load(XmlFileLoader.java:137)
C:\CBD\HelloBean.java:2: HelloBean is not abstract and does not override abstract method ejbActivate() in javax.ejb.SessionBean public class HelloBean implements javax.ejb.SessionBean
hvis man implementere den abstrakt for jboss sure opstød
C:\CBD\test>java HelloClient Exception in thread "main" javax.naming.CommunicationException: Can't find Seria lContextProvider at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.jav a:63) at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:120 ) at javax.naming.InitialContext.lookup(InitialContext.java:351) at HelloClient.main(HelloClient.java:14)
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.