Tuesday, July 8, 2014

Caused by: java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource

Exception :- 
Caused by: java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource


First ensure that you have included commons-collections and  commons-dbcp jar in classpath. Click here to download
commons-collections and  commons-dbcp jar

If you are using maven then add following dependency in pom.xml 

<dependency>
    <groupId>commons-collections</groupId>
    <artifactId>commons-collections</artifactId>
    <version>3.2.1</version>
</dependency>


<dependency>
    <groupId>commons-dbcp</groupId>
    <artifactId>commons-dbcp</artifactId>
    <version>1.4</version>
</dependency>


org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource

Exception :-
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/demo-servlet.xml]; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReade

First ensure that you have included aopalliance jar in classpath. Click here to download aopalliance-1.0.jar 

If you are using maven then add following dependency in pom.xml
 
<dependency>
    <groupId>aopalliance</groupId>
    <artifactId>aopalliance</artifactId>
    <version>1.0</version>
</dependency>

Friday, July 4, 2014

java.lang.ClassNotFoundException: javassist.util.proxy.MethodFilter

Exception :- 
Caused by: java.lang.ClassNotFoundException: javassist.util.proxy.MethodFilter 
Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer] 
Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister 


First ensure that you have included javassist jar in classpath. Click here to download javassist jar 

If you are using maven then add following dependency in pom.xml
<dependency>
    <groupId>javassist</groupId>
    <artifactId>javassist</artifactId>
    <version>3.12.1.GA</version>
</dependency>

 

Thursday, July 3, 2014

java.lang.NoClassDefFoundError: Lorg/apache/commons/logging/Log

Please ensure that you have included standred.jar in classpath. Click here to download  standred.jar - See more at: http://makecodeeasy.blogspot.in/2014/07/javautilconcurrentexecutionexception.html#sthash.0Um7PGLr.dpuf
Exception :- java.lang.NoClassDefFoundError: Lorg/apache/commons/logging/Log

First ensure that you have included commons-logging-xxx.jar in classpath.
Click here to download 
commons-logging-xxx.jar

If you are using maven then add following dependency in pom.xml
<dependency> 
    <groupId>commons-logging</groupId> 
    <artifactId>commons-logging</artifactId> 
    <version>1.1.1</version> 
</dependency>
The Commons Logging provides a Log interface that is intended to be both light-weight and an independent abstraction of other logging toolkits. It provides the middleware/tooling developer with a simple logging abstraction, that allows the user (application developer) to plug in a specific logging implementation.

java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]

Exception :- java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]

Please ensure that you have included standred.jar in classpath.
Click here to download  standred.jar

If you are using maven then add following dependency in pom.xml
 <dependency>  
   <groupId>taglibs</groupId>  
   <artifactId>standard</artifactId>  
   <version>1.1.2</version>  
 </dependency>  

standard.jar (taglib) library is used to enable the JSTL expression language in JSP page, and it’s always used together with the jstl.jar together.
 
 <dependency> 
    <groupId>taglibs</groupId> 
    <artifactId>standard</artifactId> 
    <version>1.1.2</version> 
</dependency> 

Saturday, June 28, 2014

Drag and Drop using jQuery JavaScript in HTML

Using jQuery you can create simple Drag & Drop features easily and manage them well. jQuery UI provides with a vast suite of APIs that can create a UI with Drag Drop functionality.
Steps :-

1. Create a HTML file which includes css, jquery & javascript libraries .

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>Drag and drop</title>

<LINK REL=StyleSheet HREF="css/makecodeeasy.css" TYPE="text/css">
<link rel="stylesheet"
    href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

</head>
<body>

    <div>
        <fieldset id="shop" class="draggableContainer">
            <legend>Draggable component</legend>
            <img class="component" id="1" src="image/1.jpg"> 
            <img class="component" id="2" src="image/2.jpg"> 
            <img class="component" id="3" src="image/3.jpg"> 
            <img class="component" id="4" src="image/4.jpg">
        </fieldset>
    </div>

    <div>
        <fieldset>
            <legend>dropZone</legend>
            <div class="dropZone" id="dropZone"></div>
        </fieldset>
    </div>

    <script src="js/makecodeeasy.js"></script>

</body>
</html>

2. Create Javascript file (makecodeeasy.js)
var dropArea = document.querySelector('#dropZone');

var conponents = document.querySelectorAll('.component');
for ( var i = 0; i < conponents.length; i++) {
    conponents[i].setAttribute('draggable', 'true');
    conponents[i].addEventListener('dragstart', function(evnt) {
        evnt.dataTransfer.effectAllowed = 'copy';
        evnt.dataTransfer.setData('text', this.id);
        return false;
    }, false);
}

dropArea.addEventListener('dragover', function(evnt) {
    if (evnt.preventDefault)
        evnt.preventDefault();
    evnt.dataTransfer.dropEffect = 'copy';
    return false;
}, false);


dropArea.addEventListener('drop', function(evnt) {
    if (evnt.stopPropagation)
        evnt.stopPropagation();
    var id = evnt.dataTransfer.getData('text');
    var theitem = document.getElementById(id);

    if (theitem == null) {
        evnt.preventDefault();
        return;
    }
    var y = document.createElement('img');
    y.src = theitem.src;
    dropArea.appendChild(y);
    evnt.preventDefault(); // for Firefox
    return false;
}, false);

3. Create css file (makecodeeasy.css) 
body {
    padding: 40px;
}

.draggableContainer {
    border-radius: 6px;
}


.component {
    border: 3px solid white;
}

.component:hover {
    border: 3px solid red;
    cursor: move;
}

#dropArea {
    position: relative;
    height: 200px;
    width: 100%;
    float: left;
    border: 1px dotted #999;
}


.dropZone {
    width:100%;
    height:100px
}

4.  Demo  

Draggable component
dropZone
5.  Try the code & Enjoy :) 
     jsfiddle link :- http://jsfiddle.net/zBhD7/

ShareThis

Loading...