How to install Fedora4 on CentOS with Tomcat7

51 views
Skip to first unread message

gua...@ualberta.ca

unread,
Feb 20, 2015, 10:56:31 AM2/20/15
to fedora-c...@googlegroups.com
Hi

I followed the official documentation about how to deploy Fedora 4 on CentOS 6.x with Java 1.7, and Tomcat 7, but could not get it work. 

Could you please help?

Operating Systems:
      CentOS with a kernel  2.6.32-504.8.1.el6.x86_64

Java version:
     java version "1.7.0_55"
    Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
    Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)

JAVA_HOME:
         /usr/java/default

Tomcat:
      apache-tomcat-7.0.59

Fedora Version:
         fcrepo-webapp-4.0.0.war


What I did:

step 1: install JDK 1.7
step 2: install Tomcat7. I checked the http://localhost:8080/ it returned the right tomcat web page
step 3: copy fcrepo-webapp-4.0.0.war to the default tomcat installation directory at /usr/share/apache-tomcat-7.0.59/webapps
step 4: restart tomcat7

When I tried to access the deployed web site: http://localhost:8080/fcrepo-webapp-4.0.0/rest, I got the following errors:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'modeshapeRepofactory': Invocation of init method failed; nested exception is org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.persistence.manager.PersistenceManagerImpl.start() on object of type PersistenceManagerImpl
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1560) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:540) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:229) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:706) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) ~[spring-context-4.1.1.RELEASE.jar:4.1.1.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) ~[spring-context-4.1.1.RELEASE.jar:4.1.1.RELEASE]
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) [spring-web-4.1.1.RELEASE.jar:4.1.1.RELEASE]
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) [spring-web-4.1.1.RELEASE.jar:4.1.1.RELEASE]
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) [spring-web-4.1.1.RELEASE.jar:4.1.1.RELEASE]
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016) [catalina.jar:7.0.59]
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5524) [catalina.jar:7.0.59]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.59]
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) [catalina.jar:7.0.59]
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) [catalina.jar:7.0.59]
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649) [catalina.jar:7.0.59]
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1081) [catalina.jar:7.0.59]
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1877) [catalina.jar:7.0.59]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_55]
        at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_55]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_55]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_55]
        at java.lang.Thread.run(Thread.java:745) [na:1.7.0_55]
Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.persistence.manager.PersistenceManagerImpl.start() on object of type PersistenceManagerImpl
        at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:185) ~[infinispan-commons-6.0.2.Final.jar:6.0.2.Final]
        at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:869) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
        at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:638) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
        at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:627) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
        at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:530) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
        at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:216) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
        at org.infinispan.CacheImpl.start(CacheImpl.java:675) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
        at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:553) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
        at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:516) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
        at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:398) ~[infinispan-core-6.0.2.Final.jar:6.0.2.Final]
        at org.infinispan.schematic.Schematic.get(Schematic.java:91) ~[modeshape-schematic-4.0.0.Final.jar:4.0.0.Final]
        at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:1080) ~[fcrepo-kernel-impl-4.0.0.jar:na]
        at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:977) ~[fcrepo-kernel-impl-4.0.0.jar:na]
        at org.modeshape.jcr.JcrRepository.doStart(JcrRepository.java:386) ~[fcrepo-kernel-impl-4.0.0.jar:na]
        at org.modeshape.jcr.JcrRepository.getStartupProblems(JcrRepository.java:295) ~[fcrepo-kernel-impl-4.0.0.jar:na]
        at org.fcrepo.kernel.impl.spring.ModeShapeRepositoryFactoryBean.buildRepository(ModeShapeRepositoryFactoryBean.java:73) ~[fcrepo-kernel-impl-4.0.0.jar:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_55]


Regards

Henry




Andrew Woods

unread,
Feb 20, 2015, 11:47:19 AM2/20/15
to gua...@ualberta.ca, fedora-community
Hello Henry,
My suspicion is that there is a permissions issue when Fedora tries to create files on disk. 

Could you try to restart your tomcat, but also provide the System Property that tells Fedora where you would like it to create files [1] (-Dfcrepo.home=<some-writable-directory>). You should be able to add "-Dfcrepo.home..." to the JAVA_OPTS in Tomcat's startup script or environment variables. Additional Tomcat details are included in the referenced link above.

If that does not work, please send a link to your full catalina.out file.

Thanks,
Andrew

--
You received this message because you are subscribed to the Google Groups "Fedora Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fedora-communi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Guanwen Zhang

unread,
Feb 20, 2015, 1:56:45 PM2/20/15
to Andrew Woods, fedora-community
yes. you are right. 

After I define the fedora data directory with right permission, it works like a charm now.

I am wondering if you could answer another question.

We used fedora 3.6.* before, it requires a database configuration such as MySQL. Looks like Fedora 4 doesn't need MySQL or other database before, is that correct? and why?

Thanks
Henry

Andrew Woods

unread,
Feb 23, 2015, 9:52:42 AM2/23/15
to Guanwen Zhang, fedora-community
Hello Henry,
The Fedora 4.x (F4) application stack and architecture has undergone a significant upgrade from Fedora 3.x (F3). As with F3, F4 is concerned with durably storing your binary resources (e.g. PDFs, images, etc) as well as the containers (previously known as "objects") that encapsulate the metadata describing and aggregating resources within the repository. 

The F4 application stack consists of custom Fedora code that exposes RESTful services with linked data patterns, which sits on top of the opensource JCR [1] implementation, ModeShape [2], which itself uses the opensource caching and persistence layer of Infinispan [3].

The default configuration of F4 stores the binary resources on the file system in a three-level, pairtree structure based on the SHA-1 of the resource. This configuration also uses an internal LevelDB [4] instance to manage the containers. Other database and persistence options [5] can be configured as desired.

Regards,
Andrew
Reply all
Reply to author
Forward
0 new messages