JDBCTemporalCommandFactory
ryanramage Dec 18, 2002 2:11 AMDain, I know you browse in here quite often, so I have a question to ask to you. I am trying to modify the functionality of the Persistance manager. I am going to add bean versioning functionality. What this entails is creating a second table for every bean, called bean_shadow. This will have all the fields of the original bean plus two timestamp fields to give the bean a transaction start and end time. Any insert, update, or delete will write into this table and the original table so as not to affect the application.
Anyway, I have been trying to keep it *clean* so I dont have to modify the JBoss source yet. All I want to do is extendend a few of the JDBCCommand classes so that it adds the extra sql needed, Create a jar, and then in standardjboss.xml set the persistence-manager to my new org.jboss.ejb.plugins.cmp.jdbc.JDBCTemporalStoreManager class. This way it can be turned on or off.
The easiest way I see this is to extend the JDBCTemporalCommandFactory class. The only problem is this class is hard coded when it is created in the JDBCStoreManager not following factory pattern.
commandFactory = new JDBCCommandFactory(this);
Is there a way around this that you can see? Any suggestions?
I tried to extend JDBCStoreManager, changing only the above code to :
ommandFactory = new JDBCTemporalCommandFactory(this);
but when the bean is deployed, I get:
2002-12-17 23:52:26,750 INFO [org.jboss.ejb.EjbModule] Creating
2002-12-17 23:52:26,800 INFO [org.jboss.ejb.EjbModule] Deploying Address
2002-12-17 23:52:27,020 INFO [org.jboss.ejb.EjbModule] Created
2002-12-17 23:52:27,020 INFO [org.jboss.ejb.EjbModule] Starting
2002-12-17 23:52:27,240 WARN [org.jboss.system.ServiceController] Problem starting service jboss.j2ee:jndiName=ejb/realManagement/Address,service=EJB
org.jboss.deployment.DeploymentException: Configuration found in jbosscmp-jdbc.xml for entity Address but bean is not a jbosscmp-jdbc-managed cmp entity in ejb-jar.xml
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.(JDBCApplicationMetaData.java:277)
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXmlFileLoader.java:75)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCTemporalStoreManager.loadJDBCEntityMetaData(JDBCTemporalStoreManager.java:687)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCTemporalStoreManager.initStoreManager(JDBCTemporalStoreManager.java:399)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCTemporalStoreManager.start(JDBCTemporalStoreManager.java:349)
at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:198)
at org.jboss.ejb.EntityContainer.start(EntityContainer.java:376)
at org.jboss.ejb.Container.invoke(Container.java:756)
at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1058)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy5.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:398)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
at $Proxy20.start(Unknown Source)
at org.jboss.ejb.EjbModule.startService(EjbModule.java:430)
at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:165)
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:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy5.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:398)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
at $Proxy9.start(Unknown Source)
at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:395)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:807)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:621)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:585)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
at $Proxy4.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:435)
at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:656)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:212)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:225)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:202)
2002-12-17 23:52:27,350 INFO [org.jboss.ejb.EjbModule] Started
2002-12-17 23:52:27,350 INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/devel/jboss_Package/jboss-3.0.4_tomcat-4.0.6/server/default/deploy/realManagement-ejb.jar
2002-12-17 23:52:27,350 ERROR [org.jboss.deployment.scanner.URLDeploymentScanner] MBeanException: Exception in MBean operation 'checkIncompleteDeployments()'
Cause: Incomplete Deployment listing:
Packages waiting for a deployer:
Incompletely deployed packages:
MBeans waiting for classes:
MBeans waiting for other MBeans:
[ObjectName: jboss.j2ee:jndiName=ejb/realManagement/Address,service=EJB
state: FAILED
I Depend On:
Depends On Me: org.jboss.deployment.DeploymentException: Configuration found in jbosscmp-jdbc.xml for entity Address but bean is not a jbosscmp-jdbc-managed cmp entity in ejb-jar.xml]