[JCA/JBoss] - jbossjca-service.xml and DataSources
by charles.crouch@jboss.com
I'm looking at a 4.0.3.SP1 JBoss AS install:
1) Are there any settings defined in jbossjca-service.xml which a JDBC DataSource user would ever want to change?
Or asked another way, would changing things like
<attribute name="MaximumPoolSize">100</attribute> on jboss.jca:service=WorkManagerThreadPool or
| <attribute name="SpecCompliant">false</attribute> on jboss.jca:service=CachedConnectionManager
in jbossjca-service.xml have any impact on how a DataSource works at runtime?
What I'm looking at is if from a management perspective there needs to be any "containing" concept around DataSources. For example with JMS Queues and Topics you can configure things at their level, e.g. RedeliveryDelay. But you can also configure settings at the containing level of the whole messaging server, e.g. HighMemoryMark on jboss.mq:service=MessageCache. I'm wondering if there is some equivalent of this "container" for JCA DataSources.
Thanks very much
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975640#3975640
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975640
19 years, 1 month
[JCA/JBoss] - Oracle Database connection getting reset
by duraphes
We are using JBoss 4.0.4 with Oracle 10g. We are using ojdbc14.jar as the driver.
I have a session bean for which transaction attribute is
<trans-attribute>NotSupported</trans-attribute>
When this session bean calls a stored procedure, if the stored procedure takes a long time, i.e more than an hour, we get an exception -
java.sql.SQLException: Io exception : Connection reset
We narrowed it down and found that exception happens at exactly 60 minutes.
Yes, no one should expect to run a stored procedure which takes more one hour and I have asked developers to fix it. However I want to find out why it happened. If we wrap the stored procedure call in a session bean method with "RequiresNew", this seems to work.
Is there any parameter which controls this timeout? The Transaction-timeout in jboss-service.xml is set to high number (180 minutes) so there must be some other parameter.
What am I missing? (oracle-ds.xml is attached).
| <datasources>
| <local-tx-datasource>
| <jndi-name>expMDataSource</jndi-name>
| <connection-url>jdbc:oracle:thin:@000.000.00.00:0001:1xxdev</connection-url>
| <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
| <user-name>xxxx</user-name>
| <password>xxxx</password>
| <idle-timeout-minutes>0</idle-timeout-minutes>
| <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
| <new-connection-sql>select '1' from dual</new-connection-sql>
| <check-valid-connection-sql>select '1' from dual</check-valid-connection-sql>
| <min-pool-size>10</min-pool-size>
| <max-pool-size>100</max-pool-size>
| <blocking-timeout-millis>36000</blocking-timeout-millis>
| <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>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975639#3975639
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975639
19 years, 1 month
[Beginners Corner] - security Insufficient method permissions, principal=null
by srki
Hi,
I am unable to call a create method on the home object due to insufficient method permission but I am not sure what I am missing.
My login-config.xml is as follows
| <application-policy name="MyPolicy">
| <authentication>
| <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
| flag="required">
| <module-option name="usersProperties">props/my-users.properties</module-option>
| <module-option name="rolesProperties">props/my-roles.properties</module-option>
| <module-option name="unauthenticatedIdentity">guest</module-option>
| </login-module>
| </authentication>
| </application-policy>
|
In props folder I have my-users.properties file with
admin=admin
and I have my-roles.properties file with
admin=admin
In jboss.xml file I have the following
| <security-domain>java:/jaas/MyPolicy</security-domain>
|
In ejb-jar.xml I have the following
| <assembly-descriptor >
| <security-role-ref>
| <role-name>admin</role-name>
| <role-link>admin</role-link>
| </security-role-ref>
| <security-role>
| <description>Admin</description>
| <role-name>admin</role-name>
| </security-role>
|
| <method-permission>
| <role-name>admin</role-name>
| <method>
| <ejb-name>MyManager</ejb-name>
| <method-name>create</method-name>
| </method>
|
Now in the code I have the following and I am able to login in but when I try to call a create method I get an exception
java.lang.SecurityException: Insufficient method permissions, principal=null, ejbName=MyManager, method=create, interface=HOME, requiredRoles=[admin], principalRoles=[]
| LoginContext lc = null;
| try{
| String name = "admin";
| String passwordStr = "admin";
| char[] password = passwordStr.toCharArray();
| AppCallbackHandler handler = new AppCallbackHandler(name, password);
| lc = new LoginContext("MyPolicy", handler);
| System.out.println("Created LoginContext");
| lc.login();
| System.out.println("Logged in.");
| Iterator it = lc.getSubject().getPrincipals().iterator();
| while(it.hasNext()) {
| Object o = it.next();
| System.out.println("principle: "+o.getClass().getName()+ " "+o);
| }
| }catch (LoginException le){
| System.out.println("Login failed");
| le.printStackTrace();
| }
|
| Context ctx = new InitialContext();
| Object object = ctx.lookup( "ejb/com/blah/MyManager" );
| MyManager home = (MyManager)PortableRemoteObject.narrow ( object, MyManager.class);
|
| Manager manager= home.create();
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975634#3975634
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975634
19 years, 1 month