> +------------------------+
> Jasypt Users List
>
http://www.jasypt.org
> +------------------------+
>
> My Application Context :
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
> "
http://www.springframework.org/dtd/spring-beans-2.0.dtd">
>
> <!--
> - Application context definition for PetClinic on Hibernate.
> -->
> <beans>
>
>
> <!-- ========================= RESOURCE DEFINITIONS
> ========================= -->
>
>
> <!-- Configurer that replaces ${...} placeholders with values from a
> properties file -->
>
> <!-- (in this case, JDBC-related settings for the dataSource definition
> below) -->
> <!-- The EncryptablePropertyPlaceholderConfigurer will read the
> -->
> <!-- .properties files and make their values accessible as ${var}
> -->
> <!--
> -->
> <!-- Our "configurationEncryptor" bean (which implements
> -->
> <!-- org.jasypt.encryption.StringEncryptor) is set as a constructor arg.
> -->
> <!--
> -->
> <bean id="propertyConfigurer"
>
> class="org.jasypt.spring.properties.EncryptablePropertyPlaceholderConfigurer">
> <constructor-arg ref="configurationEncryptor"/>
> <property name="location" value="/jdbc.properties"/>
> </bean>
>
>
> <!-- Configuration for encryptor, based on environment variables.
> -->
> <!-- In this example, the encryption password will be read from an
> -->
> <!-- environment variable called "APP_ENCRYPTION_PASSWORD" which, once
> -->
> <!-- the application has been started, could be safely unset.
> -->
> <bean id="environmentVariablesConfiguration"
> class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig">
> <!--property name="algorithm" value="PBEWithMD5AndDES"/-->
> <!-- password value is the used to decrypt the encrypt password-->
> <property name="password" value="fluensee"/>
> </bean>
>
>
> <!-- The will be the encryptor used for decrypting configuration values.
> -->
> <bean id="configurationEncryptor"
> class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
> <property name="config" ref="environmentVariablesConfiguration"/>
> </bean>
>
> <!-- Local DataSource that works in any environment -->
> <!-- Note that DriverManagerDataSource does not pool; it is not intended
> for production -->
> <!-- See JPetStore for an example of using Commons DBCP BasicDataSource as
> alternative -->
> <!-- See Image Database for an example of using C3P0 ComboPooledDataSource
> as alternative -->
> <bean id="dataSource"
> class="org.springframework.jdbc.datasource.DriverManagerDataSource">
> <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
> <property name="url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
> <property name="username" value="system"/>
> <property name="password" value="${jdbc.password}"/>
> </bean>
>
> <!-- Hibernate SessionFactory -->
> <bean id="sessionFactory"
> class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
> <property name="dataSource" ref="dataSource"/>
> <property name="mappingResources">
> <list>
> <value>/com/fluensee/assetmgmt/data/oracle/AlertInfo.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/AlertResolution.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/Appointment.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/AssetClass.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/AssetFilter.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/Assignee.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/CalendarDefault.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/CalendarMaintenance.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/CalendarMaintenanceTime.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/CalendarTimestamp.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/EmailConfig.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/EquipmentProcessingInfo.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/Event.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/Favorite.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/IdentifiableEntityValuesObject.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/Identifier.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/IdentifierType.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/Inventory.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/InventoryAuditLog.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/ItemAssignee.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/ItemCategory.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/ItemEquipmentProcessing.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/ItemGroupMaster.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/ItemGroupPart.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/ItemHistoryEventLog.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/ItemLoadPo.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/ItemLocation.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/ItemMaster.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/ItemMasterIdentifier.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/ItemOwnership.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/ItemProject.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/ItemState.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/ItemType.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/LoadMaster.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/LoadPoRelationship.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/Location.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/LocationLevel.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/LocationState.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/LocationType.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/LocationValidationErrorLog.hbm.xml</value>
>
>
> <!--value>classpath:/com.fluensee/assetmgmt/activityplan/data/LocationMilestone.class</value-->
> <value>/com/fluensee/assetmgmt/data/oracle/Maintenance.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/MaintenanceType.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/MetaData.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/MetaInfo.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/MoveTask.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/activityplan/data/oracle/Milestone.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/OrderType.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/Organization.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/Person.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/activityplan/data/oracle/Plan.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/PoMaster.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/Printer.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/ProductImage.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/ProductInstallations.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/ProductMaster.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/ReferenceMaster.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/RfidValidationErrorLog.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/ShippingOrderHeader.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/ShippingOrderItemDetail.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/ShippingOrderProductDetail.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/SubscriptionClass.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/SubscriptionData.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/SubscriptionResolution.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/SubscriptionRole.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/SubscriptionUser.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/Ticket.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/TicketItem.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/TicketItemCharge.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/TicketItemChargeType.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/TicketItemCondition.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/TicketItemConditionType.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/TicketItemConditionTypeValue.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/TicketItemConditionValue.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/TicketType.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/UomType.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/UploadHeader.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/UploadHeaderMessage.hbm.xml</value>
> <value>/com/fluensee/assetmgmt/data/oracle/UploadLine.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/UploadLineMessage.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/UtilizationType.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/WorkFlowMonitor.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/data/oracle/WorkFlowMonitorPlan.hbm.xml</value>
>
> <value>/com/fluensee/assetmgmt/inventory/group/oracle/ItemGroup.hbm.xml</value>
> <!-- Enable Project HBM Files-->
>
> <value>/com/fluensee/enable/data/oracle/Role.hbm.xml</value>
> <value>/com/fluensee/enable/data/oracle/SystemAlertLog.hbm.xml</value>
> <value>/com/fluensee/enable/data/oracle/SystemEventLog.hbm.xml</value>
> <value>/com/fluensee/enable/data/oracle/User.hbm.xml</value>
> <value>/com/fluensee/enable/data/oracle/UserRole.hbm.xml</value>
> <value>/com/fluensee/enable/data/oracle/EventLog.hbm.xml</value>
> <value>/com/fluensee/enable/data/oracle/FlowInfo.hbm.xml</value>
> <value>/com/fluensee/enable/data/oracle/JmsObjectInfo.hbm.xml</value>
>
> </list>
> </property>
> <property name="hibernateProperties">
> <props>
> <prop
> key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
> <prop key="hibernate.show_sql">true</prop>
> <prop key="hibernate.generate_statistics">true</prop>
> </props>
> </property>
> <property name="eventListeners">
> <map>
> <entry key="merge">
> <bean
>
> class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/>
> </entry>
> </map>
> </property>
> </bean>
>
>
> <!-- Transaction manager for a single Hibernate SessionFactory (alternative
> to JTA) -->
> <bean id="transactionManager"
> class="org.springframework.orm.hibernate3.HibernateTransactionManager">
> <property name="sessionFactory" ref="sessionFactory"/>
> </bean>
>
>
> <!-- Transaction manager that delegates to JTA (for a transactional JNDI
> DataSource) -->
> <!--
> <bean id="transactionManager"
> class="org.springframework.transaction.jta.JtaTransactionManager"/>
> -->
>
> <!--
> - Transactional proxy for PetClinic's central data access object.
> -
> - Defines specific transaction attributes with "readOnly" markers,
> - which is an optimization that is particularly valuable with Hibernate
> - (to suppress unnecessary flush attempts for read-only operations).
> -
> - Note that in a real-life app with multiple transaction proxies,
> - you will probably want to use parent and child bean definitions
> - as described in the manual, to reduce duplication.
> -->
> <!--bean id="clinic"
> class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
> <property name="transactionManager" ref="transactionManager"/>
> <property name="target" ref="clinicTarget"/>
> <property name="transactionAttributes">
> <props>
> <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
> <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
> <prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
> <prop key="store*">PROPAGATION_REQUIRED</prop>
> </props>
> </property>
> </bean-->
>
> <!-- Hibernate 3.0's JMX statistics service -->
> <!-- Implements the StatisticsServiceMBean management interface -->
> <!--bean name="petclinic:type=HibernateStatistics"
> class="org.hibernate.jmx.StatisticsService">
> <property name="sessionFactory" ref="sessionFactory"/>
> </bean-->
>
>
> <!-- ========================= JMX EXPORTER DEFINITION
> ========================= -->
>
> <!--
> - Exporter that exposes Hibernate 3.0's statistics service via JMX.
> - Autodetects the statistics service, which is a standard MBean,
> - using its bean name as JMX object name.
> -
> - By default, the standard MBeanServerFactory.findMBeanServer method will
> be used
> - to determine the MBeanServer. Unfortunately, this does not work on
> WebLogic <= 8.1:
> - you need to comment in the WebLogicMBeanServerFactoryBean definition on
> WebLogic,
> - specifying appropriate configuration values there.
> -->
> <bean id="jmxExporter"
> class="org.springframework.jmx.export.MBeanExporter">
> <property name="autodetect" value="true"/>
>
> <!-- Comment the following in on WebLogic <= 8.1, which doesn't support
> -->
>
> <!-- the standard MBeanServerFactory.findMBeanServer lookup mechanism. -->
> <!--
> <property name="server">
> <bean
> class="org.springframework.jmx.support.WebLogicJndiMBeanServerFactoryBean"/>
> </property>
> -->
> </bean>
>
> </beans>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
> "
http://www.springframework.org/dtd/spring-beans-2.0.dtd">
>
> <!--
> - Application context definition for PetClinic on Hibernate.
> -->
> <beans>
>
>
> <!-- ========================= RESOURCE DEFINITIONS
> ========================= -->
>
>
> <!-- Configurer that replaces ${...} placeholders with values from a
> properties file -->
>
> <!-- (in this case, JDBC-related settings for the dataSource definition
> below) -->
> <!-- The EncryptablePropertyPlaceholderConfigurer will read the
> -->
> <!-- .properties files and make their values accessible as ${var}
> -->
> <!--
> -->
> <!-- Our "configurationEncryptor" bean (which implements
> -->
> <!-- org.jasypt.encryption.StringEncryptor) is set as a constructor arg.
> -->
> <!--
> -->
> <bean id="propertyConfigurer"
>
> class="org.jasypt.spring.properties.EncryptablePropertyPlaceholderConfigurer">
> <constructor-arg ref="configurationEncryptor"/>
> <property name="location" value="/jdbc.properties"/>
> </bean>
>
>
> <!-- Configuration for encryptor, based on environment variables.
> -->
> <!-- In this example, the encryption password will be read from an
> -->
> <!-- environment variable called "APP_ENCRYPTION_PASSWORD" which, once
> -->
> <!-- the application has been started, could be safely unset.
> -->
> <bean id="environmentVariablesConfiguration"
> class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig">
> <!--property name="algorithm" value="PBEWithMD5AndDES"/-->
> <!-- password value is the used to decrypt the encrypt password-->
> <property name="password" value="key"/>
> </bean>
>
>
> <!-- The will be the encryptor used for decrypting configuration values.
> -->
> <bean id="configurationEncryptor"
> class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
> <property name="config" ref="environmentVariablesConfiguration"/>
> </bean>
>
> <!-- Local DataSource that works in any environment -->
> <!-- Note that DriverManagerDataSource does not pool; it is not intended
> for production -->
> <!-- See JPetStore for an example of using Commons DBCP BasicDataSource as
> alternative -->
> <!-- See Image Database for an example of using C3P0 ComboPooledDataSource
> as alternative -->
> <bean id="dataSource"
> class="org.springframework.jdbc.datasource.DriverManagerDataSource">
> <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
> <property name="url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
> <property name="username" value="system"/>
> <property name="password" value="${jdbc.password}"/>
> </bean>
>
> <!-- Hibernate SessionFactory -->
> <bean id="sessionFactory"
> class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
> <property name="dataSource" ref="dataSource"/>
> <property name="mappingResources">
> <list>
> <value>/com/example/One.hbm.xml</value>
> <value>/com/example/Two.hbm.xml</value>
> <value>/com/example/Three.hbm.xml</value>
>
>
> </list>
> </property>
> <property name="hibernateProperties">
> <props>
> <prop
> key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
> <prop key="hibernate.show_sql">true</prop>
> <prop key="hibernate.generate_statistics">true</prop>
> </props>
> </property>
> <property name="eventListeners">
> <map>
> <entry key="merge">
> <bean
>
> class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/>
> </entry>
> </map>
> </property>
> </bean>
>
>
> <!-- Transaction manager for a single Hibernate SessionFactory (alternative
> to JTA) -->
> <bean id="transactionManager"
> class="org.springframework.orm.hibernate3.HibernateTransactionManager">
> <property name="sessionFactory" ref="sessionFactory"/>
> </bean>
>
>
> <!-- Transaction manager that delegates to JTA (for a transactional JNDI
> DataSource) -->
> <!--
> <bean id="transactionManager"
> class="org.springframework.transaction.jta.JtaTransactionManager"/>
> -->
>
> <!--
> - Transactional proxy for PetClinic's central data access object.
> -
> - Defines specific transaction attributes with "readOnly" markers,
> - which is an optimization that is particularly valuable with Hibernate
> - (to suppress unnecessary flush attempts for read-only operations).
> -
> - Note that in a real-life app with multiple transaction proxies,
> - you will probably want to use parent and child bean definitions
> - as described in the manual, to reduce duplication.
> -->
> <!--bean id="clinic"
> class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
> <property name="transactionManager" ref="transactionManager"/>
> <property name="target" ref="clinicTarget"/>
> <property name="transactionAttributes">
> <props>
> <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
> <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
> <prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
> <prop key="store*">PROPAGATION_REQUIRED</prop>
> </props>
> </property>
> </bean-->
>
> <!-- Hibernate 3.0's JMX statistics service -->
> <!-- Implements the StatisticsServiceMBean management interface -->
> <!--bean name="petclinic:type=HibernateStatistics"
> class="org.hibernate.jmx.StatisticsService">
> <property name="sessionFactory" ref="sessionFactory"/>
> </bean-->
>
>
> <!-- ========================= JMX EXPORTER DEFINITION
> ========================= -->
>
> <!--
> - Exporter that exposes Hibernate 3.0's statistics service via JMX.
> - Autodetects the statistics service, which is a standard MBean,
> - using its bean name as JMX object name.
> -
> - By default, the standard MBeanServerFactory.findMBeanServer method will
> be used
> - to determine the MBeanServer. Unfortunately, this does not work on
> WebLogic <= 8.1:
> - you need to comment in the WebLogicMBeanServerFactoryBean definition on
> WebLogic,
> - specifying appropriate configuration values there.
> -->
> <bean id="jmxExporter"
> class="org.springframework.jmx.export.MBeanExporter">
> <property name="autodetect" value="true"/>
>
> <!-- Comment the following in on WebLogic <= 8.1, which doesn't support
> -->
>
> <!-- the standard MBeanServerFactory.findMBeanServer lookup mechanism. -->
> <!--
> <property name="server">
> <bean
> class="org.springframework.jmx.support.WebLogicJndiMBeanServerFactoryBean"/>
> </property>
> -->
> </bean>
>
> </beans>
>
> Properties File :
>
> # Properties file with JDBC-related settings.
> # Applied by PropertyPlaceholderConfigurer from "applicationContext-*.xml".
> # Targeted at system administrators, to avoid touching the context XML
> files.
>
> jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
> jdbc.url=jdbc:oracle:thin:@localhost:1521:XE
> jdbc.username=system
> jdbc.password=ENC(P+QvnsP6jPOiCnVxhPJnXg==)
>
> My question is i don't want to read password from properties files, instead
> i should hardcode is application context. is their any way to do that.
> <bean id="dataSource"
> class="org.springframework.jdbc.datasource.DriverManagerDataSource">
> <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
> <property name="url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
> <property name="username" value="system"/>
> <property name="password" value="ENC(P+QvnsP6jPOiCnVxhPJnXg==)"/>
> </bean>
>
> Appreciate for any Idea.
>
Register now and save $200. Hurry, offer ends at 11:59 p.m.,
Monday, April 7! Use priority code J8TLD2.