1 Reply Latest reply: Dec 7, 2005 10:30 AM by Darran Lofthouse RSS

Problem while deploying a sample Session Bean on Jboss 4.0.2

Gautam Panemangalore Newbie

I have created an EJB called StringProcessor, compiled the Remote,Home and Bean class and placed the ejb-jar.xml
The deployment depscriptor is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application
2.3V2//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">
<ejb-jar>
Your first EJB application
<display-name>String Processor Application</display-name>
<enterprise-beans>

<ejb-name>StringProcessor</ejb-name>
com.javapro.ejb.StringProcessorHome
com.javapro.ejb.StringProcessor
<ejb-class>com.javapro.ejb.StringProcessorBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>

</enterprise-beans>
</ejb-jar>

I HAVE PLACED THE JAR FILE WITHIN C:\jboss-4.0.2\server\default\deploy
IS THIS THE CORRECT FOLDER FOR DEPLOYMENT OR HAS TO BE PLACED WITHIN FOLDER server\all. Could anyone provide me a link on how to deploy a simple session bean on JBOSS


When i deploy it on JBOSS, it shows an error within in the deployment descriptor, asks fr a valid doctype.What could be the possible problem.Error shown is given below:-


19:57:05,781 ERROR [MainDeployer] could not create deployment: file:/C:/jboss-4.
0.2/server/default/deploy/StringProcessor.jar
org.jboss.deployment.DeploymentException: Unknown PUBLIC id in ejb-jar.xml: -//J
Boss//DTD Web Application 2.3V2//EN
at org.jboss.metadata.ApplicationMetaData.importEjbJarXml(ApplicationMet
aData.java:326)
at org.jboss.metadata.XmlFileLoader.load(XmlFileLoader.java:151)
at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:484)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:918)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:774)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
or.java:121)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
BeanOperationInterceptor.java:127)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy8.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
tScanner.java:325)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
canner.java:501)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
doScan(AbstractDeploymentScanner.java:204)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
bstractDeploymentScanner.java:277)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
upport.java:272)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
eanSupport.java:222)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
ler.java:897)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:418)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:273)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:722)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
or.java:121)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
BeanOperationInterceptor.java:127)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:434)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:315)
at org.jboss.Main.boot(Main.java:195)
at org.jboss.Main$1.run(Main.java:463)
at java.lang.Thread.run(Thread.java:595)
19:57:06,015 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=file:/C
:/jboss-4.0.2/server/default/deploy/jmx-console.war/
19:57:06,484 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

--- Incompletely deployed packages ---
org.jboss.deployment.DeploymentInfo@89a5e727 { url=file:/C:/jboss-4.0.2/server/d
efault/deploy/StringProcessor.jar }
deployer: org.jboss.ejb.EJBDeployer@1df5f21
status: Deployment FAILED reason: Unknown PUBLIC id in ejb-jar.xml: -//JBoss//
DTD Web Application 2.3V2//EN
state: FAILED
watch: file:/C:/jboss-4.0.2/server/default/deploy/StringProcessor.jar
altDD: null
lastDeployed: 1133879225765
lastModified: 1133879226000
mbeans:


  • 1. Re: Problem while deploying a sample Session Bean on Jboss 4
    Darran Lofthouse Master

    The error says it all, you have used an invalid DOCTYPE in your descriptor.

    For EJB 2.0 the DOCTYPE should be: -

    <!DOCTYPE ejb-jar PUBLIC
     "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
     "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    


    For EJB 2.1 the structure of the ejb-jar.xml is described using a scheme which would be defined in the file as: -

    <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
     version="2.1">
     ...
    </ejb-jar>