[EJB 3.0] - Re: No ManagedConnections available Error
by weston.price@jboss.com
anonymous wrote :
| From what I have read, this means that the database connection pool is messing up some how.
|
Actually, it simply means that a connection could not be allocated within the specific blocking timeout (30 seconds). There are usually a few possiblities:
1) You are not closing connections
2) You have long running transactions to the DB. As a result, the pool is exhausted and a connection cannot be give out.
3) A mix of the above two conditions.
If your using EJB3/JPA you do not have to explicitly close the connection as JPA does this for you. The next place to look would be at your DB transactions and determine what is taking so long to complete that a connection is tied up for that long. You can always increase the blocking timeout in the *-ds.xml file by adding the following element
| <blocking-timeout-millis>value</blocking-timeout-millis>
|
As mentioned above 30 seconds is the default and this is *usually* a good starting point, most the time it can actually be decreased. One suggestion is to look at your code to see if you are doing long running DB operations that could be broken up into smaller transactions.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035326#4035326
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035326
19 years
[EJB 3.0] - Re: java.lang.NoClassDefFoundError: org/jaxen/VariableContex
by codelion
My problem apparently has gone away too, yesterday, so far running fine on two servers.
I happened to rearrange how two Seam components (both stateful with scope application) were interacting. (For completeness of record: I moved storing of some kind of "unique id" from the one executing on timer to its "manager" for robustness, and made them both inject each other instead of one way because I had to.)
Now the problem is gone. I.e. the recurring super long log entries related to passivation and mentioning "java.lang.NoClassDefFoundError: org/jaxen/VariableContext" are gone.
It may have been related to a system exception in its method blasting a stateful session bean into non-existence. Not sure.
Point is, the problem went away when I cleaned up code.
Point is, the log didn't point at the cause, at least not in a way recognizable to me, which might not be anyone's fault or fixable. Just something to remember for next time.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035325#4035325
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035325
19 years
[EJB 3.0] - No ManagedConnections available Error
by majohnst
I use EJB3 to connect to Postgres 8.1. At random times, I get a database connection error:
| No ManagedConnections available within configured blocking timeout ( 30000 [ms] ); - nested throwable: (javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 30000 [ms] ))
|
>From what I have read, this means that the database connection pool is messing up some how. In my datasource definition, I have included:
| <local-tx-datasource>
| <jndi-name>MyDS</jndi-name>
| <connection-url>jdbc:postgresql://cherry/pgacms</connection-url>
| <driver-class>org.postgresql.Driver</driver-class>
| <user-name>...</user-name>
| <password>...</password>
| <min-pool-size>5</min-pool-size>
| <max-pool-size>30</max-pool-size>
| <new-connection-sql>SELECT version()</new-connection-sql>
| <check-valid-connection-sql>SELECT version()</check-valid-connection-sql>
|
| </local-tx-datasource>
|
I have checked, and the max number of connections defined for all my datasources is less than the maximum connections that Postgres allows. From what I have read about this error, most people say that the database connection is not being closed correctly in the java code.
So my question, since I am using EJB3 for my database connection, do I have to do anything to explicitly close the connection?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035323#4035323
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035323
19 years
[JBoss Seam] - Multiple Domain Quesiton
by rjstanford
I should preface this by saying that I'm very familiar with Struts, somewhat with Spring, but new to Seam and full-fledged EJB apps in general. So this may be a stupid question, but I can't find a good answer anywhere (probably searching on the wrong stuff). Anyway...
I'm modelling a new application, and I really want to use Seam for it. I think that after a week or two of fooling with it so far I'm already more productive than I was in Spring when I started, and that's saying something. Here's the deal. I need to be able to provide different functionality, and different content, based on the domain portion of the URL, and I'm not sure what the best, "SEAMiest" way to do that would be.
Normally, I'd just use a filter. That doesn't seem to fit well with the paradigm here.
You can think of the app as something like Typepad. Its not, but that's a close enough approximation for this discussion. There's a central application that's used for configuration and content creation, then the app can be accessed through a ton of different customer domains and should serve up specific content. For cluster cache reasons, I really want this to be a single app.
Now, I'm new to EARs in general. Should this be done as two separate WAR applications? Or can I just do one large app with some redirection logic somewhere? Any advice is welcomed, and thanks.
-Richard
ps: Cool product, guys. Seam really rocks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035321#4035321
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035321
19 years
[JBoss Seam] - Simpler way of testing properly injected beans?!
by mugwump
I'm currently using the following pattern for my seam-tests (taken from the examples):
| @Test
| public void testCombinedQuery() throws Exception{
| new FacesRequest() {
| QueryManager queryManager;
| @Override
| protected void updateModelValues()
| {
| queryManager = (QueryManager)getInstance("queryManager");
|
| }
|
| @Override
| protected void renderResponse()
| {
| Query query = new Query();
| query.setDays("'DAY1', 'DAY2'");
| query.setTopics("'1','3'");
| int resultSize = queryManager.getNrOfQuestionsInQuery(query);
| assertEquals("Combined-Query did not return the correct Number of Questions", resultSize, COMBINEDQUERY_QUESTIONS);
| }
| }.run();
| }
|
something without the code-overhead of the faces-request?!
For most of the tests, all I want to do is get a seam-object with proper injections and then invoke some methods on it and test the results. Is there a simpler way to achieve something in the line of:
@Test
| public void testCombinedQuery(){
| queryManager = (QueryManager)getInstance("queryManager");
| Query query = new Query();
| query.setDays("'DAY1', 'DAY2'");
| query.setTopics("'1','3'");
| int resultSize = queryManager.getNrOfQuestionsInQuery(query);
| assertEquals("Combined-Query did not return the correct Number of Questions", resultSize, COMBINEDQUERY_QUESTIONS);
|
| }
|
And another problem with testsuites: Two different testclasses in the same Test-Suite start/teardonw the embedded container twice - is there a way to have different tests in the same suite share the same embedded container?!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035318#4035318
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035318
19 years
[JBoss Messaging] - Marshalling Exception
by chip_schoch
JBossAS 4.0.5.GA and JBossMessaging 1.2.0.GA
I get client exception:
[2007-04-06 09:37:09,000] ERROR - Got marshalling exception, exiting
| java.io.EOFException
| at java.io.DataInputStream.readInt(Unknown Source)
| at org.jboss.jms.server.remoting.JMSWireFormat.read(JMSWireFormat.java:297)
| at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.versionedRead(MicroSocketClientInvoker.java:936)
| at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:579)
| at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:269)
| at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
| at org.jboss.remoting.LeasePinger.sendClientPing(LeasePinger.java:283)
| at org.jboss.remoting.LeasePinger.addClient(LeasePinger.java:117)
| at org.jboss.remoting.MicroRemoteClientInvoker.establishLease(MicroRemoteClientInvoker.java:398)
| at org.jboss.remoting.Client.setupClientLease(Client.java:1504)
| at org.jboss.remoting.Client.connect(Client.java:1404)
| at org.jboss.remoting.Client.connect(Client.java:441)
| at org.jboss.jms.client.remoting.JMSRemotingConnection.start(JMSRemotingConnection.java:271)
| at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:146)
| at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_4579211046834694258.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_4579211046834694258.java)
| at org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:83)
| at org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect0.invoke(StateCreationAspect0.java)
| at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_4579211046834694258.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_4579211046834694258.java)
| at org.jboss.jms.client.container.ExceptionInterceptor.invoke(ExceptionInterceptor.java:71)
| at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_4579211046834694258.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_4579211046834694258.java)
| at org.jboss.jms.client.container.ClientLogInterceptor.invoke(ClientLogInterceptor.java:107)
| at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_4579211046834694258.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_4579211046834694258.java)
| at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)
| at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:212)
| at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:88)
| at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:83)
| at com.eLynx.Messaging.MessageSender.initialize(MessageSender.java:144)
| at com.eLynx.Messaging.MessageSender.<init>(MessageSender.java:86)
| at com.eLynx.Imaging.USignContainerImager.<init>(USignContainerImager.java:96)
| at com.eLynx.Test.TestUsnProcessing.execute(TestUsnProcessing.java:140)
| at com.eLynx.Test.TestUsnProcessing.main(TestUsnProcessing.java:69)
| [2007-04-06 09:37:09,000] WARN - LeasePinger[SocketClientInvoker[1735602, bisocket://192.168.1.115:4457](5c4o137-ymrrtl-f06omnbl-1-f06ompil-5)] failed to ping to server: Failed to communicate. Problem during marshalling/unmarshalling; nested exception is:
| java.io.EOFException
|
And server exception:
2007-04-06 09:37:29,015 ERROR [org.jboss.remoting.transport.socket.ServerThread] Worker thread initialization failure
| java.io.IOException: cannot assign instance of [LEDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap$Segment; to field EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap.segments of type [LEDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap$Segment; in instance of EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap
| at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:2004)
| at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1184)
| at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1914)
| at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:479)
| at EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap.readObject(ConcurrentHashMap.java:1207)
| at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)
| at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809)
| at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
| at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
| at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
| at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
| at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
| at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
| at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
| at org.jboss.jms.wireformat.SerializedPacket.read(SerializedPacket.java:72)
| at org.jboss.jms.server.remoting.JMSWireFormat.read(JMSWireFormat.java:307)
| at org.jboss.remoting.transport.socket.ServerThread.versionedRead(ServerThread.java:641)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:523)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:363)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:159)
|
Any Ideas?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035317#4035317
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035317
19 years
[JBoss Seam] - Re: jBPM integration question
by SunFire
This one works well for me
@Intercept(NEVER)
| @Name("org.jboss.seam.core.jbpm.init")
| @Startup(depends={"org.jboss.seam.core.jbpm"})
| @Install(dependencies="org.jboss.seam.core.jbpm")
| public class JbpmInitializer extends Jbpm {
|
| private static final LogProvider log = Logging.getLogProvider(JbpmInitializer.class);
|
| public void startup() throws Exception {
| super.startup();
| if(getProcessDefinitions() == null || getProcessDefinitions().length < 1 ) {
| try {
| getJbpmConfiguration().createJbpmContext().getContextSession();
| } catch(Exception e) {
| log.error("jBPM Initialization Exception: " + e.getMessage());
| e.printStackTrace();
| }
| }
| }
|
| }
With it you can either deploy your processes with Seam or with something external. It will only be used if you enable JBPM in your components.xml and if no process definitions are set it will handle your schema creation/update.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035315#4035315
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035315
19 years