aspose file tools*
The moose likes JBoss/WildFly and the fly likes how to deploy MySQL to JBoss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "how to deploy MySQL to JBoss" Watch "how to deploy MySQL to JBoss" New topic
Author

how to deploy MySQL to JBoss

Benjamin Ho
Greenhorn

Joined: Nov 19, 2003
Posts: 16
hi everybody,
i don't know how deploy MySQL to JBoss. Can you list the steps to me?
The Environment:
-JBOSS 3.2.X
-MySQL 4.0.X
-ejb 2.0
For example:
1. how to set up the database? which database's JDBC JAR file to $JBOSS_HOME/server/default/lib? how to set the -ds.xml and copy it to $JBOSS_HOME/server/default/deploy directory?
2. how to examine the JBOSS-Specific file? Does it correct?
<jbosscmp-jdbc>
<defaults>
<datasource>java:/MySQLDS</datasource>
<datasource-mapping>MySQL</datasource-mapping>
......
</defaults>
......
</jbosscmp-jdbc>
3. after compiling, does a file like x.jar be copied to $JBOSS_HOME/server/default/deploy directory?
thank you very much
Regards,
Benjarmin
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Moving to the JBoss Forum...
norman richards
Author
Ranch Hand

Joined: Jul 21, 2003
Posts: 367
Look at docs/examples/jca/mysql-ds.xml for an example of how to configure a mysql datasource. Your usage in the jbosscmp-jdbc.xml file looks correct, though make sure the JNDI name you give is the same as the one in your mysql-ds.xml file. The case you have is different from the case in the sample ds file.
Benjamin Ho
Greenhorn

Joined: Nov 19, 2003
Posts: 16
hi everybody,
Thank you for each responder.
In fact, i am testing a sample in AppendixA of JBoss EJB Workbook. I have changed the database MySql to instead of Orcale.
I have met an error when i compile the ejb after configure all files needed. I have typed a command as 'ant' after a directory containing all files in the example. The following is the process of compiling the files.
C:\workbook\exAppendixA>ant
Buildfile: build.xml
prepare:
[mkdir] Created dir: C:\workbook\exAppendixA\build
[mkdir] Created dir: C:\workbook\exAppendixA\build\classes
compile:
[javac] Compiling 4 source files to C:\workbook\exAppendixA\build\classes
[javac] This version of java does not support the classic compiler; upgradin
g to modern
db:
[delete] Deleting: C:\jboss\jboss-3.2.1_tomcat-4.1.24\server\default\deploy\t
itandb-ds.xml
BUILD FAILED
file:C:/workbook/exAppendixA/build.xml:51: The <copy> task doesn't support the "
quiet" attribute.
Total time: 8 seconds

hey, can you tell what happen that? How to fix the bug? What is the "quiet" attribute?
Best regards,
Benjamin
norman richards
Author
Ranch Hand

Joined: Jul 21, 2003
Posts: 367
Remove 'quiet="true"' from the build file.
Benjamin Ho
Greenhorn

Joined: Nov 19, 2003
Posts: 16
hi everybody,
hey, norman richards thank you very much....
when i delete the "quiet=true", i can compile the files..
i have met a new problem when i run the program. Please tell me what happen? How to fix the error?
An error is:
C:\workbook\exAppendixA>client_61 777 Bill Burke 888 Sacha Labourey
Buildfile: build.xml
ejbjar:
run.client_61:
[java] javax.naming.NameNotFoundException: CustomerHomeRemote not bound
[java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
[java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
[java] at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
[java] at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
sorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:324)
[java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.jav
a:261)
[java] at sun.rmi.transport.Transport$1.run(Transport.java:148)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
[java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspor
t.java:460)
[java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPT
ransport.java:701)
[java] at java.lang.Thread.run(Thread.java:534)
[java] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServe
r(StreamRemoteCall.java:247)
[java] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCa
ll.java:223)
[java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
[java] at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:49
2)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:47
1)
[java] at javax.naming.InitialContext.lookup(InitialContext.java:347)
[java] at com.titan.clients.Client_61.main(Client_61.java:33)
BUILD SUCCESSFUL
Total time: 4 seconds
Best regards,
Benjarmin
Benjamin Ho
Greenhorn

Joined: Nov 19, 2003
Posts: 16
hi everybody,
i have configured the jboss.xml as the following:
<?xml version="1.0" encoding="UTF-8" ?>
- <jboss>
- <enterprise-beans>
- <entity>
<ejb-name>CustomerEJB</ejb-name>
<jndi-name>CustomerHomeRemote</jndi-name>
</entity>
</enterprise-beans>
</jboss>
the "jndi-name" as CustomerHomeRemote which is the home interface.
can you tell me what make error when i run the program? the question in above the reply....
Best regards,
Benjamin
norman richards
Author
Ranch Hand

Joined: Jul 21, 2003
Posts: 367
Did you actually deploy the application? If you did, did it deploy cleanly with no errors or exceptions shown?
Do you see your beans in the jndi view? Go to the JMX console and find the jndi-view mbean. Click on it and invoke the "list" action. You should see the JNDI view for the whole system. Is your bean there? Is the name what you expect?
Benjamin Ho
Greenhorn

Joined: Nov 19, 2003
Posts: 16
hi everybody,
i have found a few errors when i compile the files. But a file as titan.jar is created and copy one on a directory $jboss_home\server\default\deploy after i have compiled the files.
The following is the error message.
23:27:09,593 ERROR [MainDeployer] could not create deployment: file:/C:/jboss/jboss-3.2.1_tomcat-4.1.24/server/default/deploy/titan.jar
org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
23:27:09,603 ERROR [URLDeploymentScanner] Failed to deploy: org.jboss.deployment.scanner.URLDeploymentScanner$DeployedURL@2c81fc5d{ url=file:/C:/jboss/jboss-3.2.1_tomcat-4.1.24/server/default/deploy/titan.jar, deployedLastModified=0 }
org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
Please, tell me what happens and how to fix the problem
Best regards,
Benjamin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to deploy MySQL to JBoss