2008年10月6日月曜日

[grails]create plugin for grails to execute native query

I upgraded the new version file, please refer to the http://taapps-javalibs.blogspot.com/2009/04/grailsupgraded-plugin-for-grails-to.html

I create grails plugin named native-query to execute native query statement like ORACLE's query hint, mysql match-against statement on the grails framework.
I wrote a blog entry "[Groovy>Grails] Customization, how to execute Native SQL statement on Grails environment" before. but this customization is not useful. I create a new plugin having the same functionality.
  1. download zip file named grails-native-query-0.1.zip via http://groups.google.com/group/taapps-sourcecode-libraries/web/grails-native-query-0.1.zip
  2. installing plugin into the grails application
    grails install-plugin grails-native-query-0.1.zip

2008年9月11日木曜日

[WinVista]Not display and apply the Windows Vista Service Pack programs via Windows Update

This issue is not related to the java or java's libraries, this is windows vista issue.

Description
Windows Update program doesn't list the Windows Vista Service pack 1 and we can't apply the Window Vista Service Pack 1 via Windows Update program.

References
  1. Information about Windows Vista Service Pack
    http://support.microsoft.com/kb/936330/
  2. Windows Vista Service Pack 1 is not available for installation from Windows Update and is not offered by Automatic Updates
    http://support.microsoft.com/kb/948343
Cause
Before installing the Windows Vista Service Pack1, System needs to be applied all important programs and patches listed on Windows Update. System doesn't display and list the Vista Service Pack 1 until applying all important patches and updates.
(not require the optional programs. for example, we don't need to apply the patches for the silverlight even if the programs are listed on Windows Update.)
Maybe this problem doesn't occure when setting the automatically windows update mode.

Resolution

[WinVista]Error occured while installing windows vista service pack 1

This issue is not related to the java or java's libraries, this is windows vista issue.

Description
Error occured when installing the Windows Vista Service pack 1 on Vista Home Edition environment. I tried to install several times, but same error occured everytime.

References

Error details
Error message was as follows.
An internal error occured while installing the service pack.
Error Code: 0x0800F0826 See http://go.microsoft.com/fwlink/?linkid=101139

Cause
Before installing the Windows Vista Service Pack1, System needs to be applied all important programs and patches listed on Windows Update.
(not require the optional programs. for example, we don't need to apply the patches for the silverlight even if the programs are listed on Windows Update.)
Maybe this problem doesn't occure when setting the automatically windows update mode.

Resolution
  1. Open the Windows Update via Start Menu->Windows Vista or Open the Start Menu and enter the "Windows Update" in the search fields at the bottom of Start Menu.
  2. Check the important programs and patches you haven't applied yet listed on Windows Update.
  3. If you have any programs you haven't applied yet, please try to apply all of the programs marked as Important.
  4. After applying the programs listed on Windows Update, reboot the Windows machine.
  5. Retry to apply the Windows Service Pack program.
(Please look at the documentation "Information about Windows Vista Service Pack 1" and check the "What to do before you install Windows Vista SP1" section.)

2008年5月30日金曜日

[Firefox]blank page is displayed, not able to access to the localhost(127.0.0.1) when using Firefox browser.

Description
When I use the firefox browser in Windows Vista environment and access to my localhost environment to test my web page, I can't access to my localhost web page. blank page is found and firefox doesn't display my test page, and System has no response. However, Internet Explorer works fine in the same environment.

Resolution
  1. Start the firefox browser
  2. Type "about:config" in URL field, the configuration page is displayed.
  3. Type "ipv6" in Filter field located at the top of the config page.
  4. Check "network.dns.disableIPv6", the default value of this configuration is FALSE, change the value of this configuration to TRUE(doubleclick this field and system will change the value to TRUE.)

2008年5月26日月曜日

[Java>JavaMail] java.lang.SecurityException: "Access to default session denied" occures.

Description
This problem occures in my web application environment using tomcat server. When using the javamail library to send email from my application, sometimes the java.lang.SecurityException: "Access to default session denied" error occures and I can not send email from my application. After rebooting my application server(tomcat), javamail works fine for a while.

Error Details
Error message outputted by the javamail is java.lang.SecurityException: "Access to default session denied". After occuring this error, system always fails to send email, but system works fine after rebooting the tomcat server.

Cause
This error is raised in the getDefaultInstance method in javax.mail.Session.java. According to this source code, this error occures when the default session object is already initialized, but authenticator instance is renewed or changed, or the class loader of the default session object is different from the argument authentificator's. Maybe the java source code using the default session instance of the java mail is recompiled and reloaded, or duplicate javamail class libraries are included into the Classpath of the environment.
javax.mail.Session.java file
public static synchronized Session getDefaultInstance(Properties props,
Authenticator authenticator) {
if (defaultSession == null)
defaultSession = new Session(props, authenticator);
else {
// have to check whether caller is allowed to see default session
if (defaultSession.authenticator == authenticator)
; // either same object or both null, either way OK
else if (defaultSession.authenticator != null &&
authenticator != null &&
defaultSession.authenticator.getClass().getClassLoader() ==
authenticator.getClass().getClassLoader())
; // both objects came from the same class loader, OK
else
// anything else is not allowed
throw new SecurityException("Access to default session denied");
}

return defaultSession;
}

Resolution
  1. Recompile and restart application server to reload the new class file.
    After restarting the application server, does your system work fine?
    Do you use auto-deploy functionality? If yes, restart application server and use it without modifying and recompiling your java files.
  2. If the duplicate class files are included.
    Please check the class path directories and some jar files including the javamail class file is included. For example, please check common/lib directory and WEB-INF/lib in your application if you are using tomcat application server. If the duplicate class files are found, please remove the jar file.

2008年5月9日金曜日

[Groovy>Grails] IncompatibleClassChangeError error when starting jetty server in grails development environment

Description
I useally use the Java environment based on Sun's JDK when using grails and groovy, but sometimes I change the JDK from Sun's to IBM's to check the behavior and performance. After changing the IBM's JDK, following error occures when starting up the jetty application server on grails environment.

Error Detail
Failed startup of context org.mortbay.jetty.webapp.WebAppContext@3c003c{/test,/home/admin/test/web-app}
org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.IncompatibleClassChangeError: the number of constructors during runtime and compile time for java.lang.Thread do not match. Expected 8 but got 9.

Solution
This error occures because the runtime of java version or provider(Sun, IBM or others) is different from the version of compiled jdk environment. In my case, I compile the grails source code based on Sun's jdk(Ver.1.5), and then I change the JDK from Sun to IBM(Ver.1.5) without recompiling my java source codes. Maybe the IBM internal classes using in the JDK is different from the Sun's. In this case, the error is resolved after clearing all old compiled class files and recompile all classes by using new java compiler.

2008年4月10日木曜日

[JAVA>Rome, Itunes RSS/XML] When using Rome ITunes RSS Reader, ParsingFeedException(Invalid XML) error occured.

When using Rome's itunes module, the error "com.sun.syndication.io.ParsingFeedException: Invalid XML" sometimes occures.The error stack is as follows. This error isn't related to the Rome core program, this error is depended on the itunes module.
The Podcast RSS feeds has itunes:duration attribute which means the duration of the podcast file. The value format of this field is always similar to "09:30", but some site are including the invalid value(Long type value).

References
  1. Same error, but the root cause is different from this problem.
    http://taapps-javalibs.blogspot.com/2008/04/javarome-rssxml-when-using-rome-rss.html
  2. Itunes module site
    http://wiki.java.net/bin/view/Javawsxml/ITunes
  3. Source Code repository
    https://rome.dev.java.net/source/browse/rome/
Error Stack
  • Caused by: java.lang.RuntimeException: Illegal time value: 9174935
    at com.sun.syndication.feed.module.itunes.types.Duration.(Duration.java:98)
    at com.sun.syndication.feed.module.itunes.io.ITunesParser.parse(ITunesParser.java:149)
    at com.sun.syndication.io.impl.ModuleParsers.parseModules(ModuleParsers.java:51)
    at com.sun.syndication.io.impl.BaseWireFeedParser.parseItemModules(BaseWireFeedParser.java:57)
    at com.sun.syndication.io.impl.RSS090Parser.parseItem(RSS090Parser.java:289)
    at com.sun.syndication.io.impl.RSS091UserlandParser.parseItem(RSS091UserlandParser.java:222)
    at com.sun.syndication.io.impl.RSS092Parser.parseItem(RSS092Parser.java:81)
    at com.sun.syndication.io.impl.RSS093Parser.parseItem(RSS093Parser.java:39)
    at com.sun.syndication.io.impl.RSS094Parser.parseItem(RSS094Parser.java:68)
    at com.sun.syndication.io.impl.RSS090Parser.parseItems(RSS090Parser.java:263)
    at com.sun.syndication.io.impl.RSS090Parser.parseChannel(RSS090Parser.java:178)
    at com.sun.syndication.io.impl.RSS091UserlandParser.parseChannel(RSS091UserlandParser.java:84)
    at com.sun.syndication.io.impl.RSS092Parser.parseChannel(RSS092Parser.java:49)
    at com.sun.syndication.io.impl.RSS094Parser.parseChannel(RSS094Parser.java:45)
    at com.sun.syndication.io.impl.RSS090Parser.parse(RSS090Parser.java:82)
    at com.sun.syndication.io.WireFeedInput.build(WireFeedInput.java:252)
    at com.sun.syndication.io.WireFeedInput.build(WireFeedInput.java:179)
The reason why this error occures.
When system reads the RSS, Rome and itunes module parses the rss feed. In Duration field, ITuneParser tries to check whether the duration value includes the ":" character or not. But some duration field doesn't include the ":" character, ITuneParser will raise the ParseException.

Solution
Please download the latest source code from the CVS repository, this problem has already solved. I downloaded the latest source code and compiled it. You can get the jar file I compiled.
URL is http://groups.google.com/group/taapps-sourcecode-libraries/web/itunes-0.4-tafix2.jar
(I recompiled itues-0.4.jar file again at 2008/04/14)