Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#2357 closed Bug (fixed)

PropertiesLoader Exception when undeploying a webapp using FCKeditor.Java Integration

Reported by: Seif Salah Owned by: Michael Osipov
Priority: Normal Milestone: FCKeditor.Java 2.4.1
Component: Server : Java Version: FCKeditor.Java 2.4
Keywords: Confirmed Cc:

Description (last modified by Michael Osipov)

Hello
I think PropertiesLoader must be changed to something like this:

package net.fckeditor.handlers;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class PropertiesLoader {
	private static final Logger logger = LoggerFactory.getLogger(PropertiesLoader.class);
	private static Properties properties = new Properties();
	static {
		try {
			InputStream in =PropertiesLoader.class.getResourceAsStream("default.properties");
			if(null == in) {
				logger.warn("Can't find default properties!");
			} else {
				properties.load(new BufferedInputStream(in));
				logger.info("Default's properties loaded successfully!");
				in.close();
			}
		} catch (IOException e) {
			logger.error("Error while loading default properties!", e);
			throw new RuntimeException("Can't load default properties!", e);
		} catch (NullPointerException e) {
			logger.error("Error while loading default properties!", e);
			throw new RuntimeException("Can't load default properties!", e);
		}
		try {
			InputStream in = PropertiesLoader.class.getResourceAsStream("/fckeditor.properties");
			if (null == in) {
				logger.warn("Can't find user properties!");
			} else {
				properties.load(new BufferedInputStream(in));
				logger.info("User's properties loaded successfully!");
				in.close();
			}
		} catch (IOException e) {
			logger.error("Error while loading user properties!", e);
			throw new RuntimeException("Can't load user properties!", e);
		} catch (NullPointerException e) {
			logger.error("Error while loading user properties!"+ e);
			throw new RuntimeException("Can't load user properties!", e);
		}
	}
	public static String getProperty(final String key) {
		return properties.getProperty(key);
	}
	
	public static void setProperty(final String key, final String value) {
		properties.setProperty(key, value);
	}
}




I just added in.close() because PropertiesLoader.class.getResourceAsStream throws an exception when i undeploy my webapps on glassfish ;)

Attachments (3)

server.log (52.0 KB) - added by Michael Osipov 9 years ago.
Glassfish logfile
fckeditor-java-core-2.5-SNAPSHOT.jar (50.8 KB) - added by Michael Osipov 9 years ago.
Patched with in.close()
fckeditor-java-core-2.5-SNAPSHOT.2.jar (51.7 KB) - added by Michael Osipov 9 years ago.
new test

Download all attachments as: .zip

Change History (15)

comment:1 Changed 9 years ago by Michael Osipov

Description: modified (diff)

Hi,

can you provide a log file?

Changed 9 years ago by Michael Osipov

Attachment: server.log added

Glassfish logfile

comment:2 Changed 9 years ago by Michael Osipov

I wasn't able to reproduce the problem with the 2.4 demo webapp on the most recent Glassfish on Win XP SP2. See attached logs.

comment:3 Changed 9 years ago by Michael Osipov

Description: modified (diff)

Thanks for pointing this out anyway. I was able to find and fix another bug #2359

comment:4 Changed 9 years ago by Seif Salah

thanks for your quick answer :)
sorry this is the log file :

[#|2008-07-12T15:33:57.108+0200|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=14;_ThreadName=httpWorkerThread-54848-0;|PWC1412 : WebModule[] ServletContext.log() :org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: destroy called|#]

[#|2008-07-12T15:33:57.323+0200|WARNING|sun-appserver9.1|javax.enterprise.system.core.classloading|_ThreadID=14;_ThreadName=httpWorkerThread-54848-0;_RequestID=b8a24074-df79-4abb-baa4-aacbbe03d064;|Input stream has been finalized or forced closed without being explicitly closed; stream instantiation reported in following stack trace
java.lang.Throwable
	at com.sun.enterprise.loader.EJBClassLoader$SentinelInputStream.<init>(EJBClassLoader.java:1169)
	at com.sun.enterprise.loader.EJBClassLoader.getResourceAsStream(EJBClassLoader.java:805)
	at java.lang.Class.getResourceAsStream(Class.java:2030)
	at net.fckeditor.handlers.PropertiesLoader.<clinit>(PropertiesLoader.java:56)
	at net.fckeditor.FCKeditor.<init>(FCKeditor.java:16)
	at net.fckeditor.tags.EditorTag.doStartTag(EditorTag.java:50)
	at org.apache.jsp.WEB_002dINF.jsp.admin.frmeditpublicity_jsp._jspx_meth_FCK_editor_0(frmeditpublicity_jsp.java from :833)
	at org.apache.jsp.WEB_002dINF.jsp.admin.frmeditpublicity_jsp._jspService(frmeditpublicity_jsp.java from :161)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
	at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
	at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:855)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
	at com.arabicvista.web.Dispatcher.doEditPubAdmin(Dispatcher.java:4170)
	at com.arabicvista.web.Dispatcher.doGetAdmin(Dispatcher.java:2049)
	at com.arabicvista.web.Dispatcher.doGet(Dispatcher.java:165)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
	at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
	at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:855)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
	at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:183)
	at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:125)
	at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:107)
	at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:78)
	at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:383)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
	at com.arabicvista.web.JSessionStripFilter.doFilter(JSessionStripFilter.java:26)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
	at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
	at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
	at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
	at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
	at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
	at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
	at java.lang.Thread.run(Thread.java:619)
|#]

[#|2008-07-12T15:33:57.603+0200|WARNING|sun-appserver9.1|javax.enterprise.system.core.classloading|_ThreadID=14;_ThreadName=httpWorkerThread-54848-0;_RequestID=b8a24074-df79-4abb-baa4-aacbbe03d064;|Input stream has been finalized or forced closed without being explicitly closed; stream instantiation reported in following stack trace
java.lang.Throwable
	at com.sun.enterprise.loader.EJBClassLoader$SentinelInputStream.<init>(EJBClassLoader.java:1169)
	at com.sun.enterprise.loader.EJBClassLoader.getResourceAsStream(EJBClassLoader.java:805)
	at java.lang.Class.getResourceAsStream(Class.java:2030)
	at net.fckeditor.handlers.PropertiesLoader.<clinit>(PropertiesLoader.java:59)
	at net.fckeditor.FCKeditor.<init>(FCKeditor.java:16)
	at net.fckeditor.tags.EditorTag.doStartTag(EditorTag.java:50)
	at org.apache.jsp.WEB_002dINF.jsp.admin.frmeditpublicity_jsp._jspx_meth_FCK_editor_0(frmeditpublicity_jsp.java from :833)
	at org.apache.jsp.WEB_002dINF.jsp.admin.frmeditpublicity_jsp._jspService(frmeditpublicity_jsp.java from :161)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
	at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
	at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:855)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
	at com.arabicvista.web.Dispatcher.doEditPubAdmin(Dispatcher.java:4170)
	at com.arabicvista.web.Dispatcher.doGetAdmin(Dispatcher.java:2049)
	at com.arabicvista.web.Dispatcher.doGet(Dispatcher.java:165)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
	at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
	at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:855)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
	at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:183)
	at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:125)
	at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:107)
	at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:78)
	at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:383)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
	at com.arabicvista.web.JSessionStripFilter.doFilter(JSessionStripFilter.java:26)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
	at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
	at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
	at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
	at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
	at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
	at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
	at java.lang.Thread.run(Thread.java:619)
|#]

[#|2008-07-12T15:33:57.615+0200|INFO|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=14;_ThreadName=httpWorkerThread-54848-0;Arabicvista;|CORE5022 : Tous les ejb de [Arabicvista] ont été déchargés avec succès !|#]

[#|2008-07-12T15:33:57.968+0200|INFO|sun-appserver9.1|javax.enterprise.system.tools.admin|_ThreadID=14;_ThreadName=httpWorkerThread-54848-0;/tmp/s1astempdomain1server-94973949/Arabicvista.ear;|ADM1064 : Le fichier à télécharger sur [/tmp/s1astempdomain1server-94973949/Arabicvista.ear] existe et sera écrasé.|#]


By th way, i'm using glassfish V2 ur2 ML on Linux Debian. My webapp use the tukey urlrwrite engine. the Fckeditor is loaded with taglib. This exeception is thrown only when undeploying the webapp, and the editor must have be loaded at least one time before undeploying the webapp to reproduce the bug :). I hope this informations be usefull for you
PS. Sorry for my bad english, i generaly speak french or arabic ;)

comment:5 Changed 9 years ago by Michael Osipov

Thanks for the logfile. Please make an attachment next time instead of inline posting. I have 9.1_02 running and have no such error. Please provide a new file which shows that you deploy something, call the editor once and undeploy your war or ear.

What I would recommond is to create a clean project and try to reproduce the error there. I wasn't able to do so.

Thanks

Changed 9 years ago by Michael Osipov

Patched with in.close()

comment:6 Changed 9 years ago by Michael Osipov

Description: modified (diff)
Owner: set to Michael Osipov
Status: newassigned

SinuS, please try the attached jar. The in.close() is called there. If you verify this, I will close this ticket.

comment:7 Changed 9 years ago by Michael Osipov

Complete class rewrite in [2232]

Changed 9 years ago by Michael Osipov

new test

comment:8 Changed 9 years ago by Michael Osipov

Contains rewrite from [2233]

comment:9 Changed 9 years ago by Michael Osipov

Description: modified (diff)
Milestone: FCKeditor.Java 2.4.1

comment:10 Changed 9 years ago by Artur Formella

Keywords: Confirmed added

comment:11 Changed 9 years ago by Michael Osipov

Description: modified (diff)

Branch 2.4.x merged with trunk in [2534]

comment:12 Changed 9 years ago by Michael Osipov

Resolution: fixed
Status: assignedclosed

Fixed in tested in Tomcat 5.5, Jetty 6.1, GlassFish V2

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy