---------------- getcode.sql ------------------------------- prompt Exporting User code.... set feedback off set heading off set termout off set linesize 3000 set trimspool on set verify off prompt set define off spool c:\policecode.sql select text from ( select a.name, a.type, a.line, decode(line,1,'create or replace ', '' ) || text as text from user_source a union select a.name, a.type, 9000000000 as line, '/' from user_source a order by name,type, line); spool off prompt set define on set feedback on set heading on set termout on set linesize 100 -----------------------------------------------------
various observations, solutions and frustrations on programming java and .net.
Thursday, April 14, 2011
Script to export all pl/code in an oracle database
Friday, December 17, 2010
Installing SSL certificates on GlassFish
Scenario:
Java EE programs run on a GlassFish server and exchange web service messages with remote servers using SSL.
The remote servers' SSL certificates must be imported to the glass fish server trusted certificate store.
- Use any browser to save the SSL certicate to personal certificates store.
- Run mmc and add certificates snapin (File/Add Remove Snapin) .
- View certificate saved in step 1 and export to a file, for example c:\GlassFish_Server_3\glassfish\domains\domain1\config\webservice1.cer
- Import to glassfish trusted domain cacerts. Example code below:
cd c:\GlassFish_Server_3\glassfish\domains\domain1\config "c:\Java\jdk1.6.0_21\bin\keytool" -delete -trustcacerts -alias register_webservice_1 -keystore cacerts.jks "c:\Java\jdk1.6.0_21\bin\keytool" -import -trustcacerts -alias register_webservice_1 -file server.cer -keystore cacerts.jks
Keystore password is "changeit", no quotes - Modify DNS or hosts file to map the common name in SSL certificate to the ip address
Monday, October 18, 2010
Registering for the "Oracle Certified Master, Java EE 5 Enterprise Architect"
First of all, I do not like this name. "Master" sounds too serious. Anyway, information on the exams on the oracle site is here:
- http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=326
- After that you will want to go register for step 1 of the exam . Oracle says that the cost is $300, ( 277 euros )
Thursday, July 1, 2010
A JSP limitation: You can't share JSP files between web applications
This one has been a real frustration of mine: Say you have a couple of Java Servlet/JSP web applications. Each of these applications shares common jsp files. For example, a login.jsp page, header.jsp and footer.jsp, etc. There is no "easy" way to package these common jsps into a jar and have each web application share these jsps.
There are a couple of workarounds:
There are a couple of workarounds:
- Manually convert the jsp into a servlet. This one is a hard one, and it results into a lot of request.getWriter().print() statements into your servlet.
- Pre-compile the jsp into a servlet, and then package the servlet into a jar. Then map the servlet into the web.xml file.
Tuesday, June 29, 2010
Adding a pre-comit hook to simulate "global ignores" at visual svn server
This one is one of the few (but kinda big) problems we are having with Subversion: The inability to set global, server side ignores. Unless all developers remember to add the usual java *.class, classes etc (or .dll, .exe, .suo, etc for .net) from their SVN client, then you end up with all kinds of unwanted files in your svn repository.
Step 1:
We entered all ignored file extensions and file names in a file called ignoreFiles.txt, and all ignored folders in file ignoreFolders.txt. The entries are one per line.
Step 3:
Access your SVN Server, right click on the repository name, and choose Propetrties. From the properties page, choose "Hooks", then Pre-commit hook, edit and copy/paste the following pre comit trigger.
Then click OK, and you are done. To test this, SVN-Checkout a test directory, create a couple of "illegal" files and folders and then try to commit. You should get an error message.
So here's the setup: Visual SVN Server on Windows Server 2003, development using jdeveloper 10.1.2 (our customers are yet to upgade their OAS) on Windows 7 and Tortoise SVN clients.
And here's what we did:Step 1:
We entered all ignored file extensions and file names in a file called ignoreFiles.txt, and all ignored folders in file ignoreFolders.txt. The entries are one per line.
Step 2:
Developed a vb script that opens these 2 files and compares them agains all added files and folders in the current svn transation. The vbscript is hereStep 3:
Access your SVN Server, right click on the repository name, and choose Propetrties. From the properties page, choose "Hooks", then Pre-commit hook, edit and copy/paste the following pre comit trigger.
Then click OK, and you are done. To test this, SVN-Checkout a test directory, create a couple of "illegal" files and folders and then try to commit. You should get an error message.
Monday, June 28, 2010
How to run the latest ANT with jdeveloper 10.1.2.3
- Download latest ANT from ant.apache.org web site and unzip it in directory
\jdev\lib\apache-ant- -bin.
So if your jdev dir is at C:\jdev10.1.2.3\jdev\lib, then and you downloaded ant 1.8.1, then you will have c:\jdev10.1.2.3\jdev\lib\apache-ant-1.8.1-bin - Edit
\jdev\bin\jdev.conf and comment line that loads ant.jar and load the new ant jar you downloaded. Example below:
#AddJavaLibFile ../lib/ant.jar AddJavaLibFile ../lib/apache-ant-1.8.1-bin/lib/ant.jar
- Open file
\jdev\lib\libraries.xml and change library "Apache Ant" to include jars in the new ant jar you downloaded. Example below:
<item class="oracle.jdeveloper.library.JLibrary"> <defaultlibrarydefinition> <jdkversion> <classpath> <entries> <item jar-entry="" path="apache-ant-1.8.1-bin\lib\ant.jar"/> <item jar-entry="" path="apache-ant-1.8.1-bin\lib\ant-launcher.jar/"> <item jar-entry="" path="apache-ant-1.8.1-bin\lib\ant-commons-net.jar/"> <item jar-entry="" path="apache-ant-1.8.1-bin\lib\ant-jsch.jar/"> <item jar-entry="" path="apache-ant-1.8.1-bin\lib\com.jcraft.jsch_0.1.31.jar"/> </entries> </classpath> <docpath> <entries class="[Ljava.net.URL;"> </docpath> <locked>false</locked> <sourcepath> <entries class="[Ljava.net.URL;"> </sourcepath> </defaultlibrarydefinition> <definitionlist class="java.util.ArrayList"> <locked>true</locked> <name>Apache Ant</name> </item>
Changing the java version on an OC4J instance
We are working with Oracle Application Server 10.1.2, which ships with java 1.4. This is getting a little old and outdated. The customer does not plan on updating any time soon (if it ain't broke don't fix it) . The developers of my team want to write java 1.6 ! So how do you change the java version that runs an OC4J instance? Here's the scoop:
- Install the latest jdk or jre on your Oracle Application Server machine.
- Access the OAS web based Application Server Control and click on the OC4J instance you want to change.
- Click on Server Properties and scroll down to "Command Line Options'" and enter in the "Java Executable" field the path to the java installation.
- Open the application.xml file under the config directory of your OC4J instance (use vi if on UNIX, notepad if on windows) and add the library directory of the new java jdk/jre instalation under the libary path entries:
Example:
<library path="/usr/java/jre1.6.0_16/lib">
Subscribe to:
Posts (Atom)
