[Design of Messaging on JBoss (Messaging/JBoss)] - Re: Sporadic read timeouts for app client reading a msg sent
by scott.stark@jboss.org
I'm not sure what Jesper is looking at, but this is doing a receive(timeout):
| QueueConnection connection = null;
|
| try {
| TestUtil.logTrace("getting connection");
| connection = qcFactory.createQueueConnection();
| QueueSession session = connection.createQueueSession(true, 0);
| TestUtil.logTrace("creating receiver");
| QueueReceiver receiver = session.createReceiver(queue);
| connection.start();
| return getMessage(receiver, timeout);
| } catch (Exception e) {
| handleException("Error receiving message", e);
| } finally {
| if (connection != null) {
| try {
| connection.close();
| } catch (Exception e) {
| handleException("Error closing queue connection", e);
| }
| }
| }
| ...
| public static String getMessage(QueueReceiver receiver, long timeout) {
|
| TextMessage msg;
| String message;
| int retries = 0;
|
| try {
|
| do {
| Message m = receiver.receive(timeout);
|
| if (m == null) {
| TestUtil.logTrace("no message received");
| return TimerImpl.NOMSGRECEIVED;
| }
| else {
| if (m instanceof TextMessage) {
| msg = (TextMessage) m;
| message = msg.getText();
| TestUtil.logTrace("Receiving message at " +
| System.currentTimeMillis() + ": " + message);
| String mTestName = msg.getStringProperty("testName");
| String testName = TestUtil.getProperty("testName");
| if (testName.equals(mTestName)) {
| TestUtil.logTrace("test name property of message is correct: accepting");
| return message;
| }
| TestUtil.logErr("message from " + mTestName + " received - ignoring");
| ++retries;
| }
| else {
| TestUtil.logErr("non-text message received!");
| ++retries;
| }
| }
| } while (retries < 5);
| TestUtil.logTrace("No valid message received after " + retries + " attempts");
|
| } catch (Exception e) {
| TimerImpl.handleException("Error receiving message", e);
| }
| return TimerImpl.NOMSGRECEIVED;
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4176022#4176022
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4176022
17 years, 6 months
[Design of POJO Server] - Re: EJB/War deployer ordering problem
by TheBen
Perhaps related. We are testing a Seam 2.0.1.GA app in production on 4.2.EAP now on jboss-5.0.0.CR1 and it is so close. Seam components relying on the entityManager fail to load, but the entityManager then loads thereafter.
16:33:31,685 INFO [Component] Component: viewBalanceDto, scope: CONVERSATION, type: JAVA_BEAN, class: com.alliancedata.ecis.dto.paymentarrangement.ViewBalanceDto
16:33:31,732 INFO [Component] Component: workZoneBean, scope: APPLICATION, type: JAVA_BEAN, class: com.alliancedata.ecis.reference.WorkZoneBean
16:33:31,732 INFO [Contexts] starting up: persistenceBean
16:33:31,779 INFO [Contexts] starting up: adsTime
16:33:31,779 INFO [Contexts] starting up: org.jboss.seam.bpm.jbpm
16:33:31,826 INFO [StaleObjectLogConfigurer] stale object exceptions will be hidden from logging
16:33:33,732 INFO [Contexts] starting up: buildInfo
16:33:33,764 INFO [BuildInfo] creating BuildInfo
16:33:33,951 INFO [Version] Hibernate Annotations 3.4.0.CR1
16:33:33,967 INFO [Environment] Hibernate 3.3.0.CR1
16:33:33,982 INFO [Environment] hibernate.properties not found
16:33:33,998 INFO [Environment] Bytecode provider name : javassist
16:33:33,998 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
16:33:34,154 INFO [Version] Hibernate Commons Annotations 3.1.0.CR1
16:33:34,154 INFO [Version] Hibernate EntityManager 3.4.0.CR1
16:33:34,310 ERROR [BuildInfo] javax.persistence.PersistenceException: No Persistence provider for EntityManager named entityManagerFactory
16:33:34,326 ERROR [BuildInfo] java.lang.IllegalArgumentException: EntityManagerFactory not found in JNDI : java:/EntityManagerFactories/servicesDatasource
16:33:34,326 INFO [Contexts] starting up: contactLetterService
16:33:34,342 ERROR [[/nextgen]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
java.lang.IllegalArgumentException: EntityManagerFactory not found in JNDI : java:/EntityManagerFactories/servicesDatasource
at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:247)
... but then later we see the persistence unit load:
16:33:35,576 INFO [TomcatDeployment] deploy, ctxPath=/jbossws, vfsUrl=jbossws.sar/jbossws-management.war
16:33:35,686 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=ServicesDS' to JNDI name 'java:ServicesDS'
16:33:35,686 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
16:33:36,186 WARN [QuartzTimerServiceFactory] sql failed: CREATE TABLE QRTZ_JOB_DETAILS(JOB_NAME VARCHAR(80) NOT NULL, JOB_GROUP VARCHAR(80) NOT NULL, DESCRIPTION VARCHAR(120) NULL, JOB_CLASS_NAME VARCHAR(128) NOT NULL, IS_DURABLE VARCHAR(1) NOT NULL, IS_VOLATILE VARCHAR(1) NOT NULL, IS_STATEFUL VARCHAR(1) NOT NULL, REQUESTS_RECOVERY VARCHAR(1) NOT NULL, JOB_DATA BINARY NULL, PRIMARY KEY (JOB_NAME,JOB_GROUP))
16:33:36,233 INFO [SimpleThreadPool] Job execution threads will use class loader of thread: main
16:33:36,233 INFO [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
16:33:36,233 INFO [JobStoreCMT] Using db table-based data access locking (synchronization).
16:33:36,248 INFO [JobStoreCMT] Removed 0 Volatile Trigger(s).
16:33:36,248 INFO [JobStoreCMT] Removed 0 Volatile Job(s).
16:33:36,248 INFO [JobStoreCMT] JobStoreCMT initialized.
16:33:36,248 INFO [StdSchedulerFactory] Quartz scheduler 'JBossEJB3QuartzScheduler' initialized from an externally provided properties instance.
16:33:36,248 INFO [StdSchedulerFactory] Quartz scheduler version: 1.5.2
16:33:36,248 INFO [JobStoreCMT] Freed 0 triggers from 'acquired' / 'blocked' state.
16:33:36,248 INFO [JobStoreCMT] Recovering 0 jobs that were in-progress at the time of the last shut-down.
16:33:36,248 INFO [JobStoreCMT] Recovery complete.
16:33:36,248 INFO [JobStoreCMT] Removed 0 'complete' triggers.
16:33:36,248 INFO [JobStoreCMT] Removed 0 stale fired job entries.
16:33:36,264 INFO [QuartzScheduler] Scheduler JBossEJB3QuartzScheduler_$_NON_CLUSTERED started.
16:33:36,483 INFO [ServerPeer] JBoss Messaging 1.4.1.CR1 server [0] started
16:33:36,608 INFO [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
16:33:36,733 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
16:33:36,733 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@1ef4049 started
16:33:36,748 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
16:33:36,748 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@48b622 started
16:33:36,748 WARN [ConnectionFactoryJNDIMapper] supportsFailover attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support failover
16:33:36,748 WARN [ConnectionFactoryJNDIMapper] supportsLoadBalancing attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support load balancing
16:33:36,764 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
16:33:36,764 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@d60482 started
16:33:36,764 INFO [QueueService] Queue[/queue/DLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000
16:33:36,779 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
16:33:37,451 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.units:ear=nextgen.ear,unitName=entityManager
16:33:38,123 WARN [Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
16:33:38,155 INFO [AnnotationConfiguration] Mapping package hq2d6049x1.bvws
16:33:38,436 INFO [STDOUT] CUSTOM ECISEmptyNullInterceptor OF com.alliancedata.ecis.hibernate.ECISEmptyNullInterceptor
16:33:38,483 WARN [EJB3OverridenAnnotationReader] Property com.alliancedata.ecis.persistence.UtilityContactInterface.SequenceId not found in class but described in <mapping-file/> (possible typo error)
16:33:38,483 WARN [EJB3OverridenAnnotationReader] Property com.alliancedata.ecis.persistence.CashInterface.SequenceId not found in class but described in <mapping-file/> (possible typo error)
16:33:38,561 INFO [AnnotationBinder] Binding entity from annotated class: com.alliancedata.ecis.persistence.DegreeDay
16:33:38,592 INFO [EntityBinder] Bind entity com.alliancedata.ecis.persistence.DegreeDay on table UDGD
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4176008#4176008
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4176008
17 years, 7 months
[Design of EJB 3.0] - Re: EJB3 Classloader Leak (EJBTHREE-1442)
by ALRubinger
I've got a patch that fixes the test in Sun JDK6, and JDK5 i386. Still continues to fail, however, in JDK x86_64.
This solution will also address the web injection issue, but redefining the Proxy in the caller's CL if necessary.
S,
ALR
Index: src/main/java/org/jboss/ejb3/proxy/factory/session/SessionProxyFactoryBase.java
| ===================================================================
| --- src/main/java/org/jboss/ejb3/proxy/factory/session/SessionProxyFactoryBase.java (revision 78381)
| +++ src/main/java/org/jboss/ejb3/proxy/factory/session/SessionProxyFactoryBase.java (working copy)
| @@ -197,30 +197,6 @@
| Constructor<?> constructor = this.getConstructorsProxySpecificBusinessInterface().get(
| businessInterfaceName.trim());
|
| - /*
| - * In place for web injection (isolated CL)
| - */
| - ClassLoader tcl = Thread.currentThread().getContextClassLoader();
| - try
| - {
| - // See if we can get at the bean class from the TCL
| - Class<?> businessInterfaceClass = Class.forName(businessInterfaceName, false, tcl);
| -
| - // If so, use the TCL to generate the Proxy class, not the Container CL
| - Set<Class<?>> businessInterfaces = new HashSet<Class<?>>();
| - businessInterfaces.add(businessInterfaceClass);
| - constructor = this.createProxyConstructor(businessInterfaces, tcl);
| -
| - }
| - catch (LinkageError le)
| - {
| - // Ignore
| - }
| - catch (ClassNotFoundException cce)
| - {
| - // Ignore
| - }
| -
| // Ensure the constructor was found
| assert constructor != null : "No business proxy constructor for \"" + businessInterfaceName
| + "\" was found; not created at start() properly? Bad value bound as RefAddr in JNDI?";
| @@ -229,8 +205,11 @@
| SessionProxyInvocationHandler handler = this
| .createBusinessInterfaceSpecificInvocationHandler(businessInterfaceName);
|
| - // Create a new Proxy instance, and return
| - return constructor.newInstance(handler);
| + // Create a new Proxy instance
| + Object proxy = constructor.newInstance(handler);
| +
| + // Return
| + return proxy;
| }
| catch (Throwable t)
| {
| Index: src/main/java/org/jboss/ejb3/proxy/objectfactory/session/SessionProxyObjectFactory.java
| ===================================================================
| --- src/main/java/org/jboss/ejb3/proxy/objectfactory/session/SessionProxyObjectFactory.java (revision 78381)
| +++ src/main/java/org/jboss/ejb3/proxy/objectfactory/session/SessionProxyObjectFactory.java (working copy)
| @@ -21,8 +21,12 @@
| */
| package org.jboss.ejb3.proxy.objectfactory.session;
|
| +import java.lang.reflect.InvocationHandler;
| +import java.lang.reflect.Proxy;
| +import java.util.HashSet;
| import java.util.List;
| import java.util.Map;
| +import java.util.Set;
|
| import javax.naming.Name;
|
| @@ -129,6 +133,65 @@
| proxy = sFactory.createProxyBusiness(businessInterface);
| log.debug("Created Proxy of type " + proxy.getClass().getSimpleName() + " for EJB3 Business Interface: "
| + businessInterface);
| +
| + /*
| + * We've got to ensure that the Proxy will be assignable to the target
| + * within this CL
| + */
| +
| + // Get the TCL
| + ClassLoader tcl = Thread.currentThread().getContextClassLoader();
| +
| + // Get the Proxy's CL
| + ClassLoader proxyCl = proxy.getClass().getClassLoader();
| +
| + // If the classloaders are not equal
| + if (tcl != proxyCl)
| + {
| + /*
| + * Reconstruct/redefine the Proxy in our CL
| + */
| +
| + // Get the Proxy Class
| + Class<?> proxyClass = proxy.getClass();
| +
| + // Ensure we've got a Proxy
| + assert Proxy.isProxyClass(proxyClass) : "Assumed Proxy is not an instance of " + Proxy.class.getName();
| +
| + // Get the InvocationHandler
| + InvocationHandler handler = Proxy.getInvocationHandler(proxy);
| +
| + // Get the Interfaces
| + Class<?>[] proxyInterfaces = proxyClass.getInterfaces();
| +
| + // Make a Set to hold the redefined classes
| + Set<Class<?>> ourClInterfaces = new HashSet<Class<?>>();
| +
| + // For each interface defined by the Proxy
| + for (Class<?> proxyInterface : proxyInterfaces)
| + {
| + // Get the FQN
| + String proxyInterfaceName = proxyInterface.getName();
| +
| + // Redefine the class in our CL
| + Class<?> ourDefinedProxyInterface = null;
| + try
| + {
| + ourDefinedProxyInterface = Class.forName(proxyInterfaceName, false, tcl);
| + }
| + catch (ClassNotFoundException e)
| + {
| + throw new RuntimeException("Can not find interface declared by Proxy in our CL + " + tcl, e);
| + }
| +
| + // Add the Class to the Set
| + ourClInterfaces.add(ourDefinedProxyInterface);
| + }
| +
| + // Redefine the Proxy in our CL
| + proxy = Proxy.newProxyInstance(tcl, ourClInterfaces.toArray(new Class<?>[]
| + {}), handler);
| + }
| }
| else
| {
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4175974#4175974
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4175974
17 years, 7 months