Pages

Friday, November 15, 2013

Configure JBoss 5.1.GA server with MySql 5.1 Database as a default datasource


Hi All,

Here I am going to show you the steps to configure JBoss 5.1.GA Application Server with mysql 5.1 Database as a default data source. When you download JBoss Application Server at that time the default database is hsql. So, here are the step to configure mysql database instead of hsql:

1. create database schema in your mysql server. i.e jboss_as

2. Before proceed with mysql configuration, copy mysql jar file to <JBOSS_HOME>\server\default\lib
location.

3. Now, make mysql-ds.xml file and copy following contents in it. But before doing it you need to disable hsql-ds.xml file. Don't delete it. Just change it to hsql-ds.xml.sample by giving it .sample extension.



<?xml version="1.0" encoding="UTF-8"?>
<datasources>
	<local-tx-datasource>
		<jndi-name>DefaultDS</jndi-name>
		<connection-url>jdbc:mysql://localhost:3306/schema_name</connection-url>
		<driver-class>com.mysql.jdbc.Driver</driver-class>
		<user-name>root</user-name>
		<password>XXXXXXX</password>
		<min-pool-size>5</min-pool-size>
		<max-pool-size>20</max-pool-size>
		<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
		<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
		<valid-connection-checker-classname>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-classname>
		<metadata>
			<type-mapping>mySQL</type-mapping>
		</metadata>
	</local-tx-datasource>
</datasources>

4. Now, you also need to add mysql-persistence-service.xml file to <JBOSS_HOME>\server\default\deploy\messaging location. You will find this file at <JBOSS_HOME>\docs\examples\jms location. Just copy this file and paste it in messaging folder. One thing you need to do over here is disable the hsql-persistence-service.xml file by making it hsql-persistence-service.xml.sample

Once you are done with the above steps, just restart the JBoss.
After successful start up, you will see the tables to be created under your defined schema in mysql-ds.xml file.




That's it..!!!!
Happy Coding..!!!

Wednesday, November 13, 2013

Alfresco 4: Map network drive with any alfresco space On Windows 7 or Later

Hi All,

We all know alfresco is a very useful ECM.
It provides support to map alfresco repository as network drive.
But, I found that many developers is facing the problems to map network drive on windows machine.
Here I follow this steps and I am able to connect with alfresco repository with any folder/space.

1)
First step to connect with alfresco repository as a network drive, you need to do entry in your windows host file which resides in (windows\system32\etc\host). Edit this file with following entry and save it:

               <fake IP address>   <computerName><any letter>

              i.e. 13.13.13.13     WorkStationA

2)
Now, open alfresco-global.properties (\Alfresco\tomcat\shared\classes\alfresco-global.properties) and search for the property "protocols.rootPath".

This property is an xPath expression. From alfresco 4.0+, this location is pointing to site space in company home. Now, if you want to map your network drive with your custom space other then site, you need to modify this property.

i.e. 
protocols.rootPath=/${spaces.company_home.childname}/app:user_homes

Here, I have changed my path to "user homes" space. this way you can map any space with network drive in alfresco.

3)
After that, Go To My Computer and then click on Map Network Drive. Choose any drive letter and give folder path as \\WorkStationA\Alfresco\, here WorkStationA is the name which is defined in host file as discussed above in step 1. When you click next, you will be asked for the login credentials. Enter your alfresco login credentials.(Default login credential for admin is username: admin and password: admin).

4)
Now, if everything would be fine, you will find a network drive in My Computer. From here, you can directly do bulk upload of documents in alfresco repository as well as download them.

That's it !!!

I hope this will solve your problem.
Happy Coding !!!