Showing posts with label geronimo. Show all posts
Showing posts with label geronimo. Show all posts

Friday, November 20, 2009

Setting Java Virtual Machine memory heap size for your server

Do you need to set the heap size (min and max) available for the java virtual machine being used by your server? well I ran into that annoying OutOfMemoryError message today and I took a couple of screenshots describing how to do it, check it out.

Here you can see WebSphere's console:




In this other case I used Eclipse, you can check how to set the values in the virtual machine parameters at the server connector tab for Geronimo:

 

Thursday, November 19, 2009

Java version being used by your server

Today I was solving an issue on different environments and I had to check the Java version being used in BEA Weblogic, IBM WebSphere and Apache Geronimo, it is not difficult but again I thought it would be useful to share it with everyone.

Here you can see how to check the Java version through the log in the Weblogic console:


In this case for WebSphere, you can see where to find the version by directly checking the log file:

The final screenshot is from Geronimo, with a lot of information about Java:


Monday, November 16, 2009

Geronimo Load Balancing database deployment

Recently I had the need to deploy a new datasource in Apache Geronimo, usually this would be a five minutes process that will just require a quick update of the deployment plan similar to this one:


 <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">  
   <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">  
     <dep:moduleId>  
       <dep:groupId>console.dbpool</dep:groupId>  
       <dep:artifactId>jdbc.myapp.mydb</dep:artifactId>  
       <dep:version>1.0</dep:version>  
       <dep:type>rar</dep:type>  
     </dep:moduleId>  
     <dep:dependencies>  
       <dep:dependency>  
         <dep:groupId>oracle</dep:groupId>  
         <dep:artifactId>ojdbc5</dep:artifactId>  
         <dep:version>11.1.0.6.0</dep:version>  
         <dep:type>jar</dep:type>  
       </dep:dependency>  
     </dep:dependencies>  
   </dep:environment>  
   <resourceadapter>  
     <outbound-resourceadapter>  
       <connection-definition>  
         <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>  
         <connectiondefinition-instance>  
           <name>jdbc.myapp.mydb</name>  
                          <config-property-setting name="Password">mypass</config-property-setting>  
           <config-property-setting name="UserName">myuser</config-property-setting>  
                          <config-property-setting name="DatabaseName">DB113</config-property-setting>  
                          <config-property-setting name="DataSourceName">mydb</config-property-setting>  
                          <config-property-setting name="ServerName">myserver</config-property-setting>  
                          <config-property-setting name="PortNumber">1521</config-property-setting>  
                          <config-property-setting name="DriverType">thin</config-property-setting>  
           <connectionmanager>  
             <xa-transaction>  
               <transaction-caching/>  
             </xa-transaction>  
             <single-pool>  
               <max-size>10</max-size>  
               <min-size>0</min-size>  
                                    <blocking-timeout-milliseconds>5</blocking-timeout-milliseconds>  
               <idle-timeout-minutes>1</idle-timeout-minutes>  
               <match-one/>  
             </single-pool>  
           </connectionmanager>  
         </connectiondefinition-instance>  
       </connection-definition>  
     </outbound-resourceadapter>  
   </resourceadapter>  
 </connector>  


But in this case I needed to deploy a database with load balancing, since I couldn't find this info online I thought about sharing with everyone the deployment plan that worked for me, it is similar to the previous one and the difference is in the "connectiondefinition-instance" element:


         <connectiondefinition-instance>  
           <name>jdbc.rf2h.mydb</name>  
           <config-property-setting name="Driver">oracle.jdbc.OracleDriver</config-property-setting>  
           <config-property-setting name="Password">mypass</config-property-setting>  
           <config-property-setting name="UserName">myuser</config-property-setting>  
           <config-property-setting name="ConnectionURL">jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS = (PROTOCOL = TCP)(HOST = 192.8.231.8)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 192.8.231.9)(PORT = 1521))(LOAD_BALANCE = yes)(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = db313))  
                          </config-property-setting>  
                          <config-property-setting name="CommitBeforeAutocommit">true</config-property-setting>  
           <connectionmanager>  
             <local-transaction/>  
             <single-pool>  
               <max-size>5</max-size>  
               <min-size>1</min-size>  
               <blocking-timeout-milliseconds>30</blocking-timeout-milliseconds>  
               <idle-timeout-minutes>1</idle-timeout-minutes>  
               <match-one/>  
             </single-pool>  
           </connectionmanager>  
         </connectiondefinition-instance>                      


As you can see, all the info about the load balance is in this "ConnectionURL" property, that's it, I hope this helps ;)

PS: for this deployment I used the following library: geronimo-tomcat6-javaee5-2.1.2\repository\org\tranql\tranql-connector-ra\1.4\tranql-connector-ra-1.4.rar