Wednesday, April 23, 2014

"oracle.jdbc.pool.OracleConnectionPoolDataSource" could not be found

Error below, can happen due to multiple reasons on server start, if it can't locate the Oracle JDBC driver. please find below some of the resolution steps that may help debug.

J2CA0036E: An exception occurred while invoking method setDataSourceProperties on com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl used by resource jdbc/WebSphere Commerce Oracle DataSource demo : com.ibm.ws.exception.WsException: DSRA0023E: The DataSource implementation class "oracle.jdbc.pool.OracleConnectionPoolDataSource" could not be found.
    at java.net.URLClassLoader.findClass(URLClassLoader.java:423)
    at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:191)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:660)
    at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:111)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:626)


Resolution:
ToolkitModuleConfig.xml -->Update XML to point to correct toolkit location.
Close toolkit
Run setDBType          (For Oracle 11g Oracle home:: Oracle\product\11.2.0\client_1)
Which updates wc-server.xml and variables.xml for oracle home.
Right click on server and click clean.

In wc-server.xml
Also make sure the JDBCDriverLocation is correctly pointing to the JDBC driver location.
<Websphere
            DatasourceName="WebSphere Commerce Oracle DataSource demo"
            HelpServerHostName="localhost" HelpServerPort="8001"
            JDBCDriverLocation="C:\IBM\Oracle\product\11.2.0\client_1\jdbc\lib\ojdbc6.jar"
            JDBCDriverType="native" WASProfileName=""
            appUpdateTimeout="1800000" applicationName="WC" port="900"> 




Monday, April 7, 2014

Encryption key based algorithms in Commerce | Error Invalid Key Size

I have encountered this since older versions of commerce, all the way to V7 and this could happen with any type of key based encrypted algorithms. In this scenario, I was testing AESCipher using AES encryption but can happen working on multiple algorithms with larger key size.

This error is caused by restrictions in some countries with key size and hence the default Java spec does not provide unlimited key strength as a default configuration and it requires the policy jars to be updated.

Back up the following files from C:\IBM\SDP\runtimes\base_v7\java\jre\lib\security and get the latest files for IBM JDK and replace with these existing files and restart. Do not get these files below from Oracle.com as IBM uses it's own SDK.

US_export_policy.jar
local_policy.jar
Steps to download the IBM JDK security files:
http://pic.dhe.ibm.com/infocenter/asehelp/v8r8m0/topic/com.ibm.ase.help.doc/topics/t_update_java_sdk_policy_files.html

This step would be required on all the server environments similarly to update the policy files.

Thursday, April 3, 2014

Freaky toolkit | Error | Loose archive URI

When adding a new custom payment plugin project or any new EJB project.  One of the options that is selected is added project to EAR (WC) and one of the configurations is to add the Module dependency in WC project. From my experience, it is important to generate a localized version of new module in the file and then perform WC publish.

  W org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategyImpl collectFilesFromLooseArchives Archive URI [ C:\IBM\WCDE_ENT70\workspace\WC ]: Loose archive URI [ CustomPaymentPlugin.jar ] Loose Archive [ org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.impl.LooseLibraryImpl@4b1e4b1e (uri: CustomPaymentPlugin.jar, binariesPath: C:\IBM\WCDE_ENT70\workspace\CustomPaymentPlugin\ejbModule, resourcesPath: C:\IBM\WCDE_ENT70\workspace\CustomPaymentPlugin\ejbModule) ]: Already mapped to [ com.ibm.etools.commonarchive.impl.EJBJarFileImpl@ef70ef7 (URI: CustomPaymentPlugin.jar, lastModified: 0, size: 0, directoryEntry: , originalURI: CustomPaymentPlugin.jar) (types: null) ]

C:\WCDE_ENT70\workspace\WebSphereCommerceServerExtensionsData\.settings\org.eclipse.wst.common.component

e.g.
        <dependent-module archiveName="CustomPaymentPlugin.jar" deploy-path="/" handle="module:/resource/CustomPaymentPlugin/CustomPaymentPlugin">
            <dependent-object>Module_1395371978911</dependent-object>
            <dependency-type>uses</dependency-type>
        </dependent-module>




As a practice if org.eclipse.wst.common.component is getting checked into repository by developers.
Some times it may break your sever start with the above error and for the developer who works on the module, it may work as the module number is a generated on a local toolkit but for others, they need to go into the above dialog by WC-->right click->properties and goto Java EE module dependencies and uncheck and click ok and go back in there and check the corresponding module and click ok so the localized version is generated and publish WC project