facebook

Problems with deploying an EJB in JBoss[closed]

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #236706 Reply

    kluter
    Member

    Hi all.

    I’m trying to do the “Creating an Entity Bean in MyEclipse and WebLogic” [http://www.myeclipseide.com/ContentExpress-display-ceid-51.html] tutorial, working with JBoss instead of WebLogic. I follow this steps:
    1. configured the JBoss /server/default/deploy mysql-ds.xml
    2. copy Jconnector-mysql to /server/default/lib
    3. configured Myeclipse > ejbdoclet > adding jboss
    3.1 set version to 4.0
    3.2 set database to java:/MySQLDB
    3.3 set databasemapping to mySQL
    3.4 set destDir to src/META-INF

    so, XDoclet create the jboss.xml and jboss-cmp…. something like this.

    then I deploy the Entity bean to JBoss. Thats ok
    when I run the JBoss, myEclipse console show the follow error:

    org.jboss.deployment.DeploymentException: “jboss-service.xml” could not be opened

    Does anybody know something about this?

    My Configuration:
    JBoss: 4.0.2 ( I tested with 3.2.1 too)
    Eclipse: 3.0.1
    MyEclipse: 3.8.4
    JVM: JSDK 1.4.2 (I tested with 1.5 too)

    greetings.

    #236766

    kluter
    Member

    That’s the error showed in the console:

    jboss: unused non-option argument: 4.0.2
    09:55:15,421 INFO [Server] Starting JBoss (MX MicroKernel)…
    09:55:15,421 INFO [Server] Release ID: JBoss [Zion] 4.0.2 (build: CVSTag=JBoss_4_0_2 date=200505022023)
    09:55:15,421 INFO [Server] Home Dir: C:\jboss-4.0.2
    09:55:15,421 INFO [Server] Home URL: file:/C:/jboss-4.0.2/
    09:55:15,421 INFO [Server] Library URL: file:/C:/jboss-4.0.2/lib/
    09:55:15,421 INFO [Server] Patch URL: null
    09:55:15,421 INFO [Server] Server Name: JBOSS
    09:55:15,421 INFO [Server] Server Home Dir: C:\jboss-4.0.2\server\JBOSS
    09:55:15,421 INFO [Server] Server Home URL: file:/C:/jboss-4.0.2/server/JBOSS/
    09:55:15,421 INFO [Server] Server Data Dir: C:\jboss-4.0.2\server\JBOSS\data
    09:55:15,437 INFO [Server] Server Temp Dir: C:\jboss-4.0.2\server\JBOSS\tmp
    09:55:15,437 INFO [Server] Server Config URL: file:/C:/jboss-4.0.2/server/JBOSS/conf/
    09:55:15,437 INFO [Server] Server Library URL: file:/C:/jboss-4.0.2/server/JBOSS/lib/
    09:55:15,437 INFO [Server] Root Deployment Filename: jboss-service.xml
    09:55:15,437 INFO [Server] Starting General Purpose Architecture (GPA)…
    09:55:16,187 INFO [ServerInfo] Java version: 1.5.0_04,Sun Microsystems Inc.
    09:55:16,187 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.5.0_04-b05,Sun Microsystems Inc.
    09:55:16,187 INFO [ServerInfo] OS-System: Windows XP 5.1,x86
    09:55:16,656 INFO [Server] Core system initialized
    Failed to boot JBoss:
    org.jboss.deployment.DeploymentException: url file:/C:/jboss-4.0.2/server/JBOSS/conf/jboss-service.xml could not be opened, does it exist?
    at org.jboss.deployment.DeploymentInfo.<init>(DeploymentInfo.java:175)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:737)
    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(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.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 $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)
    09:55:16,671 INFO [Server] JBoss SHUTDOWN: Undeploying all packages
    Shutting down
    09:55:16,687 INFO [Server] Shutdown complete
    Shutdown complete
    Halting VM

    #236768

    Riyad Kalla
    Member

    What settings do you have for the JBoss 4 connector?

    #236778

    kluter
    Member

    Hi rkalla. I have the follow configuration:

    XDoclet -> ejbdoclet -> jboss:
    – version: 4.0
    – datasource: java:/MySQLDB
    – datasourceMapping: mySQL
    – destDir: src/META-INF

    Here is the jbosscmp-jdbc.xml file:

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <!DOCTYPE jbosscmp-jdbc PUBLIC “-//JBoss//DTD JBOSSCMP-JDBC 4.0//EN” “http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_4_0.dtd”&gt;

    <jbosscmp-jdbc>
    <defaults>
    <datasource>java:/MySQLDB</datasource>
    <datasource-mapping>mySQL</datasource-mapping>
    </defaults>

    <enterprise-beans>

    <!–
    To add beans that you have deployment descriptor info for, add
    a file to your XDoclet merge directory called jbosscmp-jdbc-beans.xml
    that contains the <entity></entity> markup for those beans.
    –>

    <entity>
    <ejb-name>Address</ejb-name>

    <cmp-field>
    <field-name>address_seq</field-name>
    <column-name>address_seq</column-name>

    </cmp-field>
    <cmp-field>
    <field-name>first_name</field-name>
    <column-name>first_name</column-name>

    </cmp-field>
    <cmp-field>
    <field-name>last_name</field-name>
    <column-name>last_name</column-name>

    </cmp-field>
    <cmp-field>
    <field-name>mi</field-name>
    <column-name>mi</column-name>

    </cmp-field>
    <cmp-field>
    <field-name>state</field-name>
    <column-name>state</column-name>

    </cmp-field>
    <cmp-field>
    <field-name>street</field-name>
    <column-name>street</column-name>

    </cmp-field>
    <cmp-field>
    <field-name>city</field-name>
    <column-name>city</column-name>

    </cmp-field>

    <!– jboss 3.2 features –>
    <!– optimistic locking does not express the exclusions needed –>
    </entity>

    </enterprise-beans>

    </jbosscmp-jdbc>

    #236779

    kluter
    Member

    … and this is the mysql-ds.xml (jboss4.0.2\server\default\deploy)

    <datasources>
    <local-tx-datasource>
    <!– This connection pool will be bound into JNDI with the name
    “java:/MySQLDB” –>
    <jndi-name>MySQLDB</jndi-name>
    <connection-url>jdbc:mysql://localhost:3306/test</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>root</user-name>
    <password>test</password>
    <min-pool-size>5</min-pool-size>
    <!– Don’t set this any higher than max_connections on your
    MySQL server, usually this should be a 10 or a few 10’s
    of connections, not hundreds or thousands –>
    <max-pool-size>20</max-pool-size>
    <!– Don’t allow connections to hang out idle too long,
    never longer than what wait_timeout is set to on the
    server…A few minutes is usually okay here,
    it depends on your application
    and how much spikey load it will see –>
    <idle-timeout-minutes>5</idle-timeout-minutes>
    <!– If you’re using Connector/J 3.1.8 or newer, you can use
    our implementation of these to increase the robustness
    of the connection pool. –>
    <exception-sorter-class-name>com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter</exception-<valid-connection-checker-class-name>com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker</</local-tx-datasource>
    </datasources>

    #236788

    Riyad Kalla
    Member

    I was asking about the JBoss 4 connector: Window > Preferences > MyEclipse > Application Servers > JBoss 4, those settings 😉

    #236812

    kluter
    Member

    ok 🙂

    MyEclipse > Application Servers > JBoss 4

    1. JDK:
    – JSDK 1.4.2
    – Optional Java VM Arguments: “nothing”

    2. Launch:
    – Debug mode

    3. Paths:
    – Prepend to classpath: “nothing”
    – Append to classpath: “nothing”
    – Append to library path: “nothing”

    That’s it.

    #236814

    kluter
    Member

    missed this too:

    Myeclipse > application Server > JBoss4

    JBoss Server:
    – enable

    JBoss Home Directory: “c:\jboss-4.0.2”
    server name: “JBOSS 4.0.2”
    Optional Program Arguments: “”
    Optional Shutdown Arguments: “–shutdown”

    #236823

    Greg
    Member

    The problem is in the server output:

    Failed to boot JBoss:
    org.jboss.deployment.DeploymentException: url file:/C:/jboss-4.0.2/server/JBOSS/conf/jboss-service.xml could not be opened, does it exist?
    at org.jboss.deployment.DeploymentInfo.<init>(DeploymentInfo.java:175)

    This means that JBoss is looking for a directory called “JBOSS” under the c:/jboss-4.0.2/server directory. By default there are only 3 folders under this directory:
    -all
    -default
    -minimal

    So you need to check the value for “Server Name” field that is located at Window > Preferences > MyEclipse > Application Servers > JBoss 4 THen ensure that the “Server Name” field is one of the 3 directory names that are under the c:/jboss-4.0.2/server folder. The default should be just “default”.

    #236837

    kluter
    Member

    Thanks greg and rkalla

    I solve this problem, just putting the argument “-c default” into “Optional Program Arguments:”
    The error, like you say greg, was in the server output.

    #236840

    Greg
    Member

    Good to hear, we are glad its working.

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: Problems with deploying an EJB in JBoss[closed]

You must be logged in to post in the forum log in