Recent Notes
Displaying keyword search results 1 - 11
Created by nogeek on November 27, 2011 12:24:27
Last update: November 27, 2011 12:24:27
There is no XSLT 2.0 support in the JDK as of 7.0. According to Stackoverflow , there are three Java packages that support XSLT 2.0: Saxon IBM WebSphere XML Feature Pack Oracle XDK There are no known support for XSLT in browsers. According to Wikipedia : XSLT is developed by the World Wide Web Consortium (W3C). The most recent version is XSLT 2.0, which reached W3C recommendation status on 23 January 2007. As of 2010, however, XSLT 1.0 is still widely used, as there are no products that support XSLT 2.0 running in the browser, nor on some important server environments such as LAMP. Expressions like this:
format-date(xs:date('1999-12-31'), '[D01] [MNn] ... where format-date is a XSLT 2.0 function and date is a XPath 2.0 constructor...
Created by Fang on September 07, 2009 20:44:15
Last update: November 03, 2011 14:43:19
Step 1: Repackage a web app as EAR A Java EE application is a multimodule Maven project. At the very least you'll need to package a WAR and an EAR. To get started, I'll simply re-package the simple webapp as an EAR. Create a directory named javaee-app Copy the webapp from here to javaee-app . Rename struts1app to webapp . Create pom.xml under javaee-app :
<project> <modelVersion>4.0.0</modelVersion>... Create a directory named ear under javaee-app . Create pom.xml under ear : <project> <modelVersion>4.0.0</modelVersion>... Modify pom.xml in the webapp directory so that it looks like this: <project> <modelVersion>4.0.0</modelVersion> ... Build with " mvn package " in the javaee-app directory. You can see that ear-1.0.ear is successfully generated in javaee-app/ear/target . Maven successfully resolves dependencies between the sub-projects....
Created by Dr. Xi on September 20, 2009 16:52:19
Last update: March 22, 2010 01:28:49
When I assemble a session bean without the proprietary deployment descriptor ( orion-ejb-jar.xml ), OC4J generates one like this (as can be seen from the OC4J management console):
<?xml version="1.0" encoding="utf-8"?>
<ori...
So I use this code to lookup the EJB:
import javax.naming.Context;
import javax.namin...
OC4J throws ClassCastException :
java.lang.ClassCastException: com.evermind[Oracle ...
The JNDI browser (OC4J container home -> Administration -> JNDI browser) shows that the name simpleEjb_SimpleBeanLocal is bound to: com.evermind.server.ejb.StatelessSessionDefaultLocalHomeImpl
Solution:
Change the local name in the OC4J generated orion-ejb-jar.xml to simpleEjb_SimpleBeanLocal2 and put it in the EJB package. Redeploy.
The JNDI browser shows that simpleEjb_SimpleBeanLocal is still bound to com.evermind.server.ejb.StatelessSessionDefaultLocalHomeImpl . But simpleEjb_SimpleBeanLocal2 is bound to the right proxy: SimpleBean_LocalProxy_5f4b5e5 .
Created by Dr. Xi on February 12, 2010 22:39:15
Last update: February 12, 2010 22:39:15
When you start Tomcat for the first time, you may get the "port 8080 is already in use" error. Indeed, port 8080 is commonly used by a lot of development servers by default (Oracle XE for another example). Luckily, it's quite easy to ask Tomcat to use a different port. I use port 8086, which is a natural next step and superior to 8080.
Simply edit $CATALINA_BASE/conf/server.xml and change 8080 to 8086:
<!-- A "Connector" represents an endpoint by w...
If you have not configured Tomcat 6 for multiple instances by setting a CATALINA_BASE directory, then $CATALINA_BASE will be set to the value of $CATALINA_HOME , the directory into which you have installed Tomcat 6.
Created by Dr. Xi on November 06, 2008 20:11:19
Last update: March 13, 2009 21:37:36
To run a web app in Oracle Application Server with precompiled JSPs (therefore, not recompiling a JSP when requested), add the following servlet section to web.xml:
<?xml version="1.0" encoding="iso-8859-1"?>
<we...
Or, uncomment the relevant section in $ORACLE_HOME/j2ee/OC4J_INST/config/global-web-application.xml :
<servlet>
<servlet-name>jsp</servlet-...
Created by Dr. Xi on October 15, 2008 19:49:31
Last update: October 15, 2008 19:49:31
Ant script:
<?xml version="1.0"?>
<project name="OC4JDe...
Deployment properties:
# Deployment properties
targetenv=Development
...
Created by Dr. Xi on May 14, 2008 22:55:22
Last update: May 14, 2008 23:07:49
This procedure works for Oracle application server 10.1.3.1, SOA suite. But should be applicable for standalone OC4J or JDeveloper installations with minor modifications. $ORACLE_HOME is the home directory for Oracle app server. $JDEV_HOME is the home directory for JDeveloper.
1. Change directory to $ORACLE_HOME/j2ee , mkdir lib
2. Copy xmlparserv2.jar from $JDEV_HOME to $ORACLE_HOME/j2ee/lib .
3. Copy ocj.jar and jdev_remote.jar from $JDEV_HOME/jdev/lib to $ORACLE_HOME/j2ee/home/lib .
4. Edit global-web-application.xml under your OC4J instance's config directory. Change the development attribute to true .
<orion-web-app
xmlns:xsi="http://www.w3.org/...
5. Add the following to the servlet section of global-web-application.xml :
<servlet>
<servlet-name>jsp</servlet-na...
6. Edit $ORACLE_HOME/opmn/conf/opmn.xml , add -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4000 to start-parameters/java-options :
<process-type id="MYOC4J" module-id="OC4J" status=...
7. In Eclipse, open to port 4000 for remote debugging.
Created by Dr. Xi on April 07, 2008 22:18:29
Last update: April 07, 2008 22:19:30
Oracle's documentation on how to set up Ant tasks for web services is ambiguous and tedious. Here's a simple Ant file to accomplish that task.
<project name="TEST" basedir="." default="usage" x...
Created by Dr. Xi on August 15, 2007 18:08:34
Last update: November 08, 2007 22:00:01
I had this problem when deploying a J2EE application into Oracle app server. It worked fine with an OC4J container configured in the default group. But it failed to start with an OC4J container I created. Here's a sample stack trace of the initialization exception:
07/08/14 13:32:46.34 10.1.3.3.0 Started 07/08/1... The problem was, the struts ActionServlet loads commons logging LogFactory, the log factory somehow knows that it needs log4j, but it can't load log4j since it's loaded by a different class loader. The solution for Oracle is to omit commons logging from the list of inherited libraries. Add this to META-INF/orion-application.xml solves the problem: <imported-shared-libraries> <remove-inhe... Actually, this is a quite common problem with commons-logging. If you search the web, you'll find that people have...
Created by Dr. Xi on August 16, 2007 18:47:40
Last update: August 16, 2007 18:52:02
If you use quartz or the plain old java.util.Timer class to schedule jobs in an OC4J container, you need to enable the -userThreads switch with the OC4J container. This is the relevant section in $ORACLE_HOME/opmn/conf/opmn.xml :
<process-type id="INST1" module-id="OC4J" status="...
Or, you can add it through the Oracle em console. Go to the OC4J container, click "Administration" tab, then "Server Properties". Add "-userThreads" to "Start-parameters: OC4J Options".
Debu Panda has written a good article on using quartz in the Oracle environment: Using Quartz Enterprise Scheduler in J2EE
Created by Dr. Xi on May 08, 2007 23:09:39
Last update: May 08, 2007 23:13:07
First create a resource provider for Oracle AQ in orion-application.xml:
<?xml version = '1.0' encoding = 'windows-1252...
Then, hook up the EJB to the queue in orion-ejb-jar.xml:
<?xml version = '1.0' encoding = 'windows-1252...
Make sure the resource names ('rsname') match among the xml files.
Full information is available from the Oracle document titled "Oracle Containers for J2EE Enterprise JavaBeans Developer's Guide 10g (10.1.3.1.0)". Look at Appendix A.