[Remoting] - Re: Socket Read Timeout on stressing calls for validating pr
by vink
In the meanwhile, I tried overnight tests on my system with invokerDestructionDelay=10000, & I face this exception on server. I cannot understand what it means, but it is linked with socket; so I thought it may be worth to share;
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: could not execute query
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:73)
at com.barco.cms.eventmgt.EventQueuePoolImpl.createEventQueue(EventQueuePoolImpl.java:163)
at com.barco.cms.openapi.sessionmgt.SessionManager.createSession(SessionManager.java:109)
at com.barco.cms.openapi.OpenAPIImpl.startSession(OpenAPIImpl.java:148)
at com.barco.cms.openapi.PerspectiveMgtAPIImpl.startSession(PerspectiveMgtAPIImpl.java:426)
at sun.reflect.GeneratedMethodAccessor229.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
at com.barco.cms.openapi.PerspectiveMgtAPIImpl.initialSteps(PerspectiveMgtAPIImpl.java:269)
... 32 more
Caused by: org.hibernate.exception.JDBCConnectionException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2223)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:64)
... 42 more
Caused by: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:218)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254)
at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeQuery(CachedPreparedStatement.java:90)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:236)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
at org.hibernate.loader.Loader.doQuery(Loader.java:674)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
... 50 more
Caused by: java.net.SocketException: Socket closed
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:99)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:78)
at org.postgresql.core.PGStream.SendChar(PGStream.java:174)
at org.postgresql.core.v3.QueryExecutorImpl.sendBind(QueryExecutorImpl.java:829)
at org.postgresql.core.v3.QueryExecutorImpl.sendOneQuery(QueryExecutorImpl.java:1053)
at org.postgresql.core.v3.QueryExecutorImpl.sendQueryPreamble(QueryExecutorImpl.java:373)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:189)
... 60 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200238#4200238
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200238
17 years, 3 months
[EJB 3.0] - EBJ configuration help needed!!!
by JKV
Hello,
I am running EJB3.0 along with hibernate in jboss 4.2.2. I am having an EJB with method Parent() which calls another EJB with a method
A() which in turn calls a DAO layer method B() which makes a select statment. I have given @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
for method A(). I printed the execution time of the method A() in method Parent() and printing the execution time of the query within the DAO
method B().
They are as follows in secs
A() - 0.063 -> B() - 0.015
A() - 0.063 -> B() - 0.031
A() - 1.563 -> B() - 0.032
A() - 1.875 -> B() - 1.531
A() - 1.828 -> B() - 1.578
Why is there a sudden increase in excecution time (1.563) of method A() even when my corrresponding DAO method B() takes only little time (0.032) to complete. The corresponding calls are all increased.. The calls to method A() will be approximately 40 per second so my application is fast running. Is there something wrong in configurations of my JBOSS or is there a way to avoid it ???
Thanks in Advance
Regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200234#4200234
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200234
17 years, 3 months
[Persistence, JBoss/CMP, Hibernate, Database] - Re: Could not find datasource message in client JPA although
by ezanih
Thank you so much, Jaikiran :-)
So am I right in my conclusion that if I call this portion of code directly from my standalone Java client :
| Properties p = new Properties();
| p.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
| p.put("java.naming.provider.url", "jnp://localhost:1099");
| p.put("java.naming.factory.url.pkgs", "org.jboss.naming.client");
|
| java.sql.Connection conn;
| InitialContext ic = new InitialContext(p);
| javax.sql.DataSource db = (javax.sql.DataSource) ic.lookup("java:OracleXE1_DS");
| conn = db.getConnection();
|
to lookup a wrapper datasource from a JPA entity project saved in my JBoss AS using EntityManager, it would always give me a "XXX not bound" exception because the JBoss AS and the Java client are running on separate VMs ?
Would the solution be : to create an EJB3 to get the Java client to lookup the EJB3 instead - ctx.lookup("bean/local") - and then have the bean call the wrapper datasource - ctx.lookup("java:/DefaultDS") - assuming it would work because the EJB and the wrapper datasource are both managed by the JBoss AS container and so the java:/ namespace can be used because they are using the same VM (JBoss VM) ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200233#4200233
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200233
17 years, 3 months
[EJB 3.0] - Re: $Proxy200 error & Invalid (i.e. remote) invocation of lo
by ezanih
Ok, you are right :-) ...JNDI now returns a remote namespace:
JMX Console's JNDI View:
| +- BiddingTestEAR (class: org.jnp.interfaces.NamingContext)
| | +- BiddingTestBeanLocal (class: org.jnp.interfaces.NamingContext)
| | | +- local (proxy: $Proxy107 implements interface my.com.eperolehan.ejb.BiddingTestBeanLocalLocal,interface org.jboss.ejb3.JBossProxy)
| | +- BiddingTestBean (class: org.jnp.interfaces.NamingContext)
| | | +- remote (proxy: $Proxy102 implements interface my.com.eperolehan.ejb.BiddingTestBeanRemote,interface org.jboss.ejb3.JBossProxy)
|
However, I am now getting this rather simple 2-liner error :
| java.lang.NullPointerException
| at BidClient.main(BidClient.java:95)
|
and the code pointed to is this :
| em.getTransaction().begin();
|
I've moved all the em.getTransaction().begin(), em.persist(bidder) and em.getTransaction().commit() calls out of the EJB3 and into the client because originally putting them in the EJB3 was giving me this error :
Console:
| 10:43:46,984 ERROR [STDERR] java.lang.IllegalStateException: Illegal to call this method from injected, managed EntityManager
|
It seems that whenever I use the code below, I get the above error:
| @PersistenceContext(unitName="BiddingTest")
| private static EntityManager em;
|
So I changed from injection to this :
| private static EntityManagerFactory emf;
| private static EntityManager em;
|
| emf = Persistence.createEntityManagerFactory("BiddingTest");
| em = emf.createEntityManager();
|
Then I got this error which I believe, from the forums, is due to incompatibilities from the Hibernation Compatibility Matrix :
| Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.cfg.AnnotationConfiguration.setProperty(Ljava/lang/String;Ljava/lang/String;)Lorg/hibernate/cfg/AnnotationConfiguration;
|
However, I made sure I was compatible by using the latest Hibernate downloads and including the jars as well as the supporting and required jars found in the lib of that Hibernate product.
Here is what I've added to the classpath:
antlr-2.7.6.jar
commons-collections-3.1.jar
commons-logging-1.1.1.jar
concurrent.jar
dom4j-1.6.1.jar
ejb3-persistence.jar
hibernate-annotations.jar
hibernate-commons-annotations.jar
hibernate-core.jar
hibernate-entitymanager.jar
javassist-3.4.GA.jar
jboss-common-client.jar
jboss-j2ee.jar
jboss-transaction-client.jar
jbossall-client.jar
jbosssx-client.jar
jnp-client.jar
jnpserver.jar
jta-1.1.jar
log4j.jar
slf4j-api-1.5.2.jar
slf4j-jdk14-1.5.2.jar
My Hibernate versions:
- Hibernate Distribution 3.3.1.GA
- Hibernate EntityManager 3.4.0.GA
- Hibernate Annotations 3.4.0.GA
Ugh...still no progress, but I would like to ask you a few questions also:-
(1) Should the EntityManagerFactory be created only once (since it is a factory) and where is the best place to put its creation? Should we make the creation a singleton and how?
(2) Should the EntityManager be created in the EJB or in the java client or servlet or jsp ?
(3) Where do I place all the "em.getTransaction().begin(), em.persist(bidder) and em.getTransaction().commit()" commands? In the client/servlet/jsp or in the EJB?
Thank you so much in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200232#4200232
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200232
17 years, 3 months
[Installation, Configuration & DEPLOYMENT] - SocketProcessId.getpid could not get unique port
by sunnygrass
When starting jboss server, it will report some errors.
Platforms is windows Vista x64, jboss 5.0.0.GA
Following is part of the output :
2009-01-08 09:49:58,418 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Create: name=TransactionManager state=Configured
com.arjuna.ats.arjuna.exceptions.FatalError: [com.arjuna.ats.internal.arjuna.utils.SocketProcessId_2] - SocketProcessId.getpid could not get unique port.
at com.arjuna.ats.internal.arjuna.utils.SocketProcessId.getpid(SocketProcessId.java:105)
at com.arjuna.ats.arjuna.utils.Utility.getpid(Utility.java:277)
at com.arjuna.ats.arjuna.common.Uid.(Uid.java:105)
at com.arjuna.ats.arjuna.utils.Utility.getProcessUid(Utility.java:289)
at com.arjuna.ats.internal.arjuna.recovery.TransactionStatusManagerItem.(TransactionStatusManagerItem.java:366)
at com.arjuna.ats.internal.arjuna.recovery.TransactionStatusManagerItem.createAndSave(TransactionStatusManagerItem.java:84)
at com.arjuna.ats.arjuna.recovery.TransactionStatusManager.start(TransactionStatusManager.java:145)
at com.arjuna.ats.arjuna.recovery.TransactionStatusManager.(TransactionStatusManager.java:72)
at com.arjuna.ats.arjuna.coordinator.TxControl.(TxControl.java:355)
at com.arjuna.ats.jbossatx.jta.TransactionManagerService.create(TransactionManagerService.java:178)
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:597)
at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
Any one can help?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200224#4200224
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200224
17 years, 3 months