-
1. Re: EJB-JAR.XML AND JBOSS.XML SETUP
wdfink Sep 30, 2011 2:03 AM (in response to brucesanders63)What version of EJB do you use? EJB2.x or EJB3.x?
If you use EJB2 have a look into JBOSS_HOME/docs/dtd/jboss_?_?.dtd it might help.
Also the JBoss part of the Xdoclet documentation (http://xdoclet.sourceforge.net/xdoclet/tags/jboss-tags.html) might help
-
2. Re: EJB-JAR.XML AND JBOSS.XML SETUP
jaikiran Sep 30, 2011 2:56 AM (in response to brucesanders63)There are some examples here http://www.jboss.org/ejb3/docs. For the resource reference ones see this http://docs.jboss.org/ejb3/docs/tutorial/1.0.7/html/Using_resource_references_in_EJB3.html. The source code is available on that docs page for reference.
-
3. Re: EJB-JAR.XML AND JBOSS.XML SETUP
brucesanders63 Sep 30, 2011 9:56 AM (in response to wdfink)In my ejb-jar.xml I have the following:
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
Looks like 2 to me.
-
4. Re: EJB-JAR.XML AND JBOSS.XML SETUP
brucesanders63 Oct 3, 2011 4:01 PM (in response to brucesanders63)I have attached several files that I hope will provide someone with the insight to assist. I'm trying to access an EJB in a jar file from MyEclipse(I believe I would have the same problem from eclipse). The heart of the matter(I believe) can be found in the log from the server where the ejb-jar.xml and jboss.xml won't synch and therefore when I try to execute
CalculationAppealsManager ejb = EJBFactory.getCalculationAppealsManager() it fails since JBOSS wasn't able to connect to the EJB. I've tried many different things but to no avail. I'm not ashamed to say that some of this is lack of EJB/JBOSS knowledge. I'm a developer, not a systems guy and my Enterprise Java is extremely rusty(been in the c#.net world for several years). Any assistance would be appreciated.
-
files for eclipse issue.zip 132.9 KB
-
-
5. Re: EJB-JAR.XML AND JBOSS.XML SETUP
wdfink Oct 4, 2011 1:59 AM (in response to brucesanders63)If I look to the logfiles the application deploy fails because of a wrong deploment descriptor:
14:37:06,340 ERROR [MainDeployer] Could not create deployment: file:/C:/JBoss4.0/jboss-4.0.5.GA/server/default/deploy/CalculationAppeals_ejb.jar
org.jboss.deployment.DeploymentException: Error in jboss.xml for Bean jmx/ejb/Adaptor: found in jboss.xml but not in ejb-jar.xml
Your ejb-jar.xml declare other stuff than jboss.xml.
If I look into the weblogic-ejb.jar.xml this looks better.
Correct the jboss.xml file that the application deploy is correct without any ERROR.
-
6. Re: EJB-JAR.XML AND JBOSS.XML SETUP
brucesanders63 Oct 4, 2011 11:14 AM (in response to wdfink)Same problem.
Here is what my jboss.xml looks like. I also confirmed it to be the same in JBOSS deployment folder as I made the change in eclipse.
<?
?>
<!
>
<
>
>
<!--
To add beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called jboss-beans.xml that contains
the <session></session>, <entity></entity> and <message-driven></message-driven>
markup for those beans.
-->
>
>
>
>
>
>
>
>
<!--
<message-driven>
<ejb-name>MessageFileUpload</ejb-name>
</message-driven>
--><!--
write a merge file jboss-webservices.ent for webservice-description
-->
>
>
>
<!--
| for container settings, you can merge in jboss-container.xml
| this can contain <invoker-proxy-bindings/> and <container-configurations/>
-->
</
>
-
7. Re: EJB-JAR.XML AND JBOSS.XML SETUP
brucesanders63 Apr 16, 2012 5:56 PM (in response to brucesanders63)Been a while since I posted but I still have the same problem and find very little on the internet to assist. If I create my own enterprise java bean from source code using Xdoclet to assist the jar does deploy. I match the jboss.xml from the successful deploy
jboss.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss_2_4.dtd"><jboss>
<enterprise-beans>
<session>
<ejb-name>CalculationAppealsManagerBean</ejb-name>
<jndi-name>ejb/CalculationAppealsManagerBean</jndi-name>
</session></enterprise-beans>
<resource-managers>
</resource-managers></jboss>
ejb-jar.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<enterprise-beans>
<session>
<description>Calculation Appeals Manager EJB</description>
<display-name>CalculationAppealsPortalManagerBean</display-name>
<ejb-name>CalculationAppealsManagerBean</ejb-name>
<home>com.spcs.intranet.calculationAppeals.business.ejb.CalculationAppealsManagerHome</home>
<remote>com.spcs.intranet.calculationAppeals.business.ejb.CalculationAppealsManager</remote>
<ejb-class>com.spcs.intranet.calculationAppeals.business.ejb.CalculationAppealsManagerBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<env-entry-name>ejb.sessionTimeout</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>600</env-entry-value>
</env-entry>
</session>
</enterprise-beans>
<assembly-descriptor>
<security-role>
<role-name>all</role-name>
</security-role>
<method-permission>
<role-name>all</role-name>
<method>
<ejb-name>CalculationAppealsManagerBean</ejb-name>
<method-name>*</method-name>
</method>
</method-permission>
<container-transaction>
<method>
<ejb-name>CalculationAppealsManagerBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>The deployment result is this:
org.jboss.deployment.DeploymentException
: Error in jboss.xml for Bean jmx/ejb/Adaptor: found in jboss.xml but not in ejb-jar.xml
ApplicationMetaData.java:956at org.jboss.metadata.ApplicationMetaData.importJbossXml(
)
XmlFileLoader.java:200at org.jboss.metadata.XmlFileLoader.load(
)
EJBDeployer.java:541at org.jboss.ejb.EJBDeployer.create(
)
Native Methodat sun.reflect.NativeMethodAccessorImpl.invoke0(
)
NativeMethodAccessorImpl.java:39at sun.reflect.NativeMethodAccessorImpl.invoke(
)
DelegatingMethodAccessorImpl.java:25at sun.reflect.DelegatingMethodAccessorImpl.invoke(
)
Method.java:324at java.lang.reflect.Method.invoke(
)
ReflectedDispatcher.java:155at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(
)
Invocation.java:94at org.jboss.mx.server.Invocation.dispatch(
)
AbstractInterceptor.java:133at org.jboss.mx.interceptor.AbstractInterceptor.invoke(
)
Invocation.java:88at org.jboss.mx.server.Invocation.invoke(
)
ModelMBeanOperationInterceptor.java:142at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(
)
DynamicInterceptor.java:97at org.jboss.mx.interceptor.DynamicInterceptor.invoke(
)
InterceptorServiceMBeanSupport.java:238at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(
)
DeployerInterceptor.java:74at org.jboss.ws.integration.jboss.DeployerInterceptor.create(
)
DeployerInterceptorEJB.java:44at org.jboss.ws.integration.jboss.DeployerInterceptorEJB.create(
)
SubDeployerInterceptorSupport.java:180at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(
)
SubDeployerInterceptor.java:91at org.jboss.deployment.SubDeployerInterceptor.invoke(
)
Invocation.java:88at org.jboss.mx.server.Invocation.invoke(
)
AbstractMBeanInvoker.java:264at org.jboss.mx.server.AbstractMBeanInvoker.invoke(
)
MBeanServerImpl.java:659at org.jboss.mx.server.MBeanServerImpl.invoke(
)
MBeanProxyExt.java:210at org.jboss.mx.util.MBeanProxyExt.invoke(
)
MainDeployer.java:969at $Proxy26.create(Unknown Source)
at org.jboss.deployment.MainDeployer.create(
)
MainDeployer.java:818at org.jboss.deployment.MainDeployer.deploy(
)
MainDeployer.java:782at org.jboss.deployment.MainDeployer.deploy(
)
DelegatingMethodAccessorImpl.java:25at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
)
Method.java:324at java.lang.reflect.Method.invoke(
)
ReflectedDispatcher.java:155at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(
)
Invocation.java:94at org.jboss.mx.server.Invocation.dispatch(
)
AbstractInterceptor.java:133at org.jboss.mx.interceptor.AbstractInterceptor.invoke(
)
Invocation.java:88at org.jboss.mx.server.Invocation.invoke(
)
ModelMBeanOperationInterceptor.java:142at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(
)
Invocation.java:88at org.jboss.mx.server.Invocation.invoke(
)
AbstractMBeanInvoker.java:264at org.jboss.mx.server.AbstractMBeanInvoker.invoke(
)
MBeanServerImpl.java:659at org.jboss.mx.server.MBeanServerImpl.invoke(
)
MBeanProxyExt.java:210at org.jboss.mx.util.MBeanProxyExt.invoke(
)
URLDeploymentScanner.java:421at $Proxy8.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(
)
URLDeploymentScanner.java:634at org.jboss.deployment.scanner.URLDeploymentScanner.scan(
)
AbstractDeploymentScanner.java:263at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(
)
AbstractDeploymentScanner.java:274at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(
)
AbstractDeploymentScanner.java:225at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(
)
16:54:01,010 ERROR [MainDeployer] Could not create deployment: file:/C:/JBoss4.0/jboss-4.0.5.GA/server/default/deploy/CalculationAppeals_ejb.jar
org.jboss.deployment.DeploymentException
: Error in jboss.xml for Bean jmx/ejb/Adaptor: found in jboss.xml but not in ejb-jar.xml
ApplicationMetaData.java:956at org.jboss.metadata.ApplicationMetaData.importJbossXml(
)
XmlFileLoader.java:200at org.jboss.metadata.XmlFileLoader.load(
)
EJBDeployer.java:541at org.jboss.ejb.EJBDeployer.create(
)
Native Methodat sun.reflect.NativeMethodAccessorImpl.invoke0(
)
NativeMethodAccessorImpl.java:39at sun.reflect.NativeMethodAccessorImpl.invoke(
)
DelegatingMethodAccessorImpl.java:25at sun.reflect.DelegatingMethodAccessorImpl.invoke(
)
Method.java:324at java.lang.reflect.Method.invoke(
)
ReflectedDispatcher.java:155at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(
)
Invocation.java:94at org.jboss.mx.server.Invocation.dispatch(
)
AbstractInterceptor.java:133at org.jboss.mx.interceptor.AbstractInterceptor.invoke(
)
Invocation.java:88at org.jboss.mx.server.Invocation.invoke(
)
ModelMBeanOperationInterceptor.java:142at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(
)
DynamicInterceptor.java:97at org.jboss.mx.interceptor.DynamicInterceptor.invoke(
)
InterceptorServiceMBeanSupport.java:238at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(
)
DeployerInterceptor.java:74at org.jboss.ws.integration.jboss.DeployerInterceptor.create(
)
DeployerInterceptorEJB.java:44at org.jboss.ws.integration.jboss.DeployerInterceptorEJB.create(
)
SubDeployerInterceptorSupport.java:180at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(
)
SubDeployerInterceptor.java:91at org.jboss.deployment.SubDeployerInterceptor.invoke(
)
Invocation.java:88at org.jboss.mx.server.Invocation.invoke(
)
AbstractMBeanInvoker.java:264at org.jboss.mx.server.AbstractMBeanInvoker.invoke(
)
MBeanServerImpl.java:659at org.jboss.mx.server.MBeanServerImpl.invoke(
)
MBeanProxyExt.java:210at org.jboss.mx.util.MBeanProxyExt.invoke(
)
MainDeployer.java:969at $Proxy26.create(Unknown Source)
at org.jboss.deployment.MainDeployer.create(
)
MainDeployer.java:818at org.jboss.deployment.MainDeployer.deploy(
)
MainDeployer.java:782at org.jboss.deployment.MainDeployer.deploy(
)
DelegatingMethodAccessorImpl.java:25at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
)
Method.java:324at java.lang.reflect.Method.invoke(
)
ReflectedDispatcher.java:155at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(
)
Invocation.java:94at org.jboss.mx.server.Invocation.dispatch(
)
AbstractInterceptor.java:133at org.jboss.mx.interceptor.AbstractInterceptor.invoke(
)
Invocation.java:88at org.jboss.mx.server.Invocation.invoke(
)
ModelMBeanOperationInterceptor.java:142at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(
)
Invocation.java:88at org.jboss.mx.server.Invocation.invoke(
)
AbstractMBeanInvoker.java:264at org.jboss.mx.server.AbstractMBeanInvoker.invoke(
)
MBeanServerImpl.java:659at org.jboss.mx.server.MBeanServerImpl.invoke(
)
MBeanProxyExt.java:210at org.jboss.mx.util.MBeanProxyExt.invoke(
)
URLDeploymentScanner.java:421at $Proxy8.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(
)
URLDeploymentScanner.java:634at org.jboss.deployment.scanner.URLDeploymentScanner.scan(
)
AbstractDeploymentScanner.java:263at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(
)
AbstractDeploymentScanner.java:274at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(
)
AbstractDeploymentScanner.java:225at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(
)
-
8. Re: EJB-JAR.XML AND JBOSS.XML SETUP
sfcoy Apr 25, 2012 12:15 AM (in response to brucesanders63)I think part of your problem is that you have a build process that is generating a jboss.xml file from xdoclet tags and this is being deployed instead of your hand coded one.
You need to fix your build.