File writing that works under Windows will not work in Linux
3 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Paul_Hunnisett
Posted On:   Wednesday, January 28, 2004 03:45 AM

I have copied a web application that uses Struts to Linux from windows. It was tested in Windows and works without problems. In Linux, however, I get two errors that I didn't get before, they are: During tomcat startup: SEVERE: IOException while loading persisted sessions: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.struts.upload.CommonsMultipartRequestHandler$CommonsFormFile java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.struts.upload.CommonsMultipartRequestHandler$CommonsFormFile at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1278) at java.io.ObjectInputStream.defaultReadFields(O   More>>

I have copied a web application that uses Struts to Linux from windows. It was tested in Windows and works without problems.

In Linux, however, I get two errors that I didn't get before, they are:

During tomcat startup:

			
SEVERE: IOException while loading persisted sessions: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.struts.upload.CommonsMultipartRequestHandler$CommonsFormFile
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.struts.upload.CommonsMultipartRequestHandler$CommonsFormFile
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1278)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1401)
at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:895)
at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:450)
at org.apache.catalina.session.StandardManager.load(StandardManager.java:377)
at org.apache.catalina.session.StandardManager.start(StandardManager.java:690)
at org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:542)
at org.apache.catalina.startup.ContextConfig.managerConfig(ContextConfig.java:350)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:655)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:254)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4212)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:316)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:859)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:723)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1002)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:393)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:816)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2343)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)


and also:

			java.io.FileNotFoundException: ../webapps/constuctionportal/images/RedFruitITLimited/redfruitlogo.jpg (No such file or directory)
			
java.io.FileOutputStream.open(Native Method)
java.io.FileOutputStream.(FileOutputStream.java:179)
java.io.FileOutputStream.(FileOutputStream.java:70)
uk.co.redfruit.constructionportal.RegisterAction.execute(RegisterAction.java:64)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


The latter is caused by the following lines of code:

			File f = new File("../webapps/constuctionportal/images/" + ref);
			
if (!f.exists()){
System.out.println("not sure what's going wrong here...");
f.mkdir();
}


not working - for some reason the the if statement (which should return false) is not working and the appropriate directory is not being created

Does anyone have any ideas as to why this directory is not being created?    <<Less

Re: File writing that works under Windows will not work in Linux

Posted By:   Elvin_Ebora  
Posted On:   Thursday, February 26, 2004 04:56 PM

Have you set the CLASSPATH variable in linux? Check whether CLASSPATH variable exists and points to the right directories and libraries.

Re: File writing that works under Windows will not work in Linux

Posted By:   Anonymous  
Posted On:   Saturday, February 14, 2004 04:27 AM

Hi,

could you try to specify the ../webapps/constuctionportal/images path as absolute? You could specify it in web.xml as context-parameter.


--Jouni

Re: File writing that works under Windows will not work in Linux

Posted By:   Simon_Ablett  
Posted On:   Wednesday, January 28, 2004 04:33 AM

I am not familiar with Struts but I would suggest that your environment is probably configured differently i.e. perhaps files / directories that exist in Windows do not exist in Linux. Specifically relating to the second error message does the directory structure exist as shown i.e. relative to the current working directory does a directory '../webapps/constuctionportal/images/' actually exist?

Regards.
About | Sitemap | Contact