[Management, JMX/JBoss] - deploying mbean in ear
by jyoonyang
Hello,
I can't seem to get my MBean to be deployed when I deploy in a ear. If I deploy the sar independently, it works fine.
Here is the content of my ear:
| mymbeans.sar
| mywebapp.war
| log4j.properties
| META-INF/
| META-INF/application.xml
| META-INF/my-oracle-ds.xml
| META-INF/jboss-app.xml
| META-INF/jboss-service.xml
| META-INF/MANIFEST.MF
|
And here are the sar content
| commons-collections-3.0.jar
| commons-dbcp-1.2.1.jar
| commons-pool-1.1.jar
| mymbeans.jar
| META-INF/
| META-INF/my-oracle-ds.xml
| META-INF/jboss-service.xml
| META-INF/MANIFEST.MF
| servletapi-2.3.jar
|
Currently, there is no dependency from sar to war. (To be added later)
I don't see any error messages during deployment. It seem to be get simply ignored. Any idea?
Also, does mbean need to be inside a sar? Can it be in the ear without being wrapped inside a sar?
Thanks in advance,
Jennifer
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978915#3978915
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978915
19 years, 8 months
[Persistence, JBoss/CMP, Hibernate, Database] - Trouble Configuring a Persistence Unit
by jantzen
Hi, I'm experimenting with the new Java Persistence API interface to Hibernate and running into problems rather fast.
My basic test class:
| package datatier;
|
| import javax.persistence.EntityManager;
| import javax.persistence.EntityManagerFactory;
| import javax.persistence.Persistence;
|
| public class DataTierTest {
|
| public static void main(String[] args) {
| Object file = ClassLoader.getSystemClassLoader().getResource("META-INF/persistence.xml");
| System.out.println("FILE " + file);
| EntityManagerFactory emf = Persistence.createEntityManagerFactory("test");
| EntityManager manager = emf.createEntityManager();
| }
|
My META-INF/persistence.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <persistence xmlns="http://java.sun.com/xml/ns/persistence"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
| version="1.0">
| <persistence-unit name="test" transaction-type="RESOURCE_LOCAL">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="validate"/>
| <property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/>
| <property name="hibernate.connection.password" value="password"/>
| <property name="hibernate.connection.url" value="jdbc:postgresql:TestDB"/>
| <property name="hibernate.connection.username" value="user"/>
| <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
| <property name="hibernate.default_schema" value="authority"/>
| </properties>
| </persistence-unit>
| </persistence>
|
>From within Eclipse and as a Jar running from the command line, the above results in:
| FILE file:/home/jantzen/eclipse/DataTier/bin/META-INF/persistence.xml
| Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named test
| at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:41)
| at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
| at org.throbbing.datatier.DataTierTest.main(DataTierTest.java:13)
|
I've verified that META-INF is in the classpath (which the ClassLoader.getResource() call demonstrates as well), so I'm perplexed. Something simple I'm missing probably.
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978914#3978914
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978914
19 years, 8 months
[JBoss jBPM] - Re: Task Not Being Created?
by jed204
I've figured it out. Maybe this will help someone else. I did some additional looking into the process as loaded. Here's the code I used:
| // Load a process definition from the database
| ProcessDefinition myDef = jbpmContext.getGraphSession().findLatestProcessDefinition(processName);
|
| // Create the process
| ProcessInstance newProcess = new ProcessInstance(myDef);
|
| // Signal the root token
| Token token = newProcess.getRootToken();
| logger.info("Root Token: " + token.getNode());
|
| Vector nodes = new Vector(myDef.getNodes());
|
| for (int i = 0; i < nodes.size(); i++)
| {
| Object test = nodes.get(i);
| logger.info("Type: " + test.getClass().getName());
|
| if (test.getClass().getName().equalsIgnoreCase("org.jbpm.graph.node.TaskNode"))
| {
| TaskNode myNode = (TaskNode)test;
| logger.info("Are we creating tasks? " + myNode.getCreateTasks());
| }
| }
|
|
The result of getCreateTasks() is 'false'. This is a problem as it should be 'true'. I tracked it down to a problem with the MySQL driver version I was using (3.0.9) vs. a newer version available - which also happens to be bundled in the jbpm starter kit. The updated MySQL driver version 3.1.7 works and my tasks are being created now.
Oh joy. Well, hope this helps someone else.
The following links are related to the MySQL Version I have 5.0.22 and Hibernate:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-729
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978912#3978912
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978912
19 years, 8 months
[Installation, Configuration & Deployment] - ServiceController - does not honor 'nested' dependencies dur
by jay.guidos
Hi All,
I am using 4.0.3SP1, the 'all' configuration.
I am creating a HASingleton that depends on an SLSB and a DataSource. Using the HASingletonController MBean means I have a A depends apon B depends apon C situation:
anonymous wrote : SingletonController depends on Singleton depends on DataSource
If I simply deploy the singleton as a regular MBean (i.e. not a singleton) all dependencies are resolved correctly. But if I make the singleton depend on the HASingletonController then I get an error that the DataSource is not started.
I have checked the ServiceController code, and the start() method seems to discard and ignore the dependencies of a dependent MBean (with a vague comment on avoiding 'cyclical dependencies') when ensuring the dependent beans are started. How can I ensure the dependencies are honored here?
Here is my singleton deployment descriptor:
| <!-- FIX Engine Deployment -->
| <mbean code="com.amsl.bids3.fixgw.session.jboss.FIXGWManagerDeployer"
| name="amsl.bids3.fixgw:service=FIXGWManger,name=GWMGR-1">
| <attribute name="NonTxDataSourceJndiName">java:/amsl/bids3/FIXGatewayNonTxDataSource</attribute>
| <attribute name="InboundLocalHomeJndiName">FIXGWInboundLocalHome</attribute>
| <depends>jboss.jca:service=DataSourceBinding,name=amsl/bids3/FIXGatewayNonTxDataSource</depends>
| <depends>jboss.j2ee:jndiName=FIXGWInboundLocalHome,service=EJB</depends>
| </mbean>
|
| <mbean code="org.jboss.ha.singleton.HASingletonController"
| name="amsl.bids3.fixgw:service=FIXGWManagerSingletonController,name=HAControllerForGWMGR-1">
| <depends>jboss:service=${jboss.partition.name:DefaultPartition}</depends>
| <depends optional-attribute-name="TargetName">amsl.bids3.fixgw:service=FIXGWManger,name=GWMGR-1</depends>
| <attribute name="TargetStartMethod">startSingleton</attribute>
| <attribute name="TargetStopMethod">stopSingleton</attribute>
| </mbean>
|
| anonymous wrote :
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978905#3978905
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978905
19 years, 8 months