[EJB 3.0] - EntityManager
by dobbo
I'm creating a garbage collection service, you know the kind of thing I'm sure:
@Entity
| @EntityListeners({GarbageCollectorService.class})
| public class MyEntity {
| ....
| }
@Service(objectName="pugwash:service=garbageCollector")
| @Management(GarbageCollectorManagement.class)
| public class GarbageCollectorService
| implements GarbageCollectorManagement {
|
| ....
|
| @PreRemove
| public void preRemove(final Object obj) {
| if (obj instanceof MyEntity)
| preRemove((MyEntity) obj);
| }
|
| ...
| }
With the other service I've written the EntityManager was set up I assume because it got inherited with the calling of method from the session bean. But my garbage collection service is never called from a session bean, or anything else I write, so it doesn't appear to get configured.
Is there away of annotating/getting a valid EntityManager?
Thanks for any advice in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4154201#4154201
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4154201
17 years, 10 months
[Installation, Configuration & DEPLOYMENT] - Re: Eclipse + JBoss Debug Mode issue
by jaikiran
"nameghino" wrote :
| How can this be done? Does this have anything to do with remote debugging?
|
| Still, I'm trying to figure out the reason why this happens, but can't seem to get anything clear.
|
|
Throughout this thread, i was always thinking that we were discussing about "Remote Debugging" through (plain) Eclipse. Here's how attach a debugger through Eclipse:
1) Edit the run.bat file of JBoss to use the following debug options (note the suspend=n option, this tells the server not to wait till the debugger attaches itself to the server ):
set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n %JAVA_OPTS%
2) Start the server from the command line, using the run.bat file.
3) Once the server has completely started, i go to my (plain) Eclipse project and create a new "Remote Java Application" debug session (if it's not already created). In the "Port" text box i specify 8787 (the same as what i have in the run.bat). Then click on Debug.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4154195#4154195
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4154195
17 years, 10 months
[JBoss jBPM] - Re: JBPM 3.2 on tomcat which uses mysql - LOGINI UNSUCCESSFU
by ronninlee
"mputz" wrote : Please see below the necessary steps to get jBPM 3.2 working with Tomcat and MySQL.
|
| Environment:
| Tomcat 6.0.10
| MySQL 5.0.15
| jBPM 3.2.GA
|
| 1. in jbpm-jpdl-3.2.GA/deploy run
| ant customize.console.for.tomcat
|
| 2. this builds a jbpm-console.war in jbpm-jpdl-3.2.GA/deploy/customized (almost) ready for deployment in TC
|
| 3. change the jbpm-console.war/WEB-INF/classes/hibernate.cfg.xml to reflect the following changes:
|
| <hibernate-configuration>
| | <session-factory>
| |
| | <!-- hibernate dialect -->
| | <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
| |
| | <!-- JDBC connection properties (begin) -->
| | <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
| | <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/jbpm32</property>
| | <property name="hibernate.connection.username">jbossjbpm</property>
| | <property name="hibernate.connection.password">jbossjbpm</property>
| | <!-- JDBC connection properties (end) -->
| |
| | <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
| |
| | <!-- DataSource properties (begin) ==
| | <property name="hibernate.connection.datasource">java:/JbpmDS</property>
| | == DataSource properties (end) -->
| | <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
| | ...
|
| (Make sure to use the hibernate.connection.driver/url attributes to connect to the db and not the hibernate.connection.datasource property. Also set hibernate.transaction.factory_class to JDBCTransactionFactory instead of the JTATransactionFactory or CMTTransactionFactory which are already in this file.)
|
| 4. copy jboss-j2ee.jar (or maybe as well any jar that contains the default javax.transaction package) to jbpm-console.war/WEB-INF/lib. (Note: jboss-j2ee.jar can be found in a standard JBoss AS distribution)
|
| 5. Copy the jar containing the mysql jdbc driver to /$CATALINA_HOME/lib
|
| 6. Copy the adapted jbpm-console.war to /$CATALINA_HOME/webapps
|
| Give it a try and start Tomcat. You should be able to start the jbpm web application, but for now you cannot successfully log in.
|
| Next thing to do would be to properly configure your security realm. You could either go for the standard file based MemoryRealm and just add the jBPM specific users and roles to /$CATALINA_HOME/conf/tomcat-users.xml, OR...
|
| Setup a JDBCRealm:
|
| 7. create a file jbpm-console.xml in /$CATALINA_HOME/conf/Catalina/localhost similar to
| <Context>
| | <Realm className="org.apache.catalina.realm.JDBCRealm"
| | driverName="com.mysql.jdbc.Driver"
| | connectionURL="jdbc:mysql://localhost:3306/jbpm32"
| | connectionName="jbossjbpm"
| | connectionPassword="jbossjbpm"
| | userTable="JBPM_ID_USER"
| | userNameCol="NAME_"
| | userCredCol="PASSWORD_"
| | userRoleTable="JBPM_ID_MEMBERSHIP"
| | roleNameCol="ROLE_" />
| | </Context>
|
| 8. Adapt the jBPM user tables to fit in the Tomcat Realm specification. If you have the standard tables (JBPM_ID_USER, JBPM_ID_GROUP, JBPM_ID_MEMBERSHIP) with the default entries already, be sure that the the columns NAME_ and ROLE_ in JBPM_ID_MEMBERSHIP are not NULL. If so you could use the following SQL to update this table:
| UPDATE jbpm_id_membership j, jbpm_id_user u
| | SET j.NAME_ = u.NAME_
| | WHERE j.USER_ = u.ID_
| |
| | UPDATE jbpm_id_membership j, jbpm_id_group g
| | SET j.ROLE_ = g.NAME_
| | WHERE j.GROUP_ = g.ID_
|
| Now you should be able to run jBPM default web app in Tomcat and login with the username/password from the db.
Thank you!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4154178#4154178
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4154178
17 years, 10 months