[Installation, Configuration & DEPLOYMENT] - pulling connection url out of Datasource files
by bluegirl125
Hi,
Currently jboss 4.2.2 is set up to connect to the oracle db using xx-ds.xml files with the following format:
| <datasources>
| <local-tx-datasource>
| <jndi-name>TestDS</jndi-name>
| <connection-url>jdbc:oracle:thin:@host:1521:SID</connection-url>
| <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
| <user-name>xxxx</user-name>
| < password>yyyy</ password>
| <prepared-statement-cache-size>32</prepared-statement-cache-size>
| <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
| <!-- Checks the Oracle error codes and messages for fatal errors --> <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
|
| <!-- sql to call when connection is created-->
| <new-connection-sql>SELECT 1 FROM DUAL</new-connection-sql>
| <!-- sql to call on an existing pooled connection when it is obtained from pool -->
| <check-valid-connection-sql>SELECT 1 FROM DUAL</check-valid-connection-sql>
| <metadata>
| <type-mapping>Oracle10g</type-mapping>
| </metadata>
| </local-tx-datasource>
| </datasources>
There is one file defined for each datasource, and we have ~10 such files. Now we are migrating over to Oracle RAC, so the connection url requires changing. However, if we add more hosts to later on, I do not want to have to change the connection URL for each datasource file again. Is it possible to pull out the connection URL and place it somewhere so it gets defined only once, and refer to that in all the xx-ds.xml files?
I am thinking no, but :) just want to see if I am missing any jboss set up options here...
Thanks very much!
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4217147#4217147
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4217147
17 years, 1 month
[Management, JMX/JBoss] - Re: MBean ObjectNames are a garbled mess!
by amlodzin
"dimitris(a)jboss.org" wrote : "amlodzin" wrote :
| | The problem, in the app-state case, is that the "jboss.web.deployment:*" MBeans use a random id as a key property, in addition to just one other key property - the war file name. That makes it impossible to link a particular war file with its parent EAR file (if there is one) when several ear files are deployed containing the a war file with the same name.
| |
| Where do you see that - which AS version?
Every version of JBoss 4.x, including at least 4.0.2 to 4.2.3.
Also, JBoss 5.0.0 does away with the random id - but replaces it with NOTHING! So, if you could find the ID in 4.x (say, hidden in the Exception generated by jboss.system:service=MainDeployer.checkIncompleteDeployments()), you might have had a chance of matching it up to the MBean that contains the modules StateString. In 5.0.0, that chance, however slim, is gone completely.
"dimitris(a)jboss.org" wrote : Also, I'd be interested in some hard facts about JBoss' insignificance, rather than some random ranting.
Got your attention, didn't it ;)
In our business of providing monitoring solutions for J2EE middleware, we always build support in stages: WebLogic 1st; WebSphere 2nd; OracleAS 3rd; JBoss last. I'm sure there are reasons beyond what the various appservers have to offer - but we follow the money.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4217144#4217144
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4217144
17 years, 1 month
[Beginners Corner] - Re: A true newbie -- Please help!
by rij
Ok, I was able to successfully build - or so I thought since my window showed the message "BUILD SUCCESSFUL".
However, when I checked the server log, there were a bunch of error messages. I wont include all of that here. But from checking the forums, it seemed that there was a problem in my persistence.xml file
First off, here is my persistence.xml:
| <persistence>
| <persistence-unit>
| <name>mojo</name>
| <jta-data-source>java:/DefaultDS</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
| </properties>
| </persistence-unit>
| </persistence>
|
Now, the next thing I checked was where to place persistence.xml. From the JBoss docs, I learnt the following:
anonymous wrote :
| You must also define a persistence.xml file that resides in the META-INF folder of the .jar file.
|
So in the directory where I have my EJB source files, I created a sub-directory META-INF directory and put persistence.xml in it. Incidentally, I have another sub-directory called client-config which has jndi.properties file. So now, my director structure looks like this:
| {DIR} client-config
| {DIR} META-INF
| build.xml
| Client.java
| User.java
| UserRegistrationRemote.java
| UserRegistrationSessionBean.java
| 5 File(s) 5,908 bytes
|
|
| Ok now, I run my build. Here is the relevant code which creates the jar file:
|
| | <!-- Create EJB-JAR and place it in deploy directory of JBoss server -->
| | <target name="ejbjar" depends="compile">
| | <jar jarfile="build/mojo.jar">
| | <fileset dir="${build.classes.dir}">
| | <include name="*.class"/>
| | <include name="*.class"/>
| | </fileset>
| | <fileset dir="${basedir}/META-INF">
| | <include name="*.xml"/>
| | </fileset>
| | </jar>
| | <copy file="build/mojo.jar "
| | todir="${jboss.deploy.dir}"/>
| | </target>
| |
|
| Now, I go on to check the mojo.jar file using the tar tf mojo.jar command.
| Funnily, persistence.xml gets pulled out of the META-INF directory and gets placed in the source (one level higher) directory. Here are the results of the command:
|
| | META-INF/
| | META-INF/MANIFEST.MF
| | Client.class
| | User.class
| | UserRegistrationRemote.class
| | UserRegistrationSessionBean.class
| | persistence.xml
| |
|
| That doesn't seem right to me. So my questions are: Is my mojo.jar correct? If not, what am I doing wrong?
|
| I don't know if this will solve the original messages in the server log. But, we will work on it gradually.
|
| Thank you for your patience in reading my extra long posts. But from my own experience in other forums, I also know that the best way for getting help is to include as much relevant information as possible. :)
|
| Thanks, Rij
|
| ----
| P.S: Peter, thanks for the note on packages. I will get into packages eventually. For now, I am just trying to get a hold on how to put the pieces together to get a EJB app running.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4217135#4217135
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4217135
17 years, 1 month