jump to navigation

Build path specifies execution environment J2SE-1.5 March 12, 2013

Posted by ninadgawad in Eclipse.
Tags: , ,
add a comment

Problem:  Warning – Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment

(This error was encountered in Eclipse after creating new Workspace for Maven Project)

Cause:  As mentioned in the error issue is with default runtime in Eclipse.  Having target runtime or unselected Project Facet may cause this error.
Solution:

Step 1: Select the Project

Step 2: Right Click and Go to Properties

Step 3: Select option ‘Project Facets‘ from left panel.

Step 4: Click on “Convert to faceted form …”  (if already applied go to Step 7)

Step 5: Click ‘Apply’ button and click ok to close the Properties popup.

Step 6: Refresh Project

Step 7: Right Click on Project again and Go to Properties; this time you will see ‘Targeted Runtimes’ in left panel.

Step 8: Select checkbox for “jdk6 or higher”. Click ‘Apply’ button and click ok to close the Properties popup.

Note: Refresh Project if necessary.

Target runtime was .base.v61 is not defined November 1, 2012

Posted by ninadgawad in IBM RAD.
Tags: , ,
add a comment

Problem: Target runtime was .base.v61 is not defined

This error is encountered in IBM RAD 7.0.0.9 after a new Server profile is added or after creating new Workspace

Cause:

  • As mentioned in the error issue is with target run-time.
  • Importing existing projects in Workspace with incorrect .settings file may cause this error.

Solution:

Step 1: Select the Project

Step 2: Right Click and Go to Properties 

Step 3: Select option ‘Targeted Runtimes‘ from left panel.

Step 4: Select the runtime which needs to be configured for the project in right panel (Targeted Runtimes)

Step 5: Click ‘Apply’ button and then ‘OK’ to close this popup.

Note: Refresh Project if necessary. 

The content of Element Type Error in web.xml July 25, 2012

Posted by ninadgawad in Java, Web Apps, XML.
Tags: , ,
add a comment

Problem: The content of element type “web-app” must match “(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)”.

This is generally observed in Eclipse or IBM RAD.

Cause:

  • This error is observed while SAX Parser validates the web.xml
  • Tags added in web.xml are not in correct order.

Solution:

Just make sure you re arrange the tag’s in web.xml in the order mentioned in the error.

  1. icon?
  2. display-name?
  3. description?
  4. distributable?
  5. context-param*
  6. filter*
  7. filter-mapping*
  8. listener*,servlet*
  9. servlet-mapping*
  10. session-config?
  11. mime-mapping*
  12. welcome-file-list?
  13. error-page*
  14. taglib*
  15. resource-env-ref*
  16. resource-ref*
  17. security-constraint*
  18. login-config?
  19. security-role*
  20. env-entry*
  21. ejb-ref*,
  22. ejb-local-ref*

Note: Refresh the project after making the above change.

Convert date from one format to another date format Utility February 10, 2012

Posted by ninadgawad in Java.
Tags: , , ,
add a comment

If you want Need to convert a date from a one format to another date format, please find the code below to do the same using Java.
You can have it as a generic Utility in your application’s Utility function.


/**
* Return string with formatted date
* @param inputdate Date String which needs conversion
* @param inputDateFormat Format of the input date
* @param outputDateFormat Format which date should be converted
* @return the output formated String
*/
private String convertDateFormat(String inputdate, String inputDateFormat, String outputDateFormat){
String outputDate = null;
SimpleDateFormat sdfSource = new SimpleDateFormat(inputDateFormat);
try {
Date date = sdfSource.parse(inputdate);
sdfSource = new SimpleDateFormat(outputDateFormat);
outputDate = sdfSource.format(date);
} catch (Exception e) {
e.printStackTrace();
}
return outputDate;
}

Let me know if you find a better way to do this.
Hope this helps !

Thanks,
Ninad

Error: unsupported encoding Cp037 for result set column SQLState: 22021 ErrorCode: -99999 January 24, 2012

Posted by ninadgawad in Uncategorized.
Tags: , , , ,
add a comment

Problem:

Error: unsupported encoding Cp037 for result set column SQLState: 22021 ErrorCode: -99999

Cause:
Issue with JVM version installed on your machine. Mostly occurs because of multiple versions of java in the OS or when international version of jdk/jre is not installed. It is related to carsets.jar

Solution:
Delete the java.exe from C:\Windows\system32 (make a copy first)
Make sure that JAVA_HOME is set correctly and JAVA_HOME/bin is added to PATH & CLASSPATH.

Note: Uninstall/Delete old version’s on JDK/JRE from you machine and make a fresh installation.

Follow

Get every new post delivered to your Inbox.