Thursday, December 10, 2009

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener


If you're using Eclipse and Maven, then the problem is with one particular project settings option:
project properties -> Java EE Module Dependencies -> Maven Dependencies
the last option must be checked (which isn't by default).

Monday, July 21, 2008

Wicket WebMarkupContainer

In Wicket, the WebMarkupContainer is being used quite often. One small thing about the visibility when using it.
When you need to make the initial state invisible and then later on visible (via ajax), the component would not be visible unless its setOutputMarkupPlaceholderTag is true.

Container.setVisible(false);
Container.setOutputMarkupPlaceholderTag(true);
add(Container);

This is due to the fact that components when setVisible(false) do not get any tags in output markup at all in wicket.
The dev team's interesting discussion is here.

Monday, June 2, 2008

Installation of SAP JCo on an Oracle IAS 10.1.3.x on Linux

Great instruction for deploying sapjco in oc4j...

Installation
of SAP JCo on an Oracle IAS 10.1.3.x on Linux


1) Unpack sapjco to /opt/SAP/SAPJCo.


2) Create the following symbolic links in $ORACLE_HOME/lib


oracle@lachesis:~> ln -sf /opt/SAP/SAPJCo/librfccm.so $ORACLE_HOME/lib/librfccm.so
oracle@lachesis:~> ln -sf /opt/SAP/SAPJCo/libsapjcorfc.so $ORACLE_HOME/lib/libsapjcorfc.so

3) Create an additional OC4J instance to host SAP enabled Java apps.
oracle@lachesis:~> createinstance -instanceName OC4J_SAP
Creating OC4J instance "OC4J_SAP"...
Set OC4J administrator's password for "OC4J_SAP" (password text will not be displayed as it is entered)
Enter password:
Confirm password:
The password for OC4J administrator "oc4jadmin" has been set.
New OC4J instance "OC4J_SAP" has been created.
oracle@lachesis:~>

4) Navigate to the instance home page. Click on the administration tab
and select the Shared libraries

5) Click on the Create button at the bottom of the page.


5.1) On the Create shared library attributes page enter SAPJCo for
the
library name and the corresponding SAPJCo version (eg 2.1.6) for the
version. Click next


5.2) The following page is entitled “Create
Shared Library: Add Archives
”. Click on the Add button and
insert the /opt/SAP/SAPJCo/sapjco.jar file. Click next


5.3) The final step is the page entitled “Create Shared Library: Import Shared
Libraries
”. You do not need any adjustments here. Just click
finish.


... and that does it.

Tuesday, May 13, 2008

Oracle database links using full TNS entries

Oracle
database links using full TNS entries


Database links can be most useful, say you want to extract data to a
reporting system or something like that. This is a quite common
scenario people have problems with and come to the Oracle support IRC
channel and ask about, especially developer with just a user account on
the remote database and plain user account in the target database. They
want to create a database link but don't have access to tnsnames.ora
file at the OS level on the server, they may not even have SSH access
to the server.

No problem, you can use the full TNS entry pretty much everywhere you
can use the TNS alias, just remember to single quote it.



Database link example:


[hlinden@whale dblink]$ rsqlplus /

SQL*Plus: Release 9.2.0.4.0 - Production on Wed Nov 29 11:17:26 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

SQL> select db_link from user_db_links;

no rows selected

SQL> CREATE DATABASE LINK prodsyslink
CONNECT TO ro_user IDENTIFIED BY ro_user_pass USING
'(DESCRIPTION=(ADDRESS_LIST=(
ADDRESS=(PROTOCOL=TCP)(HOST=prodserver)(PORT=1521)))
(CONNECT_DATA=(SERVICE_NAME=prod_db)))'
/

Database link created.

SQL> select db_link from user_db_links;

DB_LINK
------------------------------
PRODSYSLINK

SQL> select * from t@prodsyslink;

A B
---------- ----------
1 2
2 1

SQL>

Cool, now it's possible to create a nice materialized view or whatever
is needed.



Oracle docs about CREATE
DATABASE LINK
.

Monday, April 21, 2008

When encounter this message in Eclipse trying to start OC4J 10.

(SEVERE) Failed to set the internal configuration of the OC4J JMS Server with:
XMLJMSServerConfig[file:/C:/oc4j_1013/j2ee/home/config/jms.xml]
Error starting JMS-Server...


Just goto the OC4J_HOME\j2ee\home\persistence , and delete everything there. It should clear things up.

Thursday, April 17, 2008

deployment in OC4J

To deploy the wicket-spring-ibatis webapp in OC4J, need to disable some builtin libarary

<?xml version="1.0"?><orion-application  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-application-10_0.xsd"  deployment-version="10.1.3.1.0" default-data-source="jdbc/OracleDS" component-classification="external"

  schema-major-version="10" schema-minor-version="0" >

      <web-module id="bcook" path="bcook.war" />

      <persistence path="persistence" />

      <imported-shared-libraries>

            <remove-inherited name="adf.oracle.domain"/>

            <remove-inherited name="oracle.jdbc"/>

            <remove-inherited name="oracle.persistence"/>

            <remove-inherited name="oracle.sqlj"/>

            <remove-inherited name="oracle.toplink"/>

      </imported-shared-libraries>

      <principals path="principals.xml" />

      <jazn provider="XML" />
      <log>

            <file path="application.log" />

      </log>

</orion-application>

Friday, February 8, 2008

A brand new project to test the limit.

First, just reminding myself. Creating source and javadoc jar for wicket w/ maven is mvn source:jar && mvn javadoc:jar
Never like the fact that mvn cannot list all available options/lifecycle/goals for users. A commandline tool needs to list all options for users, thats just that.