deploying EJB over JBoss 7.1
In <JBOSS_HOME>/standalone/configuration/standalone.xml
find the <subsystem xmlns="urn:jboss:domain:datasources:1.0">
tag and add the following inside the <datasources>
element:
<datasources>
<datasource jndi-name="java:jboss/datasources/MysqlDS" pool-name="MysqlDS" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://localhost:3306/DATABASE_NAME</connection-url>
<driver>com.mysql</driver>
<security>
<user-name>USERNAME</user-name>
<password>PASSWORD</password>
</security>
</datasource>
<drivers>
<driver name="com.mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
Replace DATABASE_NAME,USERNAME and PASSWORD apporpriately.
Inside the <drivers>
element add the following:
<driver name="com.mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
Now, go to <JBOSS_HOME>/modules
and create the path com/mysql/main
put the driver's jar there (eg. mysql-connector-java-5.1.18-bin.jar) and create the file module.xml
with the following contents:
<module xmlns="urn:jboss:module:1.1" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-5.1.18-bin.jar"/>
<!-- Insert resources here -->
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="javax.servlet.api" optional="true"/>
</dependencies>
</module>
That should do the trick.
EJB with JBoss 7.1.1 leads to WELD 001303 error
There are 2 solutions. You wait until the weld-core-1.1.8.FINAL.jar will be updated! Or you get the source code and do a hard fix in org.jboss.weld.context.AbstractBoundContext:
public void deactivate() {
if (getBeanStore() != null )
{ getBeanStore().detach(); super.deactivate(); }
}
For more information see https://issues.jboss.org/browse/WELD-1020?_sscc=t
Jboss 7.1.1 Transaction, cascade EJB methods
You've left the most important part out; the JMS connection factory where you obtain the connection from and the way how you got hold of this factory.
Make sure you inject this factory, and that you use a transactional one. In JBoss AS 6, java:/JmsXA was the transactional one, and java:/ConnectionFactory the unmanaged/not-transactional alternative. Check that for AS 7 you are using the right one.
EJB pooling in JBoss EAP 6 - Are there any downsides to just setting a really large value for max-pool-size?
As to the max-poo-size
of 20, it is really hard to come up with a default value. If this were set to 100, then a user on a single core system could easily overwhelm the CPU. It comes down to how many cores are available, what the MDB workload looks like, and how much else is going on in the application.
If you have 32 cores available to you, there is nothing else going on in the application, and the work done during MDB processing is very small, then a pool of 20 is potentially too small.
MDBs will always be pooled, as will stateless session beans.
You can set the pool max to be a high value, and this won't hurt anything. Keeping in mind that for MDBs, a JMS session is needed for activation. The default number of sessions is 15. So for MDBs, you need to match up the number of sessions and the instance pool size in order to get the desired number of activated MDBs. The number of sessions is configured in the MDB activation deployment spec.
EJB 3 Test Locally, Getting Error
Now issue has been fixed by adding two more properties, please find them below:
jndiProp.put("jboss.naming.client.ejb.context", true);
jndiProp.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
EJBs - problems running a simple tutorial example in Eclipse with JBOSS 7.1.1 server
The problem solved adding a jboss-ejb-client.properties file to the client application with the following code:
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=localhost
remote.connection.default.port = 4447
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
Related Topics
Insert New Line to Bash Prompts
Monitoring Pthread Context Switching
Mercurial Hg No Changes Found - Can't Hg Push Out
How to Remove Specific Rules from Iptables
Unix - Count of Columns in File
Execute a Shell Script Everyday at Specific Time
Count Occurrences of Character Per Line/Field on Unix
A Light Solution to Convert Text to PDF in Linux
Given a Linux Username and a Password How to Test If It Is a Valid Account
Rsync - Mkstemp Failed: Permission Denied (13)
How to Configure Bash to Handle Crlf Shell Scripts
Using a Glob Expression Passed as a Bash Script Argument
How to Tell Qt to Use Different Openssl
How to Get Sudo Access for a File Inside the Vi Text Editor
Create a Dedicated Folder for Every Zip Files in a Directory and Extract Zip Files
View a Log File in Linux Dynamically