Showing posts with label Spring. Show all posts
Showing posts with label Spring. Show all posts

2012-09-28

How to fix log4j.dtd XML problem in eclipse

Problem
The file cannot be validated as the XML definition \path\to\workspace\java.shop\src\test\resources\log4j.dtd (The system cannot find the file specified)" that is specified as describing the syntax of the file cannot be located.

Reason
Eclipse cannot find the log4j.dtd for validation.

Solution
Open Preference (Window > Preferences) and Select XML>XML Catalog
Click [Add...] and insert the following
Location: jar:file:C:\USR\eclipse\plugins\org.apache.log4j_1.2.15.v201012070815.jar!/org/apache/log4j/xml/log4j.dtd
Key Type: Public ID
Key: -//APACHE//DTD LOG4J 1.2//EN


2012-07-28

org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER will not be exported or published.

WARNING in Eclipse : Classpath entry org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER will not be exported or published. Runtime ClassNotFoundExceptions may result.
  1. Open [Properties] of the project
  2. Select [Java Build Path]
  3. Select [Order and Export]
  4. Enable checkbox on [Maven Dependencies]
  5. Click [OK]
  6. Open [Windows>Show View>Other>Problems]
  7. Select the warning what you want to solve
  8. Press [Ctrl-1]
  9. Click [Finish] on Quick Fix window

2012-07-27

How to resolve Loader Constraint Violation while running a Spring MVC Project on Tomcat 7

  • Loader Constraint Violation while running a Spring MVC Project on Tomcat 7

  • Error Message
    java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;" the class loader (instance of org/apache/jasper/servlet/JasperLoader) of the current class, org/apache/jsp/WEB_002dINF/views/home_jsp, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for resolved class, javax/servlet/jsp/JspApplicationContext, have different Class objects for the type avax/el/ExpressionFactory; used in the signature

  • Cause
    Tomcat 7 uses el-api 2.2 and jsp-api 2.2.

  • Solution
    1. Open POM.XML file and Go to Dependencies page
    2. Select jsp-api : 2.1 > Click Properties > Change 2.1 to 2.2
    3. Save and run to check

2012-07-15

How to deploy your project on Tomcat within Eclipse

Do you see the message [There are no resources that can be added or removed from the server.] when you select [Add and Remove...] on Tomcat server within Eclipse. If so, you need to add the Eclipse [Dynamic Web Module] facet.
  1. Go to [Properties] on your project.
  2. Check [Dynamic Web Module] at [Project Facets] page.
  3. Add your project on Tomcat and run.
  • Add [Maven Integration for Eclipse WTP] if you cannot find [Dynamic Web Module]

2012-07-14

How to install Eclipse Marketplace client

  1. Click [Help]->[Install New Software...]
  2. Select [Indigo Update Site] at [Work with:]
    If you cannot find it, click [Add...] and then input
    [Name] : Indigo Update Site
    [Location] : http://download.eclipse.org/releases/indigo
    
  3. Check [General Purpose Tools]->[Marketplace Client] and Install it.
  4. Restart Eclipse and See [Help]->[Eclipse Marketplace...]

2012-07-11

How to install Android SDK in SpringSource Tool Suite on Linux Mint and Ubuntu


1.       Install Android SDK
a.       Download Android SDK
b.      Extract the file into any folder. I usually install applications into /opt when I don’t use a package manager.
c.       Run [/opt/android-sdk-linux/tools/android]

e.      Select APIs and Click [Install Packages…]
2.       Setup Eclipse
a.       Run Eclipse. I use SpringSource Tool Suite.
b.      Click [Help > Install New Software…]
c.       Input (https://dl-ssl.google.com/android/eclipse/) in an edit box labeled [Work with:]
d.      Click [Add…]
e.      Input (ADT plugin) in an edit box labeled [Name] and Click [OK]
f.        Click [Select All] and [Developer Tools] and [NDK Plugins] may be selected.
g.       Click [Next >]

How to install SpringSource Tool Suite on Linux Mint and Ubuntu

  1. Download SpringSource Tool Suite
  2. Extract the file into any folder. I usually install applications into /opt when I don’t use a package manager.
  3. Create a menu item
    sudo vi /usr/share/applications/STS.desktop
    
  4. Content
    [Desktop Entry]
    Name=SpringSource Tool Suite
    Comment=SpringSource Tool Suite
    Exec=/opt/springsource/sts-2.9.2.RELEASE/STS
    Icon=/opt/springsource/sts-2.9.2.RELEASE/icon.xpm
    StartupNotify=true
    Terminal=false
    Type=Application
    Categories=Development;IDE;Java;
    
  5. You can see [SpringSource Tool Suite] in [Menu > Programming]