在 FreeBSD 上安装 Nexus

安装 JDK

cd /usr/ports/java/diablo-jdk16/ && make install clean

不能用 openjdk 呀,我测试了 openjdk-7.0.122_1,启动 nexus 会失败的:

log4j:WARN No appenders could be found for logger (org.sonatype.appcontext.AppContext).
log4j:WARN Please initialize the log4j system properly.
2011-04-13 06:48:49 INFO  [Thread-1       ] - org.sonatype.security.configuration.source.FileSecurityConfigurationSource - Loading Security configuration from /var/nexus/conf/security-configuration.xml
2011-04-13 06:48:49 INFO  [Thread-1       ] - org.sonatype.nexus.timeline.DefaultNexusTimeline - Initializing Nexus Timeline...
2011-04-13 06:48:50 INFO  [Thread-1       ] - org.sonatype.nexus.DefaultNexus - 
-------------------------------------------------

Initializing Nexus (OSS), Version 1.9.0.2

-------------------------------------------------
2011-04-13 06:48:50 INFO  [Thread-1       ] - org.sonatype.nexus.DefaultNexus - Activating locally installed plugins...
2011-04-13 06:48:51 INFO  [Thread-1       ] - org.sonatype.nexus.DefaultNexus - Plugin manager request "ACTIVATE" on plugin "org.sonatype.nexus.plugins:nexus-plugin-console-plugin:1.9.0.2" was successful.
2011-04-13 06:48:51 INFO  [Thread-1       ] - org.sonatype.nexus.DefaultNexus - Plugin manager request "ACTIVATE" on plugin "org.sonatype.nexus.plugins:nexus-indexer-lucene-plugin:1.9.0.2" was successful.
2011-04-13 06:48:51 INFO  [Thread-1       ] - org.sonatype.nexus.DefaultNexus - Plugin manager request "ACTIVATE" on plugin "org.sonatype.nexus.plugins:nexus-rrb-plugin:1.9.0.2" was successful.
2011-04-13 06:48:51 INFO  [Thread-1       ] - org.sonatype.nexus.DefaultNexus - Plugin manager request "ACTIVATE" on plugin "org.sonatype.nexus.plugins:nexus-core-documentation-plugin:1.9.0.2" was successful.
2011-04-13 06:48:51 INFO  [Thread-1       ] - org.sonatype.nexus.DefaultNexus - Plugin manager request "ACTIVATE" on plugin "org.sonatype.nexus.plugins.ldap:nexus-ldap-realm-plugin:1.9.0.2" was successful.
2011-04-13 06:48:51 INFO  [Thread-1       ] - org.sonatype.plexus.components.ehcache.DefaultEhCacheWrapper - Creating and configuring EHCache manager with classpath:/ehcache.xml, using disk store 'none'
2011-04-13 06:48:51 INFO  [Thread-1       ] - org.sonatype.nexus.configuration.application.DefaultNexusConfiguration - Loading Nexus Configuration...
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.sonatype.nexus.configuration.source.StaticConfigurationSource - Configuration loaded succesfully.
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.sonatype.nexus.configuration.source.FileConfigurationSource - Loading Nexus configuration from /var/nexus/conf/nexus.xml
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.sonatype.nexus.configuration.source.FileConfigurationSource - Configuration loaded succesfully.
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.sonatype.nexus.configuration.validator.DefaultApplicationConfigurationValidator - Nexus configuration validated succesfully.
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.sonatype.nexus.configuration.application.DefaultNexusConfiguration - Applying Nexus Configuration...
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.sonatype.security.configuration.source.FileSecurityConfigurationSource - Loading Security configuration from /var/nexus/conf/security-configuration.xml
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.apache.shiro.cache.ehcache.EhCacheManager - Cache with name 'org.sonatype.security.realms.XmlAuthenticatingRealm.authorizationCache' does not yet exist.  Creating now.
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.apache.shiro.cache.ehcache.EhCacheManager - Added EhCache named [org.sonatype.security.realms.XmlAuthenticatingRealm.authorizationCache]
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.apache.shiro.cache.ehcache.EhCacheManager - Cache with name 'org.sonatype.security.realms.XmlAuthorizingRealm.authorizationCache.1' does not yet exist.  Creating now.
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.apache.shiro.cache.ehcache.EhCacheManager - Added EhCache named [org.sonatype.security.realms.XmlAuthorizingRealm.authorizationCache.1]
2011-04-13 06:48:52 INFO  [Thread-1       ] - org.sonatype.nexus.proxy.registry.DefaultRepositoryTypeRegistry - Registered default repository types.
2011-04-13 06:48:52 WARN  [Thread-1       ] - org.codehaus.plexus.PlexusContainer - Error starting: class org.sonatype.nexus.DefaultNexus
org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException: Could not start Nexus!
	at org.sonatype.nexus.DefaultNexus.start(DefaultNexus.java:652)
	at org.codehaus.plexus.PlexusLifecycleManager.start(PlexusLifecycleManager.java:283)
	at org.codehaus.plexus.PlexusLifecycleManager.manageLifecycle(PlexusLifecycleManager.java:234)
	at org.codehaus.plexus.PlexusLifecycleManager.manage(PlexusLifecycleManager.java:134)
	at org.sonatype.guice.plexus.binders.PlexusBeanBinder.afterInjection(PlexusBeanBinder.java:79)
	at com.google.inject.internal.MembersInjectorImpl.notifyListeners(MembersInjectorImpl.java:97)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:95)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:253)
	at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:949)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1002)
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:945)
	at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:984)
	at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1002)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:59)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:949)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:995)
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:945)
	at org.sonatype.guice.bean.locators.LazyQualifiedBean.getValue(LazyQualifiedBean.java:66)
	at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:54)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:247)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:239)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:233)
	at org.sonatype.nexus.web.NexusBooterListener.contextInitialized(NexusBooterListener.java:48)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4521)
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5004)
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:4999)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:732)
Caused by: com.thoughtworks.xstream.converters.ConversionException: Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
---- Debugging information ----
message             : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
cause-exception     : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
cause-message       : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
class               : org.sonatype.nexus.configuration.model.CRepository
required-type       : org.codehaus.plexus.util.xml.Xpp3Dom
path                : /org.sonatype.nexus.configuration.model.CRepository/externalConfiguration
line number         : 23
-------------------------------
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:89)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:246)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:218)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:162)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:137)
	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:33)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:923)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:909)
	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:853)
	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:845)
	at org.sonatype.nexus.configuration.model.AbstractRevertableConfiguration.copyObject(AbstractRevertableConfiguration.java:103)
	at org.sonatype.nexus.configuration.model.AbstractRevertableConfiguration.getConfiguration(AbstractRevertableConfiguration.java:46)
	at org.sonatype.nexus.configuration.model.CRepositoryCoreConfiguration.getConfiguration(CRepositoryCoreConfiguration.java:57)
	at org.sonatype.nexus.proxy.repository.ConfigurableRepository.getCurrentConfiguration(ConfigurableRepository.java:42)
	at org.sonatype.nexus.proxy.repository.ConfigurableRepository.getCurrentConfiguration(ConfigurableRepository.java:34)
	at org.sonatype.nexus.configuration.AbstractConfigurable.configure(AbstractConfigurable.java:171)
	at org.sonatype.nexus.configuration.application.runtime.DefaultApplicationRuntimeConfigurationBuilder.createRepositoryFromModel(DefaultApplicationRuntimeConfigurationBuilder.java:51)
	at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.instantiateRepository(DefaultNexusConfiguration.java:515)
	at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.createRepositories(DefaultNexusConfiguration.java:481)
	at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.createInternals(DefaultNexusConfiguration.java:463)
	at org.sonatype.nexus.DefaultNexus.startService(DefaultNexus.java:686)
	at org.sonatype.nexus.DefaultNexus.start(DefaultNexus.java:648)
	... 35 more
Caused by: com.thoughtworks.xstream.converters.reflection.ObjectAccessException: Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.newInstance(PureJavaReflectionProvider.java:71)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.instantiateNewInstance(AbstractReflectionConverter.java:308)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:161)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
	... 62 more
2011-04-13 06:48:52 ERROR [Thread-1       ] - org.sonatype.guice.bean.reflect.NamedClass - Error injecting: org.sonatype.nexus.DefaultNexus
com.google.inject.ProvisionException: Guice provision errors:

1) Error starting: class org.sonatype.nexus.DefaultNexus
  while locating org.sonatype.nexus.DefaultNexus

1 error
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:958)
	at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:984)
	at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1002)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:59)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:949)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:995)
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:945)
	at org.sonatype.guice.bean.locators.LazyQualifiedBean.getValue(LazyQualifiedBean.java:66)
	at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:54)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:247)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:239)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:233)
	at org.sonatype.nexus.web.NexusBooterListener.contextInitialized(NexusBooterListener.java:48)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4521)
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5004)
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:4999)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:732)
Caused by: org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException: Could not start Nexus!
	at org.sonatype.nexus.DefaultNexus.start(DefaultNexus.java:652)
	at org.codehaus.plexus.PlexusLifecycleManager.start(PlexusLifecycleManager.java:283)
	at org.codehaus.plexus.PlexusLifecycleManager.manageLifecycle(PlexusLifecycleManager.java:234)
	at org.codehaus.plexus.PlexusLifecycleManager.manage(PlexusLifecycleManager.java:134)
	at org.sonatype.guice.plexus.binders.PlexusBeanBinder.afterInjection(PlexusBeanBinder.java:79)
	at com.google.inject.internal.MembersInjectorImpl.notifyListeners(MembersInjectorImpl.java:97)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:95)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:253)
	at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:949)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1002)
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:945)
	... 25 more
Caused by: com.thoughtworks.xstream.converters.ConversionException: Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
---- Debugging information ----
message             : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
cause-exception     : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
cause-message       : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
class               : org.sonatype.nexus.configuration.model.CRepository
required-type       : org.codehaus.plexus.util.xml.Xpp3Dom
path                : /org.sonatype.nexus.configuration.model.CRepository/externalConfiguration
line number         : 23
-------------------------------
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:89)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:246)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:218)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:162)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:137)
	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:33)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:923)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:909)
	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:853)
	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:845)
	at org.sonatype.nexus.configuration.model.AbstractRevertableConfiguration.copyObject(AbstractRevertableConfiguration.java:103)
	at org.sonatype.nexus.configuration.model.AbstractRevertableConfiguration.getConfiguration(AbstractRevertableConfiguration.java:46)
	at org.sonatype.nexus.configuration.model.CRepositoryCoreConfiguration.getConfiguration(CRepositoryCoreConfiguration.java:57)
	at org.sonatype.nexus.proxy.repository.ConfigurableRepository.getCurrentConfiguration(ConfigurableRepository.java:42)
	at org.sonatype.nexus.proxy.repository.ConfigurableRepository.getCurrentConfiguration(ConfigurableRepository.java:34)
	at org.sonatype.nexus.configuration.AbstractConfigurable.configure(AbstractConfigurable.java:171)
	at org.sonatype.nexus.configuration.application.runtime.DefaultApplicationRuntimeConfigurationBuilder.createRepositoryFromModel(DefaultApplicationRuntimeConfigurationBuilder.java:51)
	at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.instantiateRepository(DefaultNexusConfiguration.java:515)
	at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.createRepositories(DefaultNexusConfiguration.java:481)
	at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.createInternals(DefaultNexusConfiguration.java:463)
	at org.sonatype.nexus.DefaultNexus.startService(DefaultNexus.java:686)
	at org.sonatype.nexus.DefaultNexus.start(DefaultNexus.java:648)
	... 35 more
Caused by: com.thoughtworks.xstream.converters.reflection.ObjectAccessException: Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.newInstance(PureJavaReflectionProvider.java:71)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.instantiateNewInstance(AbstractReflectionConverter.java:308)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:161)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
	... 62 more
2011-04-13 06:48:52 ERROR [Thread-1       ] - org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/nexus] - Exception sending context initialized event to listener instance of class org.sonatype.nexus.web.NexusBooterListener
java.lang.IllegalStateException: Could not initialize Nexus.
	at org.sonatype.nexus.web.NexusBooterListener.contextInitialized(NexusBooterListener.java:58)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4521)
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5004)
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:4999)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:732)
Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting: org.sonatype.nexus.DefaultNexus
  at ClassRealm[plexus.core, parent: null]
  at ClassRealm[plexus.core, parent: null]
  while locating org.sonatype.nexus.Nexus

1 error
      role: org.sonatype.nexus.Nexus
  roleHint: 
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:251)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:239)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:233)
	at org.sonatype.nexus.web.NexusBooterListener.contextInitialized(NexusBooterListener.java:48)
	... 8 more
Caused by: com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting: org.sonatype.nexus.DefaultNexus
  at ClassRealm[plexus.core, parent: null]
  at ClassRealm[plexus.core, parent: null]
  while locating org.sonatype.nexus.Nexus

1 error
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:958)
	at org.sonatype.guice.bean.locators.LazyQualifiedBean.getValue(LazyQualifiedBean.java:66)
	at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:54)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:247)
	... 11 more
Caused by: com.google.inject.ProvisionException: Guice provision errors:

1) Error starting: class org.sonatype.nexus.DefaultNexus
  while locating org.sonatype.nexus.DefaultNexus

1 error
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:958)
	at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:984)
	at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1002)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:59)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:949)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:995)
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:945)
	... 14 more
Caused by: org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException: Could not start Nexus!
	at org.sonatype.nexus.DefaultNexus.start(DefaultNexus.java:652)
	at org.codehaus.plexus.PlexusLifecycleManager.start(PlexusLifecycleManager.java:283)
	at org.codehaus.plexus.PlexusLifecycleManager.manageLifecycle(PlexusLifecycleManager.java:234)
	at org.codehaus.plexus.PlexusLifecycleManager.manage(PlexusLifecycleManager.java:134)
	at org.sonatype.guice.plexus.binders.PlexusBeanBinder.afterInjection(PlexusBeanBinder.java:79)
	at com.google.inject.internal.MembersInjectorImpl.notifyListeners(MembersInjectorImpl.java:97)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:95)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:253)
	at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:949)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1002)
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:945)
	... 25 more
Caused by: com.thoughtworks.xstream.converters.ConversionException: Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
---- Debugging information ----
message             : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
cause-exception     : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
cause-message       : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
class               : org.sonatype.nexus.configuration.model.CRepository
required-type       : org.codehaus.plexus.util.xml.Xpp3Dom
path                : /org.sonatype.nexus.configuration.model.CRepository/externalConfiguration
line number         : 23
-------------------------------
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:89)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:246)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:218)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:162)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:137)
	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:33)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:923)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:909)
	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:853)
	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:845)
	at org.sonatype.nexus.configuration.model.AbstractRevertableConfiguration.copyObject(AbstractRevertableConfiguration.java:103)
	at org.sonatype.nexus.configuration.model.AbstractRevertableConfiguration.getConfiguration(AbstractRevertableConfiguration.java:46)
	at org.sonatype.nexus.configuration.model.CRepositoryCoreConfiguration.getConfiguration(CRepositoryCoreConfiguration.java:57)
	at org.sonatype.nexus.proxy.repository.ConfigurableRepository.getCurrentConfiguration(ConfigurableRepository.java:42)
	at org.sonatype.nexus.proxy.repository.ConfigurableRepository.getCurrentConfiguration(ConfigurableRepository.java:34)
	at org.sonatype.nexus.configuration.AbstractConfigurable.configure(AbstractConfigurable.java:171)
	at org.sonatype.nexus.configuration.application.runtime.DefaultApplicationRuntimeConfigurationBuilder.createRepositoryFromModel(DefaultApplicationRuntimeConfigurationBuilder.java:51)
	at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.instantiateRepository(DefaultNexusConfiguration.java:515)
	at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.createRepositories(DefaultNexusConfiguration.java:481)
	at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.createInternals(DefaultNexusConfiguration.java:463)
	at org.sonatype.nexus.DefaultNexus.startService(DefaultNexus.java:686)
	at org.sonatype.nexus.DefaultNexus.start(DefaultNexus.java:648)
	... 35 more
Caused by: com.thoughtworks.xstream.converters.reflection.ObjectAccessException: Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.newInstance(PureJavaReflectionProvider.java:71)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.instantiateNewInstance(AbstractReflectionConverter.java:308)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:161)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
	... 62 more
2011-04-13 06:48:52 ERROR [main           ] - org.apache.catalina.core.StandardContext - Error listenerStart
2011-04-13 06:48:52 ERROR [main           ] - org.apache.catalina.core.StandardContext - Context [/nexus] startup failed due to previous errors
2011-04-13 06:48:53 INFO  [Thread-2       ] - org.sonatype.nexus.index.DefaultIndexerManager - Shutting down Nexus IndexerManager
2011-04-13 06:48:53 INFO  [Thread-2       ] - org.sonatype.plexus.components.ehcache.DefaultEhCacheWrapper - Shutting down EHCache manager.
2011-04-13 06:48:53 INFO  [Thread-2       ] - org.sonatype.nexus.DefaultNexus - Stopped Nexus (version 1.9.0.2 OSS)
2011-04-13 06:48:56,061 INFO  NutchBean - creating new bean
2011-04-13 06:48:56,733 INFO  SearchBean - opening merged index in /usr/home/sutra/search/nutch-1.0/crawl/index
2011-04-13 06:48:57,256 INFO  PluginRepository - Plugins: looking in: /usr/local/apache-tomcat-7.0/webapps/nutch/WEB-INF/classes/plugins
2011-04-13 06:48:57,670 INFO  PluginRepository - Plugin Auto-activation mode: [true]
2011-04-13 06:48:57,670 INFO  PluginRepository - Registered Plugins:
2011-04-13 06:48:57,670 INFO  PluginRepository - 	Pdf Parse Plug-in (parse-pdf)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	Http / Https Protocol Plug-in (protocol-httpclient)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	Jakarta POI - Java API To Access Microsoft Format Files (lib-jakarta-poi)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	HTTP Framework (lib-http)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	MSWord Parse Plug-in (parse-msword)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	Regex URL Filter (urlfilter-regex)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	XML Libraries (lib-xml)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	MSExcel Parse Plug-in (parse-msexcel)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	OPIC Scoring Plug-in (scoring-opic)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	Zip Parse Plug-in (parse-zip)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	URL Query Filter (query-url)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	Parse MS Documents Framework (lib-parsems)
2011-04-13 06:48:57,670 INFO  PluginRepository - 	Regex URL Filter Framework (lib-regex-filter)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	the nutch core extension points (nutch-extensionpoints)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	MSPowerPoint Parse Plug-in (parse-mspowerpoint)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Basic Query Filter (query-basic)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Basic URL Normalizer (urlnormalizer-basic)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	RSS Parse Plug-in (parse-rss)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Html Parse Plug-in (parse-html)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Basic Indexing Filter (index-basic)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Basic Summarizer Plug-in (summary-basic)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Site Query Filter (query-site)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Text Parse Plug-in (parse-text)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Pass-through URL Normalizer (urlnormalizer-pass)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Regex URL Normalizer (urlnormalizer-regex)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	CyberNeko HTML Parser (lib-nekohtml)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	OpenOffice/OpenDocument Parse Plug-in (parse-oo)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	JavaScript Parser (parse-js)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	SWF Parse Plug-in (parse-swf)
2011-04-13 06:48:57,671 INFO  PluginRepository - Registered Extension-Points:
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Nutch Summarizer (org.apache.nutch.searcher.Summarizer)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Nutch Protocol (org.apache.nutch.protocol.Protocol)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Nutch Analysis (org.apache.nutch.analysis.NutchAnalyzer)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Nutch Field Filter (org.apache.nutch.indexer.field.FieldFilter)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	HTML Parse Filter (org.apache.nutch.parse.HtmlParseFilter)
2011-04-13 06:48:57,671 INFO  PluginRepository - 	Nutch Query Filter (org.apache.nutch.searcher.QueryFilter)
2011-04-13 06:48:57,672 INFO  PluginRepository - 	Nutch Search Results Response Writer (org.apache.nutch.searcher.response.ResponseWriter)
2011-04-13 06:48:57,672 INFO  PluginRepository - 	Nutch URL Normalizer (org.apache.nutch.net.URLNormalizer)
2011-04-13 06:48:57,672 INFO  PluginRepository - 	Nutch URL Filter (org.apache.nutch.net.URLFilter)
2011-04-13 06:48:57,672 INFO  PluginRepository - 	Nutch Online Search Results Clustering Plugin (org.apache.nutch.clustering.OnlineClusterer)
2011-04-13 06:48:57,672 INFO  PluginRepository - 	Nutch Indexing Filter (org.apache.nutch.indexer.IndexingFilter)
2011-04-13 06:48:57,672 INFO  PluginRepository - 	Nutch Content Parser (org.apache.nutch.parse.Parser)
2011-04-13 06:48:57,672 INFO  PluginRepository - 	Nutch Scoring (org.apache.nutch.scoring.ScoringFilter)
2011-04-13 06:48:57,672 INFO  PluginRepository - 	Ontology Model Loader (org.apache.nutch.ontology.Ontology)
2011-04-13 06:48:57,697 INFO  Configuration - found resource common-terms.utf8 at file:/usr/local/apache-tomcat-7.0/webapps/nutch/WEB-INF/classes/common-terms.utf8
2011-04-13 06:48:57,758 INFO  SummarizerFactory - Using the first summarizer extension found: Basic Summarizer

安装 Tomcat

cd /usr/ports/www/tomcat7/ && make install clean

下载 Nexus

fetch http://nexus.sonatype.org/downloads/nexus-webapp-1.9.0.2.war
mv nexus-webapp-1.9.0.2.war /usr/local/apache-tomcat-7.0/webapps/nexus.war

安装配置 Apache

安装 Apache 作为 Tomcat 的前端,虽然这不是必须的,但我们常常需要 Apache 来运行其它的应用,并共享一个 80 端口,比如 TracSubversion等。

cd /usr/ports/www/apache22/ && make install clean

注意勾选 PROXY_AJP 。
配置文件 httpd.conf 或者其 include 的文件中添加

ProxyPass /nexus ajp://localhost:8009/nexus
ProxyPassReverse /nexus ajp://localhost:8009/nexus
<Location /nexus>
    SetEnv no-gzip
</Location>

注意这里一定要加上 no-gzip 否则,用浏览器查看就会看到又如压缩文件被记事本打开了的乱码样的网页。这是因为 Nexus 默认会把 HTTP Resposne 压缩,然后如果 apache 也配置了压缩的话,apache 又会把 response 给压缩一遍,而到浏览器那端只会解压缩一次。所以告诉 apache 不要压缩。

启动 Tomcat 和 Apache

首先让 tomcat 和 apache 设置为开机自动启动吧:

/usr/local/etc/rc.d/tomcat7 rcvar | sed s/NO/YES/ >> /etc/rc.conf
/usr/local/etc/rc.d/apache22 rcvar | sed s/NO/YES/ >> /etc/rc.conf

还要配置下 tomcat 启动参数,让 nexus 把配置数据之类的都放到 /var/nexus 目录里去,在 /etc/rc.conf 里添加下面一行:

tomcat7_java_opts="-Dplexus.nexus-work=/var/nexus"

并且给它创建好 /var/nexus 这个目录:

mkdir /var/nexus && chown www:www /var/nexus

然后启动它们:

/usr/local/etc/rc.d/tomcat7 start
apachectl start

使用方法

浏览器访问

http://localhost/nexus

Maven使用

修改 ~/.m2/settings.xml,添加一个mirror:

<mirror>
    <id>mynexus</id>
    <name>mynexus</name>
    <url>http://localhost/content/groups/public</url>
    <mirrorOf>central</mirrorOf>
</mirror>
Advertisements

#apache-http-server, #freebsd, #maven, #nexus, #tomcat

FreeBSD 下 Tomcat 6 安装 apr 支持(tomcat-native)

转载请注明:
作者:Sutra

Tomcat 可以使用 apr 来提供更好的伸缩性、性能和集成到本地服务器技术。

在进行下面的操作之前,请先通过 ports 安装好 apr(/usr/ports/devel/apr)、Tomcat6(/usr/ports/www/tomcat6)。
并在 /etc/rc.conf 中添加 tomcat60_enable="YES"。

启动 tomcat
# /usr/local/etc/rc.d/tomcat6 start

默认情况下按照好了 Tomcat 6,启动时会在 /usr/local/apache-tomcat6.0/logs/stdout.log 里出现下面的日志:

INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/local/diablo-jdk1.5.0/jre/lib/i386/client:/usr/local/diablo-jdk1.5.0/jre/lib/i386:/usr/local/diablo-jdk1.5.0/jre/../lib/i386:/usr/lib:/usr/local/lib

下面就来安装 tomcat-native,

# cd /usr/local/apache-tomcat6.0/bin
# tar xvf tomcat-native.tar.gz
# cd ./tomcat-native-1.1.10-src/jni/native/

# setenv JAVA_HOME /usr/local/diablo-jdk1.5.0/
# ./configure –with-apr=/usr/local
# make
# make install

安装好了之后会有个提示:
———————————————————————-
Libraries have been installed in:
/usr/local/apr/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR’
flag during linking and do at least one of the following:
– add LIBDIR to the `LD_LIBRARY_PATH’ environment variable
during execution
– add LIBDIR to the `LD_RUN_PATH’ environment variable
during linking
– use the `-Wl,–rpath -Wl,LIBDIR’ linker flag

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
———————————————————————-

安装后多出一个目录 /usr/local/apr
然后安装上面的提示操作一下就好了,我这里用的 link 的方式:
# ln -s /usr/local/apr/lib/libtcnative-1.so /usr/local/diablo-jdk1.5.0/jre/lib/i386/libtcnative-1.so

再重启 tomcat,
# /usr/local/etc/rc.d/tomcat6 restart

再看 tomcat 的日志:
# cat /usr/local/apache-tomcat6.0/logs/stdout.log

Aug 6, 2007 11:40:01 PM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded Apache Tomcat Native library 1.1.10.
Aug 6, 2007 11:40:01 PM org.apache.catalina.core.AprLifecycleListener init
……

嗯,看起来安装成功了。
更多信息和其它的配置还是去看 http://tomcat.apache.org/tomcat-6.0-doc/apr.html 吧。

#apr, #tomcat