Thursday, September 24, 2009

Eclipse JVM Error

If you get an error when trying to start Eclipse complaining about JVM compatibility, it can be solved by creating a shortcut and following the shortcut with the argument -vm <path to desired jvm>.

A screenshot:

screenshot




This is also available at tmoodini.com

Sunday, August 9, 2009

Quick and Simple Web Forms With Google Docs


If you need a form, particularly one that saves data into a spreadsheet, Forms in Google Docs is worth looking into. Simple and quick, it allows you to create forms for storing spreadsheet data like addresses, quiz answers, or create a simple guestbook.



The link to the form is available on the creation page, there is an email option, or you can embed it in a page of your choosing.  It does have some simple themes for sprucing up the form and multiple options for input.  If the form is new, Google Docs will add a spreadsheet for you.



You can't retrieve the information through a form, so users can't edit previously submitted responses without access to the form.  You can't control access to the form itself as far as I can see so one thing to consider is avoiding abuse if it is forwarded to the wrong people.  One simple workaround to filter the unwanted responses might be to include a code in your email or link.  When the users enter this code in form it will go into a column in the spreadsheet.  The spreadsheet can be sorted by this column and then entries with incorrect or missing responses can be deleted. 



To create a form in Google Docs simply click New->Form.



A simple form and the spreadsheet created for it.







This tutorial is also available at http://tmoodini.com/tutorials/googledocsforms.html

Friday, July 24, 2009

A Good Quick Guide to SQL

I found a good simple and quick guide/reference for those learning SQL.

SQL Tutorial

Sunday, June 14, 2009

JDeveloper 11g and JSF on Tomcat


This tutorial demonstrates a method for creating a .war file including JSF pages
in JDeveloper 11g. This is also available at: http://tmoodini.com/tutorials/jdevtomcatjsf.htm.



There are a few ways to deploy web applications to Tomcat from JDeveloper 11g. 
If your Tomcat installation resides on a separate machine from your JDeveloper installation,
one method is to create a .war file and deploy it through the Tomcat manager. 



A big advantage of this method is that it bundles all of the necessary .jars for
things like JSF pages in your .war file if properly included in the Libraries of
your project, not to mention portability. 



Go to File ->New->Applications->Java EE Web Application









Follow the wizard and set it up to your liking.  On step 2 of the wizard be
sure that HTML, Java, JSF, JSP and Servlets
are in the "Selected" box of the Project Technologies tab:










In the project explorer on the left right click on the Web Content folder and choose
"New".


In the menu that appears select JSF and JSF Page:









Name the new file helloworld.jsp and click ok:







Open the code for helloworld.jsp and put the following between the body tags:


<h:outputtext value="Hello JSF World!"> 







Now we will make sure the correct libraries are imported.



Go to Tools->Project Properites->Libraries and Classpath and click "Add JAR/Directory".



Add the following .jars:





  • jsf-api.jar (By default in the 11g installation it is in the jdeveloper\jsf-ri folder)

  • jsf-impl.jar (By default in the 11g installation it is in the jdeveloper\jsf-ri
    folder)

  • jstl.jar  (By default in the 11g installation it is in the jdeveloper\modules\jakarta.jstl_1.1\lib
    folder)  

  • standard.jar (By default in the 11g installation it is in the jdeveloper\modules\jakarta.jstl_1.1\lib
    folder)  

  • org.apache.commons.beanutils_1.6.jar (By default in the 11g installation it is in
    the jdeveloper\modules folder)  

  • org.apache.commons.collections_3.1.jar (By default in the 11g installation it is
    in the jdeveloper\modules folder)  

  • org.apache.commons.digester_1.7.jar (By default in the 11g installation it is in
    the jdeveloper\modules folder)  

  • org.apache.commons.logging_1.0.4.jar (By default in the 11g installation it is in
    the jdeveloper\modules folder)  







Now we need to create a deployment profile.



From the menu select Build->Deploy->New Deployment Profile.  In the menu
select WAR File.



Name the file testjsf and click "OK".



On the next screen use the default settings and click OK.



On project properties be sure to check under Compiler to make sure your version
compatibility (e.g. 1.5 or 1.6) is set appropriately for your Tomcat deployment.



Now we need to make a slight change to our web.xml file. 




Click the web.xml file in the explorer and then open its source.  You can do
this through the interface provided by JDeveloper if you prefer.



Change the section that looks like this:



<servlet-mapping>
 


<servlet-name>
Faces Servlet
</servlet-name> 

<url-pattern>/faces/* </url-pattern>

</servlet-mapping>



To this:



</servlet-mapping>  


</servlet-name> Faces Servlet </servlet-name>

<url-pattern>*.jsf</url-pattern>

</servlet-mapping>



Now right click on your project folder and select "Deploy". 



Select your deployment profile (should be testjsf in this case) and "to WAR" file.



We are ready to upload to Tomcat.



Log into your Tomcat Manager application and under WAR File to Deploy click browse
and select the newly created testjsf.war and then click deploy.



Once deployment is finished you should be able to view your page at http://<yourtomcatinfo>/testjsf/helloworld.jsf.

Thursday, January 1, 2009

Oracle 11g Installation Gotcha

When I was installing 11g today from the download I continued to get "Permission Denied" when trying to execute runInstaller.

I fixed it by changing the permissions on 3 files:

chmod u+x /mount_point/database/runInstaller
chmod u+x /mount_point/database/install/.oui
chmod u+x /mount_point/database/install/unzip