Tuesday, October 4, 2016

Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' for connect URL

Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' for connect URL 'jdbc:oracle:@devserver.ds.com:1570:APPLICATIOND'
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:278)
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1437)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:85)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:113)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870)
at ......

If you happen to get the above error, it could be that the required Oracle jar might not be in Tomcat lib directory.
In the maven dependencies, I see that Oracle-jdbc-11.2.0.1.0.jar and is exporting to the wtpwebapp's application lib directory.
I fixed the issue by copying the ojdbc6.jar file to tomcat's lib directory.
Hope this helps you.

Thursday, July 21, 2016

How to enable Maven dependencies in eclipse

When I created a new maven project, some how I am not finding the Maven dependencies in the project build path add library console.
If the Maven dependencies were not added to the project, it doesnt resolve the third party jars.
If you have faced the same issue, then add the following dependency into your pom file and do a mvn clean install and the update then update the maven project configuration

How to terminate the tomcat server ports that are already in use

Following are the steps to kill the server process that is already in use in windows
Step 1: netstat -a -o -n and it will bring up a network list,search for the local address like 127.0.0.1:6060 and note the PID (eq 18508)
C:\>netstat -a -o -n or C:\>netstat -ano
Step2 : taskkill /F /PID 18508 . Run this command to kill that process.
C:\>taskkill /F /PID 18508

Tuesday, August 5, 2014

SSH login without password

Your aim

You want to use Linux and OpenSSH to automate your tasks. Therefore you need an automatic login from host A / user a to Host B / user b. You don't want to enter any passwords, because you want to call ssh from a within a shell script.

How to do it

First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase:
a@A:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa): 
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A
Now use ssh to create a directory ~/.ssh as user b on B. (The directory may already exist, which is fine):
a@A:~> ssh b@B mkdir -p .ssh
b@B's password: 
Finally append a's new public key to b@B:.ssh/authorized_keys and enter b's password one last time:
a@A:~> cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'
b@B's password: 
From now on you can log into B as b from A as a without password:
a@A:~> ssh b@B
A note from one of our readers: Depending on your version of SSH you might also have to do the following changes:
  • Put the public key in .ssh/authorized_keys2
  • Change the permissions of .ssh to 700
  • Change the permissions of .ssh/authorized_keys2 to 640

Friday, March 21, 2014

ActionListener is called multiple times (Bug?) - dataTable binding

I am using rich dataTable with binding attribute and an actionListener to get selected row

<rich:dataTable width="100%" rows="10" id="dataTableIdentifier" value="#{viewScopedBean.getSomeList}" var="itr" align="center" >

 <h:commandLink action="#{viewScopedBean.editMethod}" id="method_edit" />

</dataTable>

The editMethod is called twice.

Reason why the editMethod called twice is because of binding variable(Strange but true)
This is because my bean is viewScoped, viewScope + binding is not a good combination.
if you really want to use binding then go for Request scope and you are all set.
if your design forces you to use view scope then use setPropertyActionListener instead of binding.

Here there is another problem in using setPropertyActionListener, this can be used only with action method in the commandLink, because your setPropertyLisener should set the required object before you call the CommandLink action. (All the actionListeners will be called before calling action)

Tuesday, November 12, 2013

Error rendering view by parent ViewHandler, try to render as portletbridge JSP page java.lang.StackOverflowError

20:49:25,194 WARN  [PortletViewHandler:257] Error rendering view by parent ViewHandler, try to render as portletbridge JSP page
java.lang.StackOverflowError
        at org.ajax4jsf.component.UIDataAdaptorBase.getBaseClientId(UIDataAdaptorBase.java:743)
        at org.ajax4jsf.component.UIDataAdaptorBase.getClientId(UIDataAdaptorBase.java:698)
        at javax.faces.component.UIComponent.getContainerClientId(UIComponent.java:363)
        at org.ajax4jsf.component.UIDataAdaptorBase.getBaseClientId(UIDataAdaptorBase.java:750)
        at org.ajax4jsf.component.UIDataAdaptorBase.getClientId(UIDataAdaptorBase.java:698)
        at javax.faces.component.UIComponent.getContainerClientId(UIComponent.java:363)
        at org.ajax4jsf.component.UIDataAdaptorBase.getBaseClientId(UIDataAdaptorBase.java:750)
        at org.ajax4jsf.component.UIDataAdaptorBase.getClientId(UIDataAdaptorBase.java:698)
        at javax.faces.component.UIComponent.getContainerClientId(UIComponent.java:363)
        at org.ajax4jsf.component.UIDataAdaptorBase.getBaseClientId(UIDataAdaptorBase.java:750)
20:49:25,649 WARN  [BaseFilter:314] MyFaces Extensions Filter should be configured to execute *AFTER* RichFaces filter. Refer to S
RV.6.2.4 section of Servlets specification on how to achieve that.

I found that I got the above console error is because of having a binding variable used for a commandlink component in error instead of using it to the datatable component.
By removing it from the commandlilnk component solves the problem.

Hope this helps for some users.

Friday, October 18, 2013

Icefaces dateTimeEntry component issue with Chrome Browser

Icefaces calendar component that is having issues when used inside a datatable which is rendered inside another datatable.
May be you come across some javascript error and upon typing some entry in date field and onblur the entry is wiped off.
else you might come across the following script error:

Uncaught TypeError: Cannot call method 'init' of undefined
(anonymous function)
runScripts
doUpdate
response
onComplete
AjaxEngine.req.xmlReq.onreadystatechange

The solution to this issue is copy the following code into your web.xml file and run, surprisingly you don't see this script error.

<context-param>
     <param-name>org.icefaces.mandatoryResourceConfiguration</param-name>
     <param-value>dateTimeEntry</param-value>
</context-param>

Wednesday, October 9, 2013

java.lang.LinkageError loader constraint violation ELResover

java.lang.LinkageError due to constraint violation loader will prevent the server startup and will throw Exception sending context destroyed event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener and says "SEVERE: Error listenerStart"

In detail you might see following error in your console:

Oct 8, 2013 11:24:36 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Oct 8, 2013 11:24:36 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/ACTS] startup failed due to previous errors
Oct 8, 2013 11:24:36 AM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
Oct 8, 2013 11:24:36 AM org.apache.catalina.core.ApplicationContext log
INFO: Shutting down log4j
Oct 8, 2013 11:24:36 AM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener
java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/catalina/loader/WebappClassLoader) previously initiated loading for a different type with name "javax/el/ExpressionFactory"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1847)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:890)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1354)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at org.apache.myfaces.config.annotation.NoInjectionAnnotationLifecycleProvider.destroyInstance(NoInjectionAnnotationLifecycleProvider.java:94)
at org.apache.myfaces.webapp.AbstractMyFacesListener.doPreDestroy(AbstractMyFacesListener.java:61)
at org.apache.myfaces.webapp.StartupServletContextListener.doPredestroy(StartupServletContextListener.java:213)
at org.apache.myfaces.webapp.StartupServletContextListener.contextDestroyed(StartupServletContextListener.java:190)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3882)
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4523)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4387)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Oct 8, 2013 11:24:37 AM org.apache.coyote.http11.Http11Protocol start

This error is mainly due to the ELResolver has multiple interfaces and hence the conflict.

If your using eclipse, try to search for ELResolver class by using Open Type (Ctrl + Shift + t) and check those are declared in your POM file with scope "provided"
Mostly if you see any jar file having ELResolver which is not used in any POM file, remove them or try hard refresh your project

Hope that solves the problem.

If you find any other ways to solve the problem, please post in the comments, so atleast that helps others.

Thursday, September 5, 2013

How to get rid of Perm gen space outOfMemory exception in eclipse

Add “-Xms512m -Xmx1024m -XX:MaxPermSize=256m” at the end of VM arguments in run configuration to get rid of perm gen space outOfMemory exception.



Friday, August 3, 2012

When clicking on a community page, liferay opens a download window instead of displaying portlet

Why liferay opens a download window instead of displaying portlet when you click on a particular page?

This problem occurs only when the page doesnt have any portlet or webcontent to display or the previous one is deleted/undeployed

try to add a portlet and access page, it works.

Wednesday, August 1, 2012

Debugging the dreaded "SEVERE: Error listenerStart" and "SEVERE: Error filterStart" tomcat error messages

Just a quick post that I hope might benefit others. If you have been developing web applications on tomcat for a while you have likely come the two error messages mentioned in the title.

SEVERE: Error listenerStart

Occurs when an exception is thrown in the contextInitialized method of a ServletContextListener

SEVERE: Error filterStart

Occurs when an exception is thrown in the init method of a Filter

Unfortunately by default, tomcat won't provide you with any details about the cause of the error. Infact it wont even tell you which filter or listener is failing. This can be big problem in applications of significant size that have many filters and listeners configured. Fortunately there is a solution. In your webapplication's WEB-INF/classes folder you can create a logging.properties file with the following contents

org.apache.catalina.core.ContainerBase.[Catalina].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].handlers = java.util.logging.ConsoleHandler

Now you will be presented with the stacktrace

Tuesday, May 8, 2012

How to remote debug Tomcat (JPDA) when server has multiple virtual hosts running


Running Tomcat with remote debugging enabled
  • deploy the application you need to debug as usually
  • start Tomcat by executing the catalina.bat script and providing the "jpda" argument 
(ex.: D:\Develtools\apache-tomcat-7.0.26\bin>catalina jpda start)

Then, all you need to do is to create a remote Java application in Eclipse through these few steps : 

1° Open the debug configurations 
2° Create a new Remote Java application : 


3° Specify the project you're debugging (in my example, I've configured remote debugging for one on my sample projects, named "Blog - Remote Tomcat debugging")
4° Specify the host on which the application to debug is deployed
5° Specify the port that is opened for debugging purpose (same as the one configured as JPDA_ADDRESS in the catalina.bat file from Tomcat)
6° Launch the Remote application by clicking on "Debug" 

At this point, you could set breakpoints wherever you want in the project's source code and if the code marked with your breakpoints is executed, the running thread will be suspended and you'll be able to watch variables' value, execute expression, and so on.

Thursday, January 12, 2012

Content Assist for xhtml pages

If you are reading this means your experiencing problem with content assist for xhtml pages.
First thing to have the content assist for xhtml or jspx pages in the Eclipse IDE, you need Jboss tools for html or Jboss tools for Jsp editor pluging. To install that plugin add the following site address in the Eclipse IDE

This plugin helps to get the content assist by default fot .jspx files but not .xhtml file.

To enable content assist for other files open web project properties and then look for "Jboss tools knowledge base" and check the "Jboss tools knowledge base support"

thats it enjoy the day.

Thursday, August 4, 2011

Exception sending context initialized event to listener instan,Class path resource [applicationContext.xml] cannot be opened because it does not exist

SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:applicationContext.xml]
Offending resource: ServletContext resource [/WEB-INF/web-application-config.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:193)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:148)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:133)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:458)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:388)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:192)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:187)
... 33 more
Caused by: java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:141)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
... 37 more
Aug 4, 2011 9:49:56 AM com.sun.faces.config.ConfigureListener contextInitialized

The above error is mainly because you didnt imported the dependent projects into your web application project or the required jar is not added to your WEB-INF/lib directory

In Eclipse IDE, to add the dependent projects as jar files to WEB-INF/lib goto the prject properties-deployment assembly and click on add which navigates you to a screen where you are allowed to add any archive file to your project.

Wednesday, August 3, 2011

java.lang.IllegalStateException: No Factories configured for this Application

SEVERE: StandardWrapper.Throwable
java.lang.IllegalStateException: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions!
If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml.
A typical config looks like this;
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>

at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:106)
at javax.faces.webapp.FacesServlet.init(FacesServlet.java:105)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4420)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4733)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Aug 3, 2011 2:48:32 PM org.apache.catalina.core.StandardContext loadOnStartup

One of the possible solution could be try to import the JSF related jar files into you lib by defining them in pom.xml as follows:


<dependency>
<groupId>javax.faces</groupId> <artifactId>jsf-api</artifactId>
<version>1.2_12</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId> <artifactId>jsf-impl</artifactId>
<version>1.2_12</version>
</dependency>

Tuesday, August 2, 2011

Child object not deleted, No hibernate excetption thrown

use the following property

@Cascade({ org.hibernate.annotations.CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE_ORPHAN })

Wednesday, July 27, 2011

Dont ever use property "<prop key="hibernate.hbm2ddl.auto">create</prop>"

There is a property in hibernate configurations to create the schema/database based on the object model which is a very drawback in hibernate's history
and the property is : create

Dont ever ever use this property which will not atleast show a warning message when deleting the data or schema itself from the database connected.

Friday, April 15, 2011

liferay jdbc errors cleanup in the console

Inorder to get rid of jdbc errors in the console of liferay framework add the following inside the root.xml file which is located in the conf directory of liferay's tomcat.

<context >
<Resource
name = "jdbc/LiferayPool"
auth = "Container"
type = "javax.sql.DataSource"
driverClassName = "com.mysql.jdbc.Driver"
url = "jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false"
username = "root"
password = "highways"
maxActive = "20"/ >
</Context >



Thursday, January 10, 2008

JSTL remandatory requirement

In order to user JSTL in project the pre mandatory thing to do is to include the following in web.xml file
 
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd"
         version="2.4">
  ... ... ... ...
</web-app>

        

Monday, December 24, 2007

IP address locator in java

If u want to locate and integrate IP Address Locator i.e. for provided IPAddress it will give Coutry,City,etc.. useful infromation regards where it is located.

This is the following script

<script language="JavaScript"src="http://www.geoiptool.com/webjs.php?xl=en&xt=1&xw=200&xh=275"></script&gt;<noscript><a target="_blank" href="http://www.geoiptool.com/">Geo Web Tool</a></noscript>

For more information   http://www.maxmind.com/app/ip-location