eXtensibleCatalog / OAI-Toolkit

Synchronize MARC metadata in most ILSs with XC
5 stars 1 forks source link

java.io.IOException: Permission denied #149

Open patrickzurek opened 8 years ago

patrickzurek commented 8 years ago

JIRA issue created by: rcook Originally opened: 2012-06-26 10:49 AM

Issue body: From GC

Reported by atkins245, Today (7 minutes ago)

What steps will reproduce the problem?

  1. Installed OAIToolkit
  2. Open Browser http://localhost:8080/OAIToolkit/index.jsp
  3. After click OAI Sample Request/.. Get error HTTP 500 for any link of this page

What is the expected output? What do you see instead? List of records

What version of the product are you using? On what operating system? OAIToolkit 1.08 openSUSE 12.1 64 bit, PHP 5.3.8, tomcat 6.0.33, mySQL: 5.5.23, java jdk 1.6_u32

Please provide any additional information below. 1) In the beginning, I open the catalina.out in /var/lob/tomcat6 and I found error: ApplInfo::init(/srv/tomcat6/bin) ApplInfo::init(OAIToolkit) reading application properties basePropertiesFileName: /srv/tomcat6/bin/OAIToolkit.directory.properties java.lang.Exception: Inexistent configuration file: /srv/tomcat6/bin/OAIToolkit.directory.properties at info.extensiblecatalog.OAIToolkit.utils.ConfigUtil.load(ConfigUtil.java:51) at info.extensiblecatalog.OAIToolkit.utils.ApplInfo.initApplication(ApplInfo.java:250) at info.extensiblecatalog.OAIToolkit.utils.ApplInfo.init(ApplInfo.java:153) at info.extensiblecatalog.OAIToolkit.struts.InitializerServlet.init(InitializerServlet.java:104) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065) at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) at org.apache.catalina.core.StandardService.start(StandardService.java:525) at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) at org.apache.catalina.startup.Catalina.start(Catalina.java:595) 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:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Jun 25, 2012 12:16:24 PM org.apache.catalina.startup.HostConfig deployWAR

because I saw Inexistent configuration file: /srv/tomcat6/bin/OAIToolkit.directory.properties then I setup the link in /srv/tomcat6 to /usr/share/tomcat6/bin but then I found another error:

ApplInfo::init(/usr/share/tomcat6/bin) ApplInfo::init(OAIToolkit) reading application properties basePropertiesFileName: /usr/share/tomcat6/bin/OAIToolkit.directory.properties java.io.IOException: Permission denied at java.io.UnixFileSystem.createFileExclusively(Native Method) at java.io.File.createNewFile(File.java:883) at info.extensiblecatalog.OAIToolkit.utils.ConfigUtil.load(ConfigUtil.java:60) at info.extensiblecatalog.OAIToolkit.utils.ApplInfo.initApplication(ApplInfo.java:250) at info.extensiblecatalog.OAIToolkit.utils.ApplInfo.init(ApplInfo.java:153) at info.extensiblecatalog.OAIToolkit.struts.InitializerServlet.init(InitializerServlet.java:104) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065) at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) at org.apache.catalina.core.StandardService.start(StandardService.java:525) at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) at org.apache.catalina.startup.Catalina.start(Catalina.java:595) 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:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Jun 26, 2012 10:20:14 AM org.apache.catalina.startup.HostConfig deployWAR

you can see in ApplInfo Before: ApplInfo::init(/srv/tomcat6/bin) After: ApplInfo::init(/usr/share/tomcat6/bin)

And I got this: java.io.IOException: Permission denied I changed all OAI#.properties in /bin to user: root, group tomcat for all permisson (Read, Write) I also change permission to OAIToolkit folder to user: root, group tomcat with all permission then I also change permission to /OAIToolkit/catche, lucene_index, server_logs, resources (base on directories.properties) to all read, write for all groups

However, I still get error above and ava.io.IOException: Permission denied

patrickzurek commented 8 years ago

JIRA Comment by user: Chris Delis (cedelis) JIRA Timestamp: 2012-06-26 12:51 PM

Comment body:

Just an FYI: I was able to reproduce this error. I installed openSUSE 12.1. I will see if I can get installation working for this configuration. --Chris

patrickzurek commented 8 years ago

JIRA Comment by user: Chris Delis (cedelis) JIRA Timestamp: 2012-06-26 03:32 PM

Comment body:

patrickzurek commented 8 years ago

JIRA Comment by user: Chris Delis (cedelis) JIRA Timestamp: 2012-06-26 04:00 PM

Comment body:

I've made a code change that should help solve this issue. Can you replace your current OAIToolkit.war file (/usr/share/tomcat6/webapps/OAIToolkit.war) with the one attached to this issue ( http://extensiblecatalog.lib.rochester.edu:8080/secure/attachment/10322/OAIToolkit.war )? For good measure, it's probably a good idea to remove the old application files, too (rm -rf /usr/share/tomcat6/webapps/OAIToolkit). You would need to shutdown tomcat before doing this, then restarting it afterwards. Thanks, Chris

patrickzurek commented 8 years ago

JIRA Comment by user: Chris Delis (cedelis) JIRA Timestamp: 2012-06-26 04:17 PM

Comment body:

Also: I notice that in openSUSE (and perhaps other environments?), the OAIToolkit.war web app seems to need full pathnames in /usr/share/tomcat6/bin/OAIToolkit.log4j.properties

You may need to edit/change the following values:

log4j.appender.toolkit.File=log/toolkit.log log4j.appender.librarian_convert.File=log/librarian_convert.log log4j.appender.librarian_load.File=log/librarian_load.log log4j.appender.lucene_dbStatistics.File=log/lucene_dbStatistics.log log4j.appender.programmer.File=log/programmer.log

to:

log4j.appender.toolkit.File=/usr/share/tomcat6/bin/log/toolkit.log log4j.appender.librarian_convert.File=/usr/share/tomcat6/bin/log/librarian_convert.log log4j.appender.librarian_load.File=/usr/share/tomcat6/bin/log/librarian_load.log log4j.appender.lucene_dbStatistics.File=/usr/share/tomcat6/bin/log/lucene_dbStatistics.log log4j.appender.programmer.File=/usr/share/tomcat6/bin/log/programmer.log

You don't need to put it in /usr/share/tomcat6/bin, however, you may put it anywhere you wish; just be sure the directory exists and is writable by user tomcat.

--Chris

patrickzurek commented 8 years ago

JIRA Coment by user: atkins245@gmail.com JIRA Timestamp: 2012-06-29 04:25 PM

Comment body:

Hi Chris, Thanks. I download the file and it still does not work. I have to do two things: 1) set the link from /usr/share/tomcat6/bin to /srv/tomcat6/bin 2) Because the instruction copy OAIToolkit to root (/) then I have to change permission of this folder OAIToolkit to tomcat also

By the way, I think I have the same problem with MTS on openSUSE. Can you fix that too? I submit the request on MTS issues site already :-) Thanks again.

patrickzurek commented 8 years ago

JIRA Comment by user: Chris Delis (cedelis) JIRA Timestamp: 2012-07-02 11:23 AM

Comment body:

I found a work-around that should get MST to work on openSUSE. As user "root":

[first, shutdown tomcat, then..]

cd /usr/share/tomcat6 ln -s ./bin/MST-instances

[finally, restart tomcat...]

patrickzurek commented 8 years ago

JIRA Coment by user: atkins245@gmail.com JIRA Timestamp: 2012-07-05 01:23 PM

Comment body:

Thanks Chris, Instead of replace the link of MST, I just move this folder into /tomcat6 and it work.

Thanks again

patrickzurek commented 8 years ago

JIRA Coment by user: atkins245@gmail.com JIRA Timestamp: 2012-07-05 01:24 PM

Comment body:

Hi Chris, I also setup OAI on windows 7, XAMPP 1.7.7 and I still have to use the new OAIToolkit.war file here to make it work.