[Installation, Configuration & DEPLOYMENT] - Re: External Directories On JBoss 4.2.x
by mdiamant
Hello nhelder,
Your post is dated from August 2007, so I do not know if you are still facing this problem. I am new to JBoss AS myself and like you, I was trying to figure out how to use virtual directories in JBoss AS and I had stumbled upon the same posts as you.
Using JBoss AS v4.2.2.GA I have successfully employed virtual directories (external directories in the JBoss nomenclature). I followed the steps provided in the external directories wiki page (http://wiki.jboss.org/wiki/Wiki.jsp?page=ExternalDirectories), but skipped copying the default web.xml file. In order to get external directories to work, I had to include the path parameter in the context tag. Originally, I had copied over a working context tag from a standalone version of Apache Tomcat v5.5, which did not include the parameter, path. It was the addition of the path tag that made the external directories work.
I hope this helps if you are still trying to use external directories in JBoss AS 4.2.x
Best,
Michael
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115702#4115702
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115702
17 years
[Persistence, JBoss/CMP, Hibernate, Database] - Connection with active local transaction being reused?
by brent.atkinson
I have an MBean that accesses a database using a datasource configured as a local-tx-datasource. The usual client code (which is used by multiple applications) is a stateless session bean, but the MBean uses straight JDBC with autocommit set to false. The code has been running for quite a while in production with no snags, until a connection timeout on a connection causes an SQL statement to fail, and prevents the rollback code from executing.
Since that happened, I see the following behavior again and again in the logs. It appears that the managed connection is being reused even though it hasn't rolled back, and the connection manager is detecting that and trying to clean it up. The end result is that anything calling getConnection() on that datasource and gets that connection continues to fail with the same error, the connection is not being removed and the rollbacks are not completing. Because the applications are not under heavy load this is effectively causing all client apps to fail as most (all) of the getConnection() calls are returning the offending connection.
I am using JBoss 4.0.5 GA, using a datasource configured as the following:
<datasources>
| <local-tx-datasource>
| <jndi-name>jdbc/AppName</jndi-name>
|
| <connection-url>
| jdbc:oracle:thin:@host:1521:DEV
| </connection-url>
| <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
|
| <exception-sorter-class-name>
| org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter
| </exception-sorter-class-name>
| <metadata>
| <type-mapping>Oracle9i</type-mapping>
| </metadata>
| </local-tx-datasource>
|
| </datasources>
with client code that does the following:
| DataSource ds = (DataSource)ctx.lookup("java:jdbc/AppName");
| Connection c = null;
|
| try {
| c = ds.getConnection();
| c.setAutoCommit(false);
| ... do important *stuff*
| c.commit();
| }
| catch (Throwable t) {
| if (c != null) try { c.rollback(); } catch (SQLException sqle) { /* log... */ }
| }
| finally {
| if (c != null) try { c.close(); } catch (SQLException sqle) { /* log... */ }
| }
yields:
java.sql.SQLException: Io exception: Connection timed out
| at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
| at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
| at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:274)
| at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:432)
| at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:896)
| at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:452)
| at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:986)
| at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2888)
| at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:2929)
| at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:236)
| ...
and then when trying to rollback because of the exception...
2007-12-23 07:06:28,532 ERROR [MBeanCode] failed to roll back
| java.sql.SQLException: Closed Connection
| at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
| at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
| at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
| at oracle.jdbc.driver.PhysicalConnection.rollback(PhysicalConnection.java:994)
| at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcRollback(BaseWrapperManagedConnection.java:581)
| at org.jboss.resource.adapter.jdbc.WrappedConnection.rollback(WrappedConnection.java:340)
| ...
After this occurs, I see the JCA connection manager try to cleanup...
2007-12-23 07:06:28,533 DEBUG [org.jboss.resource.connectionmanager.TxConnectionManager] Unfinished local transaction was rolled back.org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@172e189[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@d2c59f handles=0 lastUse=1198410045635 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@1ac4e3f context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@1452dd5 xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@c4153f txSync=null]
|
I then see the same managed connection and the same LocalXAResource fail when other requests are given what seems to be the same connection?
For instance, one of many log messages the appear after that (for 2 days in production at least):
2007-12-23 07:26:28,556 DEBUG [org.jboss.resource.connectionmanager.TxConnectionManager] Unfinished local transaction was rolled back.org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@172e189[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@d2c59f handles=0 lastUse=1198412188545 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@1ac4e3f context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@1452dd5 xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@c4153f txSync=null]
1.) Why is the connection being reused?
2.) What can I do to prevent this from occurring?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115701#4115701
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115701
17 years
[Installation, Configuration & DEPLOYMENT] - Cannot install JBoss on Windows
by jespinoz
Hi,
I have been trying to install jboss-4.2.2.GA with jdk1.5.0_12 on Windows XP sp2 station and all the times i got a message like this:
"javax.naming.NoInitialContextException: Cannot instantiate class: oracle.j2ee.rmi.RMIInitialContextFactory"
I have Oracle SOA Suite (OC4J) already installed in the machine, but it's not running at the same time when i try to install JBoss.
What do you think?, it's a configuration theme?
Here is a part of the bootstrap activities logged and as you will see appears the message related to the Oracle class....
2007-12-27 10:48:32,154 DEBUG [org.jboss.system.ServiceController] starting service jboss:service=WebService
2007-12-27 10:48:32,154 DEBUG [org.jboss.web.WebService] Starting jboss:service=WebService
2007-12-27 10:48:32,170 DEBUG [org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread] Running
2007-12-27 10:48:32,170 DEBUG [org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread] Disabled, waiting for notification
2007-12-27 10:48:32,170 DEBUG [org.jboss.web.WebServer] Started server: ServerSocket[addr=/127.0.0.1,port=0,localport=8083]
2007-12-27 10:48:32,185 DEBUG [org.jboss.web.WebService] Started WebServer with address: /127.0.0.1:8083
2007-12-27 10:48:32,185 DEBUG [org.jboss.web.WebService] Started jboss:service=WebService
2007-12-27 10:48:32,185 DEBUG [org.jboss.system.ServiceController] Starting dependent components for: jboss:service=WebService dependent components: []
2007-12-27 10:48:32,185 DEBUG [org.jboss.system.ServiceController] starting service jboss:service=Naming
2007-12-27 10:48:32,185 DEBUG [org.jboss.system.ServiceController] waiting in start jboss:service=Naming on jboss:service=NamingBeanImpl
2007-12-27 10:48:32,185 DEBUG [org.jboss.system.ServiceController] starting service jboss.system:type=Log4jService,service=Logging
2007-12-27 10:48:32,185 DEBUG [org.jboss.logging.Log4jService] Starting jboss.system:type=Log4jService,service=Logging
2007-12-27 10:48:32,185 DEBUG [org.jboss.logging.Log4jService] Started jboss.system:type=Log4jService,service=Logging
2007-12-27 10:48:32,185 DEBUG [org.jboss.system.ServiceController] Starting dependent components for: jboss.system:type=Log4jService,service=Logging dependent components: []
2007-12-27 10:48:32,185 DEBUG [org.jboss.system.ServiceController] starting service jboss.rmi:type=RMIClassLoader
2007-12-27 10:48:32,185 DEBUG [org.jboss.system.ServiceController] Starting dependent components for: jboss.rmi:type=RMIClassLoader dependent components: []
2007-12-27 10:48:32,185 DEBUG [org.jboss.system.ServiceController] starting service jboss:service=WebService
2007-12-27 10:48:32,185 DEBUG [org.jboss.system.ServiceController] Ignoring start request for service: jboss:service=WebService
2007-12-27 10:48:32,185 DEBUG [org.jboss.system.ServiceController] starting service jboss:service=NamingBeanImpl
2007-12-27 10:48:32,185 DEBUG [org.jnp.server.NamingBeanImpl] Using NamingServer: org.jnp.server.NamingServer@3a1834
2007-12-27 10:48:32,185 DEBUG [org.jnp.server.NamingBeanImpl] Installed global NamingServer: org.jnp.server.NamingServer@3a1834
2007-12-27 10:48:32,201 WARN [org.jboss.system.ServiceController] Problem starting service jboss:service=NamingBeanImpl
javax.naming.NoInitialContextException: Cannot instantiate class: oracle.j2ee.rmi.RMIInitialContextFactory [Root exception is java.lang.ClassNotFoundException: No ClassLoaders found for: oracle.j2ee.rmi.RMIInitialContextFactory]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.(InitialContext.java:175)
at org.jnp.server.NamingBeanImpl.start(NamingBeanImpl.java:123)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
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:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:995)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
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:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:508)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: oracle.j2ee.rmi.RMIInitialContextFactory
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
... 54 more
2007-12-27 10:48:32,201 DEBUG [org.jboss.system.ServiceController] starting service jboss:service=Naming
2007-12-27 10:48:32,201 DEBUG [org.jboss.system.ServiceController] waiting in start jboss:service=Naming on jboss:service=NamingBeanImpl
2007-12-27 10:48:32,201 DEBUG [org.jboss.system.ServiceController] starting service jboss:service=JNDIView
2007-12-27 10:48:32,201 DEBUG [org.jboss.naming.JNDIView] Starting jboss:service=JNDIView
2007-12-27 10:48:32,201 DEBUG [org.jboss.naming.JNDIView] Started jboss:service=JNDIView
2007-12-27 10:48:32,201 DEBUG [org.jboss.system.ServiceController] Starting dependent components for: jboss:service=JNDIView dependent components: []
2007-12-27 10:48:32,201 DEBUG [org.jboss.system.ServiceController] starting service jboss.security:service=SecurityConfig
2007-12-27 10:48:32,201 DEBUG [org.jboss.security.plugins.SecurityConfig] Starting jboss.security:service=SecurityConfig
2007-12-27 10:48:32,201 DEBUG [org.jboss.security.plugins.SecurityConfig] Installed JAAS Configuration service=jboss.security:service=XMLLoginConfig, config=org.jboss.security.auth.login.XMLLoginConfigImpl@1b4c1d7
2007-12-27 10:48:32,201 DEBUG [org.jboss.security.plugins.SecurityConfig] Started jboss.security:service=SecurityConfig
2007-12-27 10:48:32,201 DEBUG [org.jboss.system.ServiceController] Starting dependent components for: jboss.security:service=SecurityConfig dependent components: []
2007-12-27 10:48:32,201 DEBUG [org.jboss.system.ServiceController] starting service jboss.security:service=XMLLoginConfig
2007-12-27 10:48:32,201 DEBUG [org.jboss.security.auth.login.XMLLoginConfig] Starting jboss.security:service=XMLLoginConfig
2007-12-27 10:48:32,201 DEBUG [org.jboss.security.auth.login.XMLLoginConfigImpl] Try loading config as XML, url=file:/E:/disk_c/compartido/JBoss/jboss-4.2.2.GA/server/default/conf/login-config.xml
2007-12-27 10:48:32,357 DEBUG [org.jboss.security.auth.login.XMLLoginConfig] Started jboss.security:service=XMLLoginConfig
2007-12-27 10:48:32,357 DEBUG [org.jboss.system.ServiceController] Starting dependent components for: jboss.security:service=XMLLoginConfig dependent components: []
2007-12-27 10:48:32,357 DEBUG [org.jboss.system.ServiceController] starting service jboss.security:service=JaasSecurityManager
2007-12-27 10:48:32,357 DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] Starting jboss.security:service=JaasSecurityManager
2007-12-27 10:48:32,357 DEBUG [org.jboss.security.SecurityAssociation] Using ThreadLocal: false
2007-12-27 10:48:32,373 DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] Starting failed jboss.security:service=JaasSecurityManager
javax.naming.NoInitialContextException: Cannot instantiate class: oracle.j2ee.rmi.RMIInitialContextFactory [Root exception is java.lang.ClassNotFoundException: No ClassLoaders found for: oracle.j2ee.rmi.RMIInitialContextFactory]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
any thoughts will be appreciated
Jose
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115699#4115699
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115699
17 years
[Security & JAAS/JBoss] - Caching name and passwordcallbackhandler
by kristof.devos
Hi
I have 2 applications running on 1 server instance. Both have a different loginmodule and have a different security domain.
The first application is a management application and allows administrators to login on the 2nd application as different users. For this I've setup an SSO solution --> SAML ticket and username are sent loginmodule of the 2nd application using the standard form authentication (auto submit), but in the 2nd loginmodule when I use the name and passwordcallbackhandlers they return me username and password of my first application and not the username and samlticket. So callbacks still cache previous values.
Putting the DefaultCacheTimeout = 0 is not an option as it affects our performance.
Is there any way to make sure the callbacks are not cached?
thx
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115696#4115696
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115696
17 years