[JCA] - HOWTO: Pool connection management of my managed connection
by groovie
Dear sirs,
i have a question according to the proper
coding of the ressource/connection
management in JCA using the mbean
org.jboss.resource.connectionmanager.JBossManagedConnectionPool.
My application is using an old legacy application
(expert system). This application has been modified
and is running now as a classical forking-UNIX server,
that spawns automatically a new client worker,
if somebody tries to connect. This piece of software
is now acting as a EIS.
The forking model was choosen, cause to a possible
situation, when the working is getting a SEGV-interrupt,
the JBoss-JCA container cold establish a new connection
with a new working.
The connector, that has been implemented so far,
establishes a pool of connections using the
JBossManagedConnectionPool. The question is now,
how to tell inside my ManagedConnection (or
somewhere else) the controller of the
JBossManagedConnectionPool, that the connection
was gone and he shall create a new one.
I think, this is the issue of the ConnectionPool-Manager,
who will disables or remove the connection from the pool
and try to establish a new one (using my ManagedConnection).
Do you have some code, how to interact with the Pool ?
The technical connection-failure is detected in my
connection-impplementation, while reading the result of
a previously sent request message over the TCP-connection.
So throwing an exception is ok, but who will catch it to
generate a message for the pool-Manager in
org.jboss.resource.connectionmanager.JBossManagedConnectionPool
Please-note: For RPC-request the initiating instance is a session
bean and not the Pool-Managers!
Thank you
Groovie
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264044#4264044
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264044
16 years, 6 months
[Tomcat Integration] - HA Web Sessions via Database Persistence in SVN is not worki
by edavism
As described in http://labs.jboss.com/community/wiki/HAWebSessionsviaDatabasePersistencet... there is a way to tell JBoss to store web sessions in a datasource without using the Tomcat PersistentManager but the code in SVN has a bug:
| 2009-11-04 13:25:29,945 WARN [org.jboss.web.tomcat.service.session.InstantSnapshotManager./bligoo] (ajp-192.168.1.127-8009-1) Failed to replicate session NbQHDZfTi7jV5MySSD6JPg__
| java.lang.StringIndexOutOfBoundsException: String index out of range: 24
| at java.lang.AbstractStringBuilder.substring(AbstractStringBuilder.java:879)
| at java.lang.StringBuilder.substring(StringBuilder.java:55)
| at org.jboss.web.tomcat.service.session.persistent.RDBMSStoreBase.maskId(RDBMSStoreBase.java:1079)
| at org.jboss.web.tomcat.service.session.persistent.RDBMSStoreBase.maskId(RDBMSStoreBase.java:1061)
| at org.jboss.web.tomcat.service.session.persistent.RDBMSStoreBase.storeSessionData(RDBMSStoreBase.java:1007)
| at org.jboss.web.tomcat.service.session.persistent.PersistentStoreDistributedCacheManager.storeSessionData(PersistentStoreDistributedCacheManager.java:148)
| at org.jboss.web.tomcat.service.session.persistent.PersistentStoreDistributedCacheManager.storeSessionData(PersistentStoreDistributedCacheManager.java:41) at org.jboss.web.tomcat.service.session.ClusteredSession.processSessionReplication(ClusteredSession.java:1192)
| at org.jboss.web.tomcat.service.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:2182)
| at org.jboss.web.tomcat.service.session.JBossCacheManager.storeSession(JBossCacheManager.java:313)
| at org.jboss.web.tomcat.service.session.InstantSnapshotManager.snapshot(InstantSnapshotManager.java:51)
| at org.jboss.web.tomcat.service.session.ClusteredSessionValve.handleRequest(ClusteredSessionValve.java:147)
| at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:94)
| at org.jboss.web.tomcat.service.session.LockingValve.invoke(LockingValve.java:62)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
| at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
| at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
| at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:436)
| at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:384)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:619)
|
The problem seems to be in the maskId function in org.jboss.web.tomcat.service.session.persistent.RDBMSStoreBase
| 1064 private static String maskId(String realId)
| 1065 {
| 1066 if (realId == null)
| 1067 {
| 1068 return null;
| 1069 }
| 1070 else
| 1071 {
| 1072 int length = realId.length();
| 1073 if (length <= 8)
| 1074 {
| 1075 return realId;
| 1076 }
| 1077 StringBuilder sb = new StringBuilder(realId.substring(0, 2));
| 1078 sb.append("****");
| 1079 sb.append(sb.substring(length - 6, length));
| 1080 return sb.toString();
| 1081 }
| 1082 }
|
The line 1079 should be
| sb.append(realId.substring(length - 6, length));
|
Should I open a jira for it? Is this feature going to be included in 5.2.0GA (since is commited to trunk?)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264030#4264030
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264030
16 years, 6 months
[Tomcat Integration] - PersistentManager for sessions is broken in 5.1.0GA
by edavism
Tomcat provides a way to store web sessions data that is resilient to server reboots using the org.apache.catalina.session.PersistentManager as described in http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html but in jboss 5.1.0GA that support is broken:
Using the following context.xml
| <Context cookies="true" crossContext="true">
| <Manager className="org.apache.catalina.session.PersistentManager" maxIdleSwap="1200" saveOnRestart="true">
| <Store checkInterval="60" className="org.apache.catalina.session.JDBCStore" connectionURL="jdbc:mysql://localhost:3306/bligoo?user=bligoo&password=bligoo" driverName="com.mysql.jdbc.Driver" sessionAppCol="app_name" sessionDataCol="session_data" sessionIdCol="session_id" sessionLastAccessedCol="last_access" sessionMaxInactiveCol="max_inactive" sessionTable="tomcat_sessions" sessionValidCol="valid_session"/>
| </Manager>
| <InstanceListener>org.jboss.web.tomcat.security.RunAsListener</InstanceListener>
| </Context>
|
It refuses to start with the following exception:
| 2009-11-02 23:11:54,292 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (main) deploy, ctxPath=/
| 2009-11-02 23:11:55,619 ERROR [org.jboss.web.tomcat.service.deployers.JBossContextConfig] (main) XML error parsing: context.xml
| org.jboss.xb.binding.JBossXBException: Failed to parse source: Store not found as a child of Manager in unordered_sequence: attributes?
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:203)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:183)
| at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:133)
| at org.jboss.web.tomcat.service.deployers.JBossContextConfig.processContextConfig(JBossContextConfig.java:573)
| at org.jboss.web.tomcat.service.deployers.JBossContextConfig.init(JBossContextConfig.java:536)
| at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:279)
| at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
| at org.apache.catalina.core.StandardContext.init(StandardContext.java:5436)
| at org.apache.catalina.core.StandardContext.start(StandardContext.java:4148)
| at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
| at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
| at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
| at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
| at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
| 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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
| at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
| at $Proxy38.start(Unknown Source)
|
Is there a work arround? This bug is preventing us from upgrading from jboss4 to 5
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264029#4264029
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264029
16 years, 6 months
[JBoss Tools Users] - Modelling tool for JPA - Suggestions?
by sverker
In the past I've used AndroMDA for generating domain model from an UML class diagram. First EJB2, then Hibernate and in the last projects EJB3 based entities. It was a great tool for modelling, especially in the old days when it wasn't practically possible to write all those deployment descriptors and mapping files by hand. Nowdays with EJB3 and JPA it's not that neccesary, but still convenient as it gives an overview of the structure.
However, I feel that AndroMDA has got stuck since a few years back so I'm looking for an alternative but haven't been able to find any.
The ideal would be if the modelling tool could work directly on the java files. I.e. support both editing the java files directly as well as through the model tool. It doesn't have to be UML but something similar.
I know this isn't directly related to JBoss Tools but in the same area.
Anybody has any suggestions? I use Eclipse and have been looking for tutorials on their EMF but haven't found that much on how to use it for JPA
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264023#4264023
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264023
16 years, 6 months