Recent Notes

Displaying keyword search results 101 - 110
Created by Dr. Xi on January 07, 2010 22:56:20    Last update: March 22, 2010 01:52:48
If the error reads: java.lang.LinkageError: Class javax/xml/rpc/encodi... then the class javax.xml.rpc.encoding.TypeMappingRegistry is loaded by two or more different class loaders, and the versions are not compatible. For example, one might be under WEB-INF/lib, another might be loaded through an EJB. The solution is to get rid of the duplicate versions .
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 Fang on September 19, 2009 21:16:52    Last update: March 02, 2010 05:13:04
Before you can build a Java EE project with Maven, you need to add the Java EE dependencies. And you need to tell Maven where to find the repositories for the Java EE artifacts. For JDK 5 & Java EE 5: ~/.m2/settings.xml : <?xml version="1.0" encoding="UTF-8"?> <setting... pom.xml : <dependencies> <dependency> <group... For JDK 6 & Java EE 6: ~/.m2/settings.xml : <?xml version="1.0" encoding="UTF-8"?> <setting... pom.xml : <dependencies> <dependency> <group...
Created by Dr. Xi on February 10, 2010 23:39:37    Last update: February 10, 2010 23:39:37
Example web.xml that includes most frequently used elements. This sample is for Servlet Specification 2.4. <?xml version="1.0" encoding="UTF-8"?> <web-ap...
Created by woolf on January 15, 2010 05:00:14    Last update: January 15, 2010 05:03:49
Video taken with the Canon SD1200 camera comes in the AVI format, where the video is MJPEG and the audio is PCM. For some weird reason it doesn't play on my Windows XP box! The video is sluggish and the audio is often interrupted. But it works fine on my old Windows 2000 box. Since it's taking too much space anyway, I used mencoder to compress the video with XVID encoding and audio with MP3. This is the script. #!/usr/bin/perl $destdir = "C:/Documents and Se... Tools used: Mencoder: http://www.mplayerhq.hu/ Mediainfo: http://mediainfo.sourceforge.net
Created by Fang on August 13, 2009 02:59:06    Last update: January 09, 2010 23:36:44
Maven requires JAVA_HOME to be set but the setting is tricky. It doesn't like a PATH inside quotes with a space in it. C:\>@rem quotes and space doesn't work C:\>set ...
Created by Fang on September 07, 2009 16:39:37    Last update: September 07, 2009 18:43:04
It's easiest to use the archetype plugin to start a new Maven project. I'll use struts 1 as example since it's not in the built-in archetypes for archetype:generate . Generate a simple webapp with archetype:generate : C:\work\maven>mvn archetype:generate -DarchetypeAr... It generates a directory structure like this: struts1app struts1app/pom.xml struts1app/src... with a simple POM: <project xmlns="http://maven.apache.org/POM/4.0.0"... Create settings.xml in $HOME/.m2 , add Java.net repository for Java EE dependencies: <?xml version="1.0" encoding="UTF-8"?> <setting... Add Java EE and Struts dependencies in pom.xml . Note that the Java EE dependency has scope provided , meaning that the web app container provides the jars, therefore we don't need to bundle them with our war fie. <project xmlns="http://maven.apache.org/POM/4.0.0"... Create a directory named java under main , create the Struts form and...
Created by Dr. Xi on April 30, 2009 23:26:13    Last update: May 01, 2009 17:08:49
ApplicationResources.properties contains these keys: test.key.1 = Test Key One test.key.2 = Test Key... Struts (struts-el): <%@ page contentType="text/html;charset=UTF-8" lan... JSTL <%@ page contentType="text/html;charset=UTF-8" lan... However, the values for one and two must be passed in from pageScope , requestScope , sessionScope , etc. Values defined by struts bean:define are not interpreted. Important: JSTL tags work with servlet spec 2.4 only. So your web.xml must start with this: <?xml version = '1.0' encoding = 'windows-1252'?> ... Not this: <?xml version = '1.0' encoding = 'windows-1252'?> ... However, the latter does work with struts-el tags.
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 March 08, 2009 21:35:25    Last update: March 08, 2009 21:35:25
This tip is from http://developers.sun.com/global/technology/standards/reference/faqs/determining-file-encoding.html , which also suggested Solaris's auto_ef utility. Open the file in Mozilla Firefox Make sure the file is displayed properly Look at Character Encoding from the View menu.
Previous  3 4 5 6 7 8 9 10 11 12 Next