[Design of POJO Server] - Re: JSR77 View
by alesj
"scott.stark(a)jboss.org" wrote :
| WAR = JBossWebMetaData attachment
|
As I want to make as little change / code as possible
I'm trying to use old code as much as I can.
But it looks like I'm gonna be stuck as I have hard time getting
ObjecName(s) from metadata.
This is how my effort to port WebModule jsr77 handling looks like:
| public class WebModuleJSR277Deployer extends AbstractVFSJSR277Deployer<JBossWebMetaData>
| {
| public WebModuleJSR277Deployer()
| {
| super(JBossWebMetaData.class);
| }
|
| protected void deployJsr77(MBeanServer server, VFSDeploymentUnit unit, JBossWebMetaData metaData) throws Throwable
| {
| String warName = unit.getSimpleName();
| ObjectName webModuleService = null; // TODO
| String earName = FactoryUtils.findEarParent(unit);
| ObjectName jsr77Name = WebModule.create(server, earName, warName, unit.getRoot().toURL(), webModuleService);
| putObjectName(unit, WebModule.class.getName(), jsr77Name);
| Iterable<ObjectName> servlets = null; // TODO
| for (ObjectName servletName : servlets)
| {
| try
| {
| createServlet(server, unit, jsr77Name, servletName);
| }
| catch (Throwable e)
| {
| log.debug("Failed to create JSR-77 servlet: " + servletName, e);
| }
| }
| }
|
| protected void undeployJsr77(MBeanServer server, VFSDeploymentUnit unit, JBossWebMetaData metaData)
| {
| ObjectName jsr77Name = getObjectName(unit, WebModule.class.getName());
| log.debug("Destroy module: " + jsr77Name);
| Iterable<ObjectName> servlets = null; // TODO
| for (ObjectName servletName : servlets)
| {
| try
| {
| destroyServlet(server, unit, servletName);
| }
| catch (Throwable e)
| {
| log.debug("Failed to destroy JSR-77 servlet: " + servletName, e);
| }
| }
|
| if (jsr77Name != null)
| {
| WebModule.destroy(server, jsr77Name);
| }
| }
|
| /**
| * Create JSR-77 Servlet
| *
| * @param mbeanServer the MBeanServer context
| * @param unit the deployment unit
| * @param webModuleName the JSR77 name of the servlet's WebModule
| * @param servletServiceName The jboss servlet mbean name
| * @return servlet's jsr77 object name
| */
| public ObjectName createServlet(MBeanServer mbeanServer, VFSDeploymentUnit unit, ObjectName webModuleName, ObjectName servletServiceName)
| {
| ObjectName jsr77Name = null;
| // We don't currently have a web container mbean
| ObjectName webContainerName = null;
| try
| {
| log.debug("Creating servlet: " + servletServiceName);
| String servletName = servletServiceName.getKeyProperty("name");
| if (servletName != null)
| {
| // Only treat resources with names as potential servlets
| jsr77Name = Servlet.create(mbeanServer, webModuleName, webContainerName, servletServiceName);
| putObjectName(unit, servletServiceName.getCanonicalName(), jsr77Name);
| log.debug("Created servlet: " + servletServiceName + ", module: " + jsr77Name);
| }
| }
| catch (Exception e)
| {
| log.debug("Failed to create servlet: " + servletServiceName, e);
| }
|
| return jsr77Name;
| }
|
| /**
| * Destroy JSR-77 Servlet
| *
| * @param server the MBeanServer context
| * @param unit the deployment unit
| * @param servletServiceName The jboss servlet mbean name
| */
| public void destroyServlet(MBeanServer server, VFSDeploymentUnit unit, ObjectName servletServiceName)
| {
| ObjectName jsr77Name = getObjectName(unit, servletServiceName.getCanonicalName());
| log.debug("Destroy container: " + servletServiceName + ", module: " + jsr77Name);
| if (jsr77Name != null)
| {
| Servlet.destroy(server, jsr77Name);
| }
| }
| }
|
It's the TODOs that I don't know how to get / create.
And I guess I'm gonna face the same problems in EJB, JCA, RAR, ...
Perhaps in this case I could even get WebModule ObjectName.
>From (making it static) AbstractWarDeployer::getObjectName(JBossWebMetaData).
But then in TomcatDeployment, we create another ObjectName,
and set it to WebApplication instance (WebApplication::setAppData).
Which one is it? ;-)
Or is my approach with deployers + metadata completely wrong? :-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182658#4182658
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182658
16 years, 3 months
[Design of POJO Server] - mbean service depends addition
by scott.stark@jboss.org
One addition I had to make to allow the pojoized naming beans to still be correctly used as mbeans was to add an 'attribute' attribute to the mbean depends element. Its similar to the mcbean inject property attribute:
| <server>
| ...
| <!-- A custom deployment of the JBoss JNDI naming service -->
| <mbean code="org.jnp.server.Main"
| name="jboss.test:service=Naming,test=pooled-main"
| xmbean-dd="resource:xmdesc/Main-xmbean.xml">
| <!-- The bootstrap port used to lookup the Naming proxy -->
| <attribute name="Port">10999</attribute>
| <!-- Don't override the default naming service -->
| <attribute name="InstallGlobalService">false</attribute>
| <attribute name="Naming"><inject bean="LocalNamingBean"/></attribute>
| <!-- The detached pooled invoker proxy -->
| <depends optional-attribute-name="NamingProxy"
| attribute="Proxy">jboss.test:service=proxyFactory,type=pooled,target=Naming</depends>
| </mbean>
|
This injects the Proxy attribute from the 'jboss.test:service=proxyFactory,type=pooled,target=Naming' mbean into the NamingProxy attribute of the dependent bean.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182529#4182529
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182529
16 years, 3 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Re: JBossMQ errors in performance tests
by marney
We are seeing one of these errors running JBoss 4.2.2 with an Oracle database behind the jdbc2.PersistenceManager. The unique constraint violation (SYS_C0010983) is on JMS_MESSAGES. I am wondering how the MESSAGEID column in JMS_MESSAGES is generated (since the primary key is on MESSAGEID, DESTINATION):
15 Oct 2008 09:31:09,702 ERROR [TMMessagingProxy pool-2-thread-12] Error sending aynch message
| org.jboss.mq.SpyJMSException: Could not store message: 65 msg=0 hard NOT_STORED NON_PERSISTENT queue=TOPIC.ecJobTopic.ID:4.-2147483648 priority=4 lateClone=false hashCode=821178610; - nested throwable: (java.sql.SQLException: ORA-00001: unique constraint (XXX.SYS_C0010983) violated
| )
| at org.jboss.mq.pm.jdbc2.PersistenceManager.saveToStorage(PersistenceManager.java:1638)
| at org.jboss.mq.server.MessageCache.saveToStorage(MessageCache.java:420)
| at org.jboss.mq.server.MessageReference.makeSoft(MessageReference.java:312)
| at org.jboss.mq.server.MessageCache.validateSoftReferenceDepth(MessageCache.java:367)
| at org.jboss.mq.server.MessageCache.addInternal(MessageCache.java:158)
| at org.jboss.mq.server.MessageCache.add(MessageCache.java:128)
| at org.jboss.mq.server.JMSQueue.addMessage(JMSQueue.java:179)
| at org.jboss.mq.server.JMSDestinationManager.addMessage(JMSDestinationManager.java:415)
| at org.jboss.mq.server.JMSDestinationManager.addMessage(JMSDestinationManager.java:399)
| at org.jboss.mq.server.JMSServerInterceptorSupport.addMessage(JMSServerInterceptorSupport.java:106)
| at org.jboss.mq.security.ServerSecurityInterceptor.addMessage(ServerSecurityInterceptor.java:168)
| at org.jboss.mq.server.TracingInterceptor.addMessage(TracingInterceptor.java:226)
| at org.jboss.mq.server.JMSServerInvoker.addMessage(JMSServerInvoker.java:112)
| at org.jboss.mq.il.jvm.JVMServerIL.addMessage(JVMServerIL.java:101)
| at org.jboss.mq.Connection.sendToServer(Connection.java:920)
| at org.jboss.mq.SpySession.sendMessage(SpySession.java:924)
| at org.jboss.mq.SpyMessageProducer.send(SpyMessageProducer.java:272)
| at org.jboss.mq.SpyMessageProducer.send(SpyMessageProducer.java:219)
| at com.teramedica.messaging.TMMessagingProxy.send(TMMessagingProxy.java:139)
| at com.teramedica.util.logging.TMAuditTrailManager.sendAudits(TMAuditTrailManager.java:214)
| at com.teramedica.util.logging.TMAuditTrailManager.flush(TMAuditTrailManager.java:166)
| at com.teramedica.util.logging.TMAuditTrailManager.update(TMAuditTrailManager.java:138)
| at com.teramedica.util.TMObservable.notifyObservers(TMObservable.java:91)
| at com.teramedica.db.transaction.TMTransactionHelper.transact(TMTransactionHelper.java:101)
| at com.teramedica.db.transaction.interceptor.TMTransactionInterceptor.invoke(TMTransactionInterceptor.java:120)
| at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
| at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
| at $Proxy324.patientOperation(Unknown Source)
| at com.teramedica.hl7.proxy.TMPatientOperationProcess.patientOperation(TMPatientOperationProcess.java:88)
| at com.teramedica.hl7.proxy.TMPatientOperationProcess.processMessage(TMPatientOperationProcess.java:51)
| at com.teramedica.aurora.HL7.server.TMAuroraPatientUpdateAction.doAction(TMAuroraPatientUpdateAction.java:65)
| at com.teramedica.aurora.HL7.server.TMAuroraHL7ParserActionBase.perform(TMAuroraHL7ParserActionBase.java:94)
| at com.teramedica.hl7.service.TMHL7Worker.processData(TMHL7Worker.java:133)
| at com.teramedica.hl7.service.TMHL7Worker.run(TMHL7Worker.java:77)
| at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
| at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
| at java.lang.Thread.run(Thread.java:810)
| Caused by:
| java.sql.SQLException: ORA-00001: unique constraint (XXX.SYS_C0010983) violated
|
| at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
| at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
| at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
| at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
| at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
| at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:633)
| at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1086)
| at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
| at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3057)
| at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:251)
| at org.jboss.mq.pm.jdbc2.PersistenceManager.add(PersistenceManager.java:1132)
| at org.jboss.mq.pm.jdbc2.PersistenceManager.saveToStorage(PersistenceManager.java:1624)
| ... 36 more
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182521#4182521
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182521
16 years, 3 months