I have two standalone modules that use Camel's Main. Both of them contain:
main.setPropertyPlaceholderLocations( "classpath:application.properties" );
and I also tried:
main.setPropertyPlaceholderLocations( "application.properties" );
If I run them from within Eclipse both work fine (having added <project>/target to the Run Configurations' Classpath).
If I run them from the cmd line:
...\target> java -jar <module>.jar
with target containing both application.properties and <module>.jar, one works fine. The other results in:
Exception in thread "main" org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException:
Properties file application.properties not found in classpath
I've seen Q: Camel properties file not found in class path but my application.properties is in src/main/resources, and copied to target during mvn package.
UPDATE 1
For clarification. In my projects' POMs I use:
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>application.properties</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>application.properties</include>
</includes>
<targetPath>..</targetPath> <!-- relative to target/classes -->
</resource>
<resources>
to prevent application.properties residing inside <module>.jar.
UPDATE 2
90 [main] INFO <module> - Starting Camel...
182 [main] INFO org.apache.camel.impl.DefaultCamelContext - Apache Camel 2.22.0 (CamelContext: camel-1) is shutting down
195 [main] INFO org.apache.camel.impl.DefaultCamelContext - Apache Camel 2.22.0 (CamelContext: camel-1) uptime
198 [main] INFO org.apache.camel.impl.DefaultCamelContext - Apache Camel 2.22.0 (CamelContext: camel-1) is shutdown in 0.017 seconds
Exception in thread "main" org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: Properties file application.properties not found in classpath
at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1830)
at org.apache.camel.model.RouteDefinitionHelper.initRouteInputs(RouteDefinitionHelper.java:382)
at org.apache.camel.model.RouteDefinitionHelper.prepareRouteImp(RouteDefinitionHelper.java:298)
at org.apache.camel.model.RouteDefinitionHelper.prepareRoute(RouteDefinitionHelper.java:270)
at org.apache.camel.model.RoutesDefinition.route(RoutesDefinition.java:205)
at org.apache.camel.model.RoutesDefinition.from(RoutesDefinition.java:158)
at org.apache.camel.builder.RouteBuilder.from(RouteBuilder.java:169)
at <module>Route.configure(<module>Route.java:24)
at org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:462)
at org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:402)
at org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:383)
at org.apache.camel.impl.DefaultCamelContext$1.call(DefaultCamelContext.java:1029)
at org.apache.camel.impl.DefaultCamelContext$1.call(DefaultCamelContext.java:1026)
at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3272)
at org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:1026)
at org.apache.camel.main.MainSupport.postProcessCamelContext(MainSupport.java:612)
at org.apache.camel.main.MainSupport.postProcessContext(MainSupport.java:550)
at org.apache.camel.main.Main.doStart(Main.java:136)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.main.MainSupport.run(MainSupport.java:170)
at <module>.run(<module>.java:44)
at <module>.main(<module>.java:20)
Caused by: java.io.FileNotFoundException: Properties file application.properties not found in classpath
at org.apache.camel.component.properties.DefaultPropertiesResolver.loadPropertiesFromClasspath(DefaultPropertiesResolver.java:112)
at org.apache.camel.component.properties.DefaultPropertiesResolver.resolveProperties(DefaultPropertiesResolver.java:69)
at org.apache.camel.component.properties.PropertiesComponent.parseUri(PropertiesComponent.java:207)
at org.apache.camel.component.properties.PropertiesComponent.parseUri(PropertiesComponent.java:178)
at org.apache.camel.impl.DefaultCamelContext.resolvePropertyPlaceholders(DefaultCamelContext.java:2552)
at org.apache.camel.model.ProcessorDefinitionHelper.resolvePropertyPlaceholders(ProcessorDefinitionHelper.java:735)
at org.apache.camel.model.RouteDefinitionHelper.initRouteInputs(RouteDefinitionHelper.java:380)
... 20 more
204 [Camel Thread #0 - CamelHangupInterceptor] INFO org.apache.camel.main.MainSupport$HangupInterceptor - Received hang up - stopping the main instance.
Now I know why one module ran while the other didn't. Apparently Camel performs lazy loading after setPropertyPlaceholderLocations() and since I didn't use any property of application.properties (yet) it didn't even try to read the file.
Now that I'm using them the previously working module fails as well. (One of the rare cases where an error leads to truth. ;)
The solution is to use:
String jarPath = new File(
this.getClass().getProtectionDomain().getCodeSource().getLocation().toURI().getPath() )
.getParent();
main.setPropertyPlaceholderLocations("file:" + jarPath + "/application.properties" )
as commented by Claus a few hours ago, rather than:
main.setPropertyPlaceholderLocations("classpath:...")
Related
I am trying to migrate to JDO 3.0 in a cloud endpoint Framework 2.0 and Guice environment. I am using the datanucleus Eclipse plugin.
I checked the following documentation:
Using JDO 3.0 with App Engine
There is only a Ant or Maven docu. In my Gradle env, when starting the appengine standard server in eclipse, i get the error appended below.
Does anyone have a hint? Maybe the copytarget not set in Gradle build script correctly?
Sep 24, 2017 4:58:19 PM java.util.prefs.WindowsPreferences <init>
WARNUNG: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Sep 24, 2017 4:58:20 PM com.google.appengine.tools.development.SystemPropertiesManager setSystemProperties
INFORMATION: Overwriting system property key 'java.util.logging.config.file', value 'C:\Users\MMM\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\java\config\sdk\logging.properties' with value 'WEB-INF/logging.properties' from 'D:\workspaces\tatonlinews\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\justMapMeEndpoints\WEB-INF\appengine-web.xml'
Sep 24, 2017 4:58:20 PM com.google.apphosting.utils.jetty.JettyLogger info
INFORMATION: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
Sep 24, 2017 2:58:20 PM com.google.apphosting.utils.jetty.JettyLogger info
INFORMATION: jetty-6.1.x
log4j:WARN No appenders could be found for logger (DataNucleus.Plugin).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Sep 24, 2017 2:58:23 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNUNG: failed guiceFilter: com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error in custom provider, javax.jdo.JDOFatalUserException: A property named javax.jdo.PersistenceManagerFactoryClass must be specified, or a jar file with a META-INF/services/javax.jdo.PersistenceManagerFactory entry must be in the classpath, or a property named javax.jdo.option.PersistenceUnitName must be specified.
NestedThrowables:
javax.jdo.JDOException: Errors were encountered when initialising the specified MetaData. See the nested exceptions for details
NestedThrowables:
org.datanucleus.exceptions.NucleusUserException: Errors were encountered when initialising the specified MetaData. See the nested exceptions for details
at com.sky.tatOnline.server.guice.DispatchServletModule.getPersistenceManagerFactory(Unknown Source)
at com.sky.tatOnline.server.guice.DispatchServletModule.getPersistenceManagerFactory(Unknown Source)
while locating javax.jdo.PersistenceManagerFactory
for parameter 1 at com.sky.tatOnline.server.db.GAEDatastore.<init>(Unknown Source)
while locating com.sky.tatOnline.server.db.GAEDatastore
at com.sky.tatOnline.server.guice.DispatchServletModule.configureServlets(DispatchServletModule.java:92)
while locating com.sky.tatOnline.server.db.Datastore
for parameter 1 at com.sky.tatOnline.server.mapMeEndpoints.MapMeFriendsV1.<init>(Unknown Source)
while locating com.sky.tatOnline.server.mapMeEndpoints.MapMeFriendsV1
1 error
Sep 24, 2017 2:58:23 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNUNG: Failed startup of context com.google.appengine.tools.development.DevAppEngineWebAppContext#3c9bfddc{/,D:\workspaces\tatonlinews\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\justMapMeEndpoints}
com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error in custom provider, javax.jdo.JDOFatalUserException: A property named javax.jdo.PersistenceManagerFactoryClass must be specified, or a jar file with a META-INF/services/javax.jdo.PersistenceManagerFactory entry must be in the classpath, or a property named javax.jdo.option.PersistenceUnitName must be specified.
NestedThrowables:
javax.jdo.JDOException: Errors were encountered when initialising the specified MetaData. See the nested exceptions for details
NestedThrowables:
org.datanucleus.exceptions.NucleusUserException: Errors were encountered when initialising the specified MetaData. See the nested exceptions for details
at com.sky.tatOnline.server.guice.DispatchServletModule.getPersistenceManagerFactory(Unknown Source)
at com.sky.tatOnline.server.guice.DispatchServletModule.getPersistenceManagerFactory(Unknown Source)
while locating javax.jdo.PersistenceManagerFactory
for parameter 1 at com.sky.tatOnline.server.db.GAEDatastore.<init>(Unknown Source)
while locating com.sky.tatOnline.server.db.GAEDatastore
at com.sky.tatOnline.server.guice.DispatchServletModule.configureServlets(DispatchServletModule.java:92)
while locating com.sky.tatOnline.server.db.Datastore
for parameter 1 at com.sky.tatOnline.server.mapMeEndpoints.MapMeFriendsV1.<init>(Unknown Source)
while locating com.sky.tatOnline.server.mapMeEndpoints.MapMeFriendsV1
1 error
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025)
at com.google.inject.spi.ProviderLookup$1.get(ProviderLookup.java:104)
at com.google.api.server.spi.guice.ServiceMap.get(ServiceMap.java:69)
at com.google.api.server.spi.guice.GuiceEndpointsServlet.createService(GuiceEndpointsServlet.java:37)
at com.google.api.server.spi.EndpointsServlet.createSystemService(EndpointsServlet.java:128)
at com.google.api.server.spi.EndpointsServlet.init(EndpointsServlet.java:57)
at com.google.inject.servlet.ServletDefinition.init(ServletDefinition.java:121)
at com.google.inject.servlet.ManagedServletPipeline.init(ManagedServletPipeline.java:82)
at com.google.inject.servlet.ManagedFilterPipeline.initPipeline(ManagedFilterPipeline.java:103)
at com.google.inject.servlet.GuiceFilter.init(GuiceFilter.java:220)
at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:662)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:268)
at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:284)
at com.google.appengine.tools.development.AutomaticInstanceHolder.startUp(AutomaticInstanceHolder.java:26)
at com.google.appengine.tools.development.AbstractModule.startup(AbstractModule.java:87)
at com.google.appengine.tools.development.Modules.startup(Modules.java:105)
at com.google.appengine.tools.development.DevAppServerImpl.doStart(DevAppServerImpl.java:271)
at com.google.appengine.tools.development.DevAppServerImpl.access$000(DevAppServerImpl.java:47)
at com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:219)
at com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:217)
at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:359)
at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:47)
at com.google.appengine.tools.development.DevAppServerMain.run(DevAppServerMain.java:223)
at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:214)
Caused by: javax.jdo.JDOFatalUserException: A property named javax.jdo.PersistenceManagerFactoryClass must be specified, or a jar file with a META-INF/services/javax.jdo.PersistenceManagerFactory entry must be in the classpath, or a property named javax.jdo.option.PersistenceUnitName must be specified.
NestedThrowables:
javax.jdo.JDOException: Errors were encountered when initialising the specified MetaData. See the nested exceptions for details
NestedThrowables:
org.datanucleus.exceptions.NucleusUserException: Errors were encountered when initialising the specified MetaData. See the nested exceptions for details
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:861)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:1099)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:919)
at com.sky.tatOnline.server.guice.DispatchServletModule.getPersistenceManagerFactory(DispatchServletModule.java:164)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:128)
at com.google.inject.internal.ProviderMethod$ReflectionProviderMethod.doProvision(ProviderMethod.java:299)
at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:172)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:104)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:104)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
... 37 more
Caused by: javax.jdo.JDOException: Errors were encountered when initialising the specified MetaData. See the nested exceptions for details
NestedThrowables:
org.datanucleus.exceptions.NucleusUserException: Errors were encountered when initialising the specified MetaData. See the nested exceptions for details
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.initialiseMetaData(JDOPersistenceManagerFactory.java:611)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.<init>(JDOPersistenceManagerFactory.java:504)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:294)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:195)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:128)
at javax.jdo.JDOHelper$16.run(JDOHelper.java:1965)
at java.security.AccessController.doPrivileged(Native Method)
at javax.jdo.JDOHelper.invoke(JDOHelper.java:1960)
at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1166)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:844)
... 75 more
Caused by: org.datanucleus.exceptions.NucleusUserException: Errors were encountered when initialising the specified MetaData. See the nested exceptions for details
at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaDataForUse(MetaDataManager.java:1151)
at org.datanucleus.metadata.MetaDataManager.loadPersistenceUnit(MetaDataManager.java:986)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.initialiseMetaData(JDOPersistenceManagerFactory.java:601)
... 88 more
Caused by: org.datanucleus.exceptions.NucleusUserException: Found Meta-Data for class com.sky.tatOnline.server.db.entities.CountryBoundingBox but this class is not enhanced!! Please enhance the class before running DataNucleus.
at org.datanucleus.metadata.MetaDataManager.initialiseClassMetaData(MetaDataManager.java:2593)
at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaData(MetaDataManager.java:2544)
at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaDataForUse(MetaDataManager.java:1140)
... 90 more
Sep 24, 2017 2:58:23 PM com.google.apphosting.utils.jetty.JettyLogger info
INFORMATION: Started SelectChannelConnector#localhost:8080
Sep 24, 2017 2:58:23 PM com.google.appengine.tools.development.AbstractModule startup
INFORMATION: Module instance default is running at http://localhost:8080/
Sep 24, 2017 2:58:23 PM com.google.appengine.tools.development.AbstractModule startup
INFORMATION: The admin console is running at http://localhost:8080/_ah/admin
Sep 24, 2017 4:58:23 PM com.google.appengine.tools.development.DevAppServerImpl doStart
INFORMATION: Dev App Server is now running
Here is my gradle script:
buildscript { // Configuration for building
repositories {
jcenter() // Bintray's repository - a fast Maven Central mirror & more
mavenCentral()
}
dependencies {
classpath 'com.google.cloud.tools:appengine-gradle-plugin:+' // latest App Engine Gradle tasks
// Endpoints Frameworks Gradle plugin
classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:+'
}
}
repositories { // repositories for Jar's you access in your code
maven {
url 'https://maven-central.storage.googleapis.com' // Google's mirror of Maven Central
// url 'https://oss.sonatype.org/content/repositories/snapshots' // SNAPSHOT Repository (if needed)
}
jcenter()
mavenCentral()
}
apply plugin: 'java' // standard Java tasks
apply plugin: 'war' // standard Web Archive plugin
apply plugin: 'com.google.cloud.tools.appengine' // App Engine tasks
// [START apply_endpoints-framework-server]
apply plugin: 'com.google.cloud.tools.endpoints-framework-server'
// [END apply_endpoints-framework-server]
dependencies {
providedCompile group: 'javax.servlet', name: 'servlet-api', version:'2.5'
compile 'com.google.appengine:appengine:1.9.54'
compile 'com.google.appengine:appengine-jsr107cache:1.9.54'
// Add your dependencies here.
compile group: 'com.google.endpoints', name: 'endpoints-framework', version: '+'
compile group: 'com.google.inject', name: 'guice', version: '3.0', classifier: 'no_aop'
compile group: 'net.sf.jsr107cache', name: 'jsr107cache', version: '1.1'
//https://cloud.google.com/endpoints/docs/frameworks/java/adding-api-management
compile group: 'com.google.endpoints', name: 'endpoints-management-control-appengine', version: '1.0.0-beta.11'
compile group: 'com.google.endpoints', name: 'endpoints-framework-auth', version: '1.0.0-beta.11'
compile 'com.google.apis:google-api-services-storage:v1-rev110-1.22.0'
//GCM:
compile 'com.google.gcm:gcm-server:1.0.0'
compile 'io.jsonwebtoken:jjwt:0.6.0'
compile 'org.bouncycastle:bcprov-jdk16:1.45'
compile 'com.google.code.gson:gson:2.8.1'
//Facebook Authenticator:
compile 'com.google.gwt:gwt-servlet:2.7.0-rc1'
compile 'com.google.appengine:appengine-api-labs:1.7.4'
compile 'com.google.inject.extensions:guice-servlet:3.0'
compile 'com.google.inject:guice:4.0'
compile 'com.google.endpoints:endpoints-framework-guice:2.0.0-beta.4'
compile 'log4j:log4j:1.2.16'
// Persistence
compile 'org.ow2.asm:asm:4.0'
compile 'org.datanucleus:datanucleus-api-jpa:3.1.3'
compile 'org.datanucleus:datanucleus-api-jdo:3.1.3'
compile 'com.google.appengine.orm:datanucleus-appengine:2.1.2'
compile 'org.datanucleus:datanucleus-core:3.1.3'
compile 'org.apache.geronimo.specs:geronimo-jpa_2.0_spec:1.0'
compile 'javax.jdo:jdo-api:3.0.1'
compile 'javax.transaction:jta:1.1'
}
appengine { // App Engine tasks configuration
run { // local (dev_appserver) configuration (standard environments only)
port = 8080 // default
}
deploy { // deploy configuration
stopPreviousVersion = true // default - stop the current version
promote = true // default - & make this the current version
version = '90'
project = 'appname'
}
}
// [START endpoints-server]
endpointsServer {
// Endpoints Framework Plugin server-side configuration
hostname = "appname.appspot.com"
}
group = 'com.example.appengine' // Generated output GroupId
version = '1.0-SNAPSHOT' // Version in generated output
sourceCompatibility = 1.7 // App Engine Standard uses Java 7
targetCompatibility = 1.7 // App Engine Standard uses Java 7
here is my jdoconfig.xml:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig http://java.sun.com/xml/ns/jdo/jdoconfig_3_0.xsd">
<!-- xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig"> alte config-->
<persistence-manager-factory name="transactions-optional">
<property name="javax.jdo.PersistenceManagerFactoryClass" value="org.datanucleus.api.jdo.JDOPersistenceManagerFactory"/>
<property name="javax.jdo.option.ConnectionURL" value="appengine"/>
<property name="javax.jdo.option.NontransactionalRead" value="true"/>
<property name="javax.jdo.option.NontransactionalWrite" value="true"/>
<property name="javax.jdo.option.RetainValues" value="true"/>
<property name="datanucleus.appengine.autoCreateDatastoreTxns" value="true"/>
<property name="javax.jdo.option.DatastoreReadTimeoutMillis" value="5000"/>
<property name="javax.jdo.option.DatastoreWriteTimeoutMillis" value="10000"/>
<!-- https://cloud.google.com/appengine/docs/java/datastore/transactions
Using cross-group transactions in JDO and JPA
-->
<property name="datanucleus.appengine.datastoreEnableXGTransactions" value="true"/>
<!--
http://code.google.com/intl/de-DE/appengine/docs/java/datastore/overview.html#Datastore_Performance_Features
Do not use EVENTUAL consistency, because you can not read and write in a transaction
Default is strong Consistency, so the following property must not be defined!
<property name="datanucleus.appengine.datastoreReadConsistency" value="EVENTUAL" />-->
<!-- <property name="datanucleus.appengine.datastoreReadConsistency" value="STRONG " />-->
</persistence-manager-factory>
</jdoconfig>
and here is my datanucleus persistence.xml:
i trie the following folders where i put this file:
- src\main\webapp\META-INF\persistence.xml
- src\main\webapp\WEB-INF\classes\META-INF\persistence.xml
- src\main\java\META-INF\persistence.xml
<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
<persistence-unit name="transactions-optional">
<mapping-file>myclass.jdo</mapping-file>
</persistence-unit>
</persistence>
error message using datanucleus plugin v4. an v4 version of datanucleus.core.jar...
16:32:15,937 (main) WARN [DataNucleus.General] - Extension Point "org.datanucleus.implementation_creator" not registered, but plugin "org.datanucleus.enhancer" defined in file:/C:/Users/MMM/.gradle/caches/modules-2/files-2.1/org.datanucleus/datanucleus-enhancer/3.1.1/b141c67d55cc19f14639f091b84e692e2198dc50/datanucleus-enhancer-3.1.1.jar refers to it.
16:32:15,998 (main) ERROR [DataNucleus.Persistence] - User-defined type mapping class "org.datanucleus.store.types.sco.simple.Collection" was not found. Please check the mapping file class specifications and your CLASSPATH. The class must be in the CLASSPATH.
16:32:16,015 (main) ERROR [DataNucleus.Persistence] - User-defined type mapping class "org.datanucleus.store.types.sco.simple.List" was not found. Please check the mapping file class specifications and your CLASSPATH. The class must be in the CLASSPATH.
16:32:16,028 (main) ERROR [DataNucleus.Persistence] - User-defined type mapping class "org.datanucleus.store.types.sco.simple.Set" was not found. Please check the mapping file class specifications and your CLASSPATH. The class must be in the CLASSPATH.
16:32:16,064 (main) INFO [DataNucleus.Enhancer] - DataNucleus Enhancer (version 4.1.17) for API "JDO"
16:32:16,092 (main) ERROR [DataNucleus.MetaData] - Unknown tag : "faceted-project"
16:32:16,093 (main) ERROR [DataNucleus.MetaData] - An error occurred while parsing <"faceted-project"> nested within "
" for URI ""
java.lang.RuntimeException: Unknown tag : "faceted-project"
at org.datanucleus.api.jdo.metadata.JDOMetaDataHandler.startElement(JDOMetaDataHandler.java:1242)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:380)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:619)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3129)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:880)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:118)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:504)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
at org.datanucleus.metadata.xml.MetaDataParser.parseMetaDataStream(MetaDataParser.java:283)
at org.datanucleus.metadata.xml.MetaDataParser.parseMetaDataURL(MetaDataParser.java:144)
at org.datanucleus.api.jdo.metadata.JDOMetaDataManager.parseFile(JDOMetaDataManager.java:263)
at org.datanucleus.metadata.MetaDataManagerImpl.loadFiles(MetaDataManagerImpl.java:1426)
at org.datanucleus.metadata.MetaDataManagerImpl.loadMetadataFiles(MetaDataManagerImpl.java:522)
at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(DataNucleusEnhancer.java:731)
at org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:500)
at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1152)
Hi While working with MapReduceIndexerTool with solr 4.10 cloud, the code is successfully able to connect to Zookeeper, but while fetching the aliases.json, it fails to fetch the data. Below is the command and stack trace:
command:
hadoop --config /etc/hadoop/conf jar target/search-mr-*-job.jar org.apache.solr.hadoop.MapReduceIndexerTool -D 'mapred.child.java.opts=-Xmx500m' --log4j src/test/resources/log4j.properties --morphline-file /home/impadmin/app_quotes_morphline.conf --output-dir hdfs://impetus-i0056.impetus.co.in:8020/user/impadmin/MapReduceIndexerTool/output2 --zk-host 172.26.45.69:9983/solr --collection app.quotes hdfs://impetus-i0056.impetus.co.in:8020/apps/hive/warehouse/kst
stack trace:
WARNING: Use "yarn jar" to launch YARN applications.
1 [main] INFO org.apache.solr.common.cloud.SolrZkClient - Using default ZkCredentialsProvider
87 [main] INFO org.apache.solr.common.cloud.ConnectionManager - Waiting for client to connect to ZooKeeper
114 [main-EventThread] INFO org.apache.solr.common.cloud.ConnectionManager - Watcher org.apache.solr.common.cloud.ConnectionManager#1568159 name:ZooKeeperConnection Watcher:172.26.45.69:9983/solr got event WatchedEvent state:SyncConnected type:None path:null path:null type:None
115 [main] INFO org.apache.solr.common.cloud.ConnectionManager - Client is connected to ZooKeeper
115 [main] INFO org.apache.solr.common.cloud.SolrZkClient - Using default ZkACLProvider
Exception in thread "main" net.sourceforge.argparse4j.inf.ArgumentParserException: java.lang.IllegalArgumentException: Cannot find expected information for SolrCloud in ZooKeeper: 172.26.45.69:9983/solr
at org.apache.solr.hadoop.MapReduceIndexerTool.verifyZKStructure(MapReduceIndexerTool.java:1418)
at org.apache.solr.hadoop.MapReduceIndexerTool.run(MapReduceIndexerTool.java:716)
at org.apache.solr.hadoop.MapReduceIndexerTool.run(MapReduceIndexerTool.java:681)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
at org.apache.solr.hadoop.MapReduceIndexerTool.main(MapReduceIndexerTool.java:668)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: java.lang.IllegalArgumentException: Cannot find expected information for SolrCloud in ZooKeeper: 172.26.45.69:9983/solr
at org.apache.solr.hadoop.ZooKeeperInspector.extractDocCollection(ZooKeeperInspector.java:88)
at org.apache.solr.hadoop.ZooKeeperInspector.extractShardUrls(ZooKeeperInspector.java:56)
at org.apache.solr.hadoop.MapReduceIndexerTool.verifyZKStructure(MapReduceIndexerTool.java:1415)
... 10 more
Caused by: org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /aliases.json
at org.apache.zookeeper.KeeperException.create(KeeperException.java:111)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
at org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:1155)
at org.apache.solr.common.cloud.SolrZkClient$7.execute(SolrZkClient.java:351)
at org.apache.solr.common.cloud.SolrZkClient$7.execute(SolrZkClient.java:348)
at org.apache.solr.common.cloud.ZkCmdExecutor.retryOperation(ZkCmdExecutor.java:61)
at org.apache.solr.common.cloud.SolrZkClient.getData(SolrZkClient.java:348)
at org.apache.solr.hadoop.ZooKeeperInspector.checkForAlias(ZooKeeperInspector.java:164)
at org.apache.solr.hadoop.ZooKeeperInspector.extractDocCollection(ZooKeeperInspector.java:85)
... 12 more
Please help me to identify the root cause.
The issue was with the URL that was being hit to access zk solr configs. thus correcting the URL solved the issue. In case of embedded solr instance the URL does not have application solr available, but rather puts it directly under zk root.
I have solr clouds 5.2.1. I deploy solr and zookeeper. When I try to create a core this errors are throwing :
org.apache.solr.common.SolrException: Could not load conf for core contracts_shard1_replica1: Error loading solr config from solrconfig.xml
at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:78)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:635)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:611)
at org.apache.solr.handler.admin.CoreAdminHandler.handleCreateAction(CoreAdminHandler.java:628)
at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestInternal(CoreAdminHandler.java:213)
at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(CoreAdminHandler.java:193)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:143)
at org.apache.solr.servlet.HttpSolrCall.handleAdminRequest(HttpSolrCall.java:660)
at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:431)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:227)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:196)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
org.apache.solr.common.SolrException: Error CREATEing SolrCore 'contracts_shard1_replica1': Unable to create core [contracts_shard1_replica1] Caused by: Can't find resource 'solrconfig.xml' in classpath or '/configs/contracts', cwd=C:\CM_10.1.0\INDEXSERVER\searchserver-distribution\target\searchserver\solr\server
at org.apache.solr.handler.admin.CoreAdminHandler.handleCreateAction(CoreAdminHandler.java:661)
at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestInternal(CoreAdminHandler.java:213)
at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(CoreAdminHandler.java:193)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:143)
at org.apache.solr.servlet.HttpSolrCall.handleAdminRequest(HttpSolrCall.java:660)
at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:431)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:227)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:196)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
]
I created contracts inside of C:\CM_10.1.0\INDEXSERVER\searchserver-distribution\target\searchserver\solr\server and copied " conf" folder which is in solr\configsets\basic_configs" into contracts. But problem didn't solved.
I do need help to solve this problem. Does anyone help me?
Thanks
Since you are using the zookeeper, you must first send the config files to the zookeeper. I'm not sure how it is in Windows :P, but in Linux it would be:
cd /searchserver/solr/server/scripts/cloud-scripts
./zkcli.sh -cmd upconfig -confdir /searchserver/solr/server/solr/corename/conf -confname myconfname -z zoo1:2181,zoo2:2181,zoo3:2181
In Windows, use zkcli.bat in the same directory.
Another way to do this is by adding
SOLR_OPTS="$SOLR_OPTS -Dbootstrap_confdir=./solr/corename/conf/"
SOLR_OPTS="$SOLR_OPTS -Dcollection.configName=myconfname"
to the solr.in.sh file, then (re)starting solr. In Windows, the file is solr.in.cmd, and you add the following lines:
set SOLR_OPTS=%SOLR_OPTS% -Dbootstrap_confdir=./solr/corename/conf/
set SOLR_OPTS=%SOLR_OPTS% -Dcollection.configName=myconfname
The solr.in.sh/solr.in.cmd file is included into the solr (colr.cmd) command that you use to start the solr server. Myconfname above (in both methods) is an arbitrary name you give to indicate the sets of config files that you've added to the zookeeper. Then you can create the core using the collections API:
http://localhost:8983/solr/admin/collections?action=CREATE&name=coreName&numShards=2&shards=shard1,shard2&collection.configName=myconfname&createNodeSet=localhost:8983_solr
I am fairly new to groovy/grails and trying to deploy a grails app(WAR file) which uses Grails 2.1.1 and CXF plugin 1.0.1 to WebSphere 8.
This is the first time I am deploying Grails 2.1.1 app to WebSphere 8, with CXF plugin for SOAP based Web Services and I am running into some issues. Same app deploys and works fine locally on Tomcat and I am able to get to my web service and access WSDL file.
Anyone had this issues or know what could be the issue, please help. Here is the stack trace:
Original Exception:
Error Message: javax.servlet.ServletException: Filter [sitemesh]: could not be initialized
Error Code: 500
Target Servlet: CxfServlet
Error Stack:
com.opensymphony.module.sitemesh.factory.FactoryException: Could not initialize DecoratorMapper : org.codehaus.groovy.grails.web.sitemesh.GrailsLayoutDecoratorMapper: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'groovyPageLayoutFinder' is defined
at com.opensymphony.module.sitemesh.factory.BaseFactory.pushDecoratorMapper(BaseFactory.java:117)
at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.loadDecoratorMappers(Grails5535Factory.java:231)
at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.loadConfig(Grails5535Factory.java:98)
at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.<init>(Grails5535Factory.java:66)
at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.init(GrailsPageFilter.java:83)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:145)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:568)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:475)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper(WebAppFilterManager.java:308)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:380)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:892)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1025)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3704)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:962)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1659)
Root cause:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'groovyPageLayoutFinder' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:553)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1095)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:277)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1102)
at org.codehaus.groovy.grails.web.sitemesh.GrailsLayoutDecoratorMapper.init(GrailsLayoutDecoratorMapper.java:48)
at com.opensymphony.module.sitemesh.factory.BaseFactory.pushDecoratorMapper(BaseFactory.java:110)
at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.loadDecoratorMappers(Grails5535Factory.java:231)
at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.loadConfig(Grails5535Factory.java:98)
at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.<init>(Grails5535Factory.java:66)
at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.init(GrailsPageFilter.java:83)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:145)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:568)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:475)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper(WebAppFilterManager.java:308)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:380)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:892)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1025)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3704)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:962)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1659) a
Try to add the following to your BuildConfig.groovy to exclude the JAXB implementation and Apache serializer related libraries.
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
excludes ("serializer", "jaxb-impl")
}
...
}
Then rebuild your war to see if it works.
If everything is working fine on Tomcat, it sounds like a librairy conflict with IBM Websphere.
Be sure to configure the classloader to Parent last so that your application will override WAS librairy.
When i try to build (mvn) the slide-show plugin, i get error:
(see detaied stdout below)
mvn -e
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING] POM for 'org.kohsuke.stapler:maven-stapler-plugin:pom:1.15:runtime' is invalid.
Its dependencies (if any) will NOT be available to the current build.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.kohsuke.stapler:maven-stapler-plugin
POM Location: /home/kahmed/.m2/repository/org/kohsuke/stapler/maven-stapler-plugin/1.15/maven-stapler-plugin-1.15.pom
Reason: Not a v4.0.0 POM. for project org.kohsuke.stapler:maven-stapler-plugin at /home/kahmed/.m2/repository/org/kohsuke/stapler/maven-stapler-plugin/1.15/maven-stapler-plugin-1.15.pom
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unable to build project for plugin 'org.kohsuke.stapler:maven-stapler-plugin': Not a v4.0.0 POM. for project org.kohsuke.stapler:maven-stapler-plugin at /home/kahmed/.m2/repository/org/kohsuke/stapler/maven-stapler-plugin/1.15/maven-stapler-plugin-1.15.pom
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.loadPluginFully(DefaultLifecycleExecutor.java:1599)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.findArtifactTypeHandlersInPlugins(DefaultLifecycleExecutor.java:1468)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.findExtensions(DefaultLifecycleExecutor.java:222)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:178)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.InvalidPluginException: Unable to build project for plugin 'org.kohsuke.stapler:maven-stapler-plugin': Not a v4.0.0 POM. for project org.kohsuke.stapler:maven-stapler-plugin at /home/kahmed/.m2/repository/org/kohsuke/stapler/maven-stapler-plugin/1.15/maven-stapler-plugin-1.15.pom
at org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(DefaultPluginManager.java:293)
at org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(DefaultPluginManager.java:205)
at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:184)
at org.apache.maven.plugin.DefaultPluginManager.loadPluginFully(DefaultPluginManager.java:1626)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.loadPluginFully(DefaultLifecycleExecutor.java:1582)
... 15 more
Caused by: org.apache.maven.project.InvalidProjectModelException: Not a v4.0.0 POM. for project org.kohsuke.stapler:maven-stapler-plugin at /home/kahmed/.m2/repository/org/kohsuke/stapler/maven-stapler-plugin/1.15/maven-stapler-plugin-1.15.pom
at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1599)
at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1571)
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:562)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:251)
at org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(DefaultPluginManager.java:277)
... 19 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Mon Apr 16 00:32:26 EDT 2012
[INFO] Final Memory: 15M/182M
[INFO] ------------------------------------------------------------------------
I am getting this too (although its for the akuma artifact) and can explain why, but have not yet found a good solution. Both define a parent POM and a new repo:
<parent>
<groupId>org.kohsuke</groupId>
<artifactId>pom</artifactId>
<version>2</version>
</parent>
<repositories>
<repository>
<id>m.g.o-public</id>
<url>http://maven.glassfish.org/content/groups/public/</url>
</repository>
</repositories>
The URL for this glassfish maven repo gives a 301 to https://maven.glass... and for some reason, maven decides to download the body of that response as the POM. If you look in your ~/.m2/repository/org/kohsuke/pom/2/pom-2.pom, you should see something like:
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/0.6.39</center>
</body>
</html>
Manually looking at the glassfish repo, I do not even see the desired parent POM (at this time).
I hope this helps. If you are able to figure it out, please post back as this is as far as I have gotten so far!
I had this problem also, with a different POM from another project, and I was attempting to build with Maven 3.X. The simple solution was to install the most recent 2.X version of Maven. After that, it built fine. Being a Maven novice, It appears the URI format for REPOS differs between the 2 versions.
Simply install Maven 2.X (I used 2.2.1), and put it's "bin" directory first in your PATH env variable, and you should be good to go.