OSGI Dependency issue with commons logging on 3.x

760 views
Skip to first unread message

Falzone, Chris

unread,
Jul 7, 2015, 1:57:31 PM7/7/15
to dot...@googlegroups.com
I am running into an issue trying to use a library in my OSGI plugin that requires commons-logging as a dependency.

Has anyone run into this and what can I do to resolve it?  Or has anyone gotten a working SOAP Client deployed on dotCMS in an OSGI plugin?  It seems every library I use has some weird dependance issue I can't figure out.  Tried Axis, Axis2, JAX_WS, and now JAXB.

The internet seems to think this is because there are 2 versions on commons-logging in the classloader. I tried telling gradle that commons-logging was provided but it still embeds it as a dependency.  

ERROR: Bundle com.aquent.dotcms.osgi [15] Error starting/stopping bundle. (com.dotcms.repackage.org.osgi.framework.BundleException: Activator start error in bundle com.aquent.dotcms.osgi [15].)
org.apache.commons.logging.LogConfigurationException: User-specified log class 'org.apache.commons.logging.impl.Log4JLogger' cannot be found or is not useable.
at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:804)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:541)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:292)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:269)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:657)
at org.springframework.ws.client.core.support.WebServiceGatewaySupport.<init>(WebServiceGatewaySupport.java:56)
at com.aquent.ws.JobPostingServiceClient.<init>(JobPostingServiceClient.java:8)
at com.aquent.osgi.AquentActivator.start(AquentActivator.java:92)
at com.dotcms.repackage.org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
at com.dotcms.repackage.org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
at com.dotcms.repackage.org.apache.felix.framework.Felix.startBundle(Felix.java:2064)
at com.dotcms.repackage.org.apache.felix.framework.Felix.setBundleStartLevel(Felix.java:1483)
at com.dotcms.repackage.org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:334)
at java.lang.Thread.run(Thread.java:745)


Thanks!

--

Christopher Falzone

Interactive Developer


A Q U E N T

Digital, Creative, and Marketing Talent


aquent.com

cfal...@aquent.com

Jason Tesser

unread,
Jul 7, 2015, 2:01:34 PM7/7/15
to dot...@googlegroups.com
ok so lets start with the basics here. 

I think you are saying commons-logging is being provided. 
Are you providing log4j as well?  

--
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
Visit this group at http://groups.google.com/group/dotcms.
For more options, visit https://groups.google.com/d/optout.

Falzone, Chris

unread,
Jul 7, 2015, 3:12:34 PM7/7/15
to dot...@googlegroups.com
slf4j is getting included but not log4j

Jason Tesser

unread,
Jul 7, 2015, 3:16:28 PM7/7/15
to dot...@googlegroups.com
include it 

Falzone, Chris

unread,
Jul 7, 2015, 3:24:30 PM7/7/15
to dot...@googlegroups.com
Maybe closer, at least a different thing to look for now: 

log4j:ERROR A "com.dotcms.repackage.org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [com.aquent.dotcms.osgi [16]] whereas object of type 
log4j:ERROR "com.dotcms.repackage.org.apache.log4j.ConsoleAppender" was loaded by [WebappClassLoader
  context: ROOT
  delegate: true
----------> Parent Classloader:
java.net.URLClassLoader@31befd9f
].
log4j:ERROR Could not instantiate appender named "CONSOLE".
Error while starting bundle: file:/data/wwwroot/dotcms/dotcms_3.2/dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/felix/load/dotcms-osgi-1.11.0-SNAPSHOT.jar: com.dotcms.repackage.org.osgi.framework.BundleException: Activator start error in bundle com.aquent.dotcms.osgi [16].
com.dotcms.repackage.org.osgi.framework.BundleException: Activator start error in bundle com.aquent.dotcms.osgi [16].
at com.dotcms.repackage.org.apache.felix.framework.Felix.activateBundle(Felix.java:2196)
at com.dotcms.repackage.org.apache.felix.framework.Felix.startBundle(Felix.java:2064)
at com.dotcms.repackage.org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1175)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1153)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:458)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:263)
Caused by: java.lang.NoClassDefFoundError: javax/xml/soap/MessageFactory
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getConstructor0(Class.java:3075)
at java.lang.Class.getDeclaredConstructor(Class.java:2178)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:105)
at org.springframework.ws.support.DefaultStrategiesHelper.instantiateBean(DefaultStrategiesHelper.java:152)
at org.springframework.ws.support.DefaultStrategiesHelper.getDefaultStrategies(DefaultStrategiesHelper.java:134)
at org.springframework.ws.support.DefaultStrategiesHelper.getDefaultStrategy(DefaultStrategiesHelper.java:219)
at org.springframework.ws.support.DefaultStrategiesHelper.getDefaultStrategy(DefaultStrategiesHelper.java:203)
at org.springframework.ws.client.core.WebServiceTemplate.initMessageFactory(WebServiceTemplate.java:353)
at org.springframework.ws.client.core.WebServiceTemplate.initDefaultStrategies(WebServiceTemplate.java:342)
at org.springframework.ws.client.core.WebServiceTemplate.<init>(WebServiceTemplate.java:130)
at org.springframework.ws.client.core.support.WebServiceGatewaySupport.<init>(WebServiceGatewaySupport.java:65)
at com.aquent.ws.JobPostingServiceClient.<init>(JobPostingServiceClient.java:8)
at com.aquent.osgi.AquentActivator.start(AquentActivator.java:92)
at com.dotcms.repackage.org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
at com.dotcms.repackage.org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
... 6 more
Caused by: java.lang.ClassNotFoundException: *** Package 'javax.xml.soap' is not imported by bundle com.aquent.dotcms.osgi [16], nor is there any bundle that exports package 'javax.xml.soap'. However, the class 'javax.xml.soap.MessageFactory' is available from the system class loader. There are two fixes: 1) Add package 'javax.xml.soap' to the 'org.osgi.framework.system.packages.extra' property and modify bundle com.aquent.dotcms.osgi [16] to import this package; this causes the system bundle to export class path packages. 2) Add package 'javax.xml.soap' to the 'com.dotcms.repackage.org.osgi.framework.bootdelegation' property; a library or VM bug can cause classes to be loaded by the wrong class loader. The first approach is preferable for preserving modularity. ***
at com.dotcms.repackage.org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1968)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 23 more
Caused by: java.lang.ClassNotFoundException: javax.xml.soap.MessageFactory not found by com.aquent.dotcms.osgi [16]
at com.dotcms.repackage.org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
at com.dotcms.repackage.org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
at com.dotcms.repackage.org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
... 24 more

Jason Tesser

unread,
Jul 7, 2015, 3:29:10 PM7/7/15
to dot...@googlegroups.com
might need a log4j.properties file controlling all this at the root of the OSGi jar. 

something real basic like this but rename console 

Falzone, Chris

unread,
Jul 8, 2015, 9:12:59 AM7/8/15
to dot...@googlegroups.com
I have added the following log4j.properties to my plugin:

# Set root logger level to debug and its only appender to default.
log4j.rootLogger=info, default
# default is set to be a ConsoleAppender.
log4j.appender.default=org.apache.log4j.ConsoleAppender
# default uses PatternLayout.
log4j.appender.default.layout=org.apache.log4j.PatternLayout
log4j.appender.default.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

I am still getting the following error:

DEBUG: Bundle com.aquent.dotcms.osgi [15] log4j.xml not found by com.aquent.dotcms.osgi [15]
log4j:ERROR A "com.dotcms.repackage.org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [com.aquent.dotcms.osgi [15]] whereas object of type 
log4j:ERROR "com.dotcms.repackage.org.apache.log4j.ConsoleAppender" was loaded by [WebappClassLoader
  context: ROOT
  delegate: true
----------> Parent Classloader:
java.net.URLClassLoader@31befd9f
].
log4j:ERROR Could not instantiate appender named "CONSOLE".
log4j:WARN No appenders could be found for logger (org.springframework.ws.soap.saaj.SaajSoapMessageFactory).
log4j:WARN Please initialize the log4j system properly.


As well as the following:

Error while starting bundle: file:/data/wwwroot/dotcms/dotcms_3.2/dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/felix/load/dotcms-osgi-1.11.0-SNAPSHOT.jar: com.dotcms.repackage.org.osgi.framework.BundleException: Activator start error in bundle com.aquent.dotcms.osgi [15].
com.dotcms.repackage.org.osgi.framework.BundleException: Activator start error in bundle com.aquent.dotcms.osgi [15].
at com.dotcms.repackage.org.apache.felix.framework.Felix.activateBundle(Felix.java:2196)
at com.dotcms.repackage.org.apache.felix.framework.Felix.startBundle(Felix.java:2064)
at com.dotcms.repackage.org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1175)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1153)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:458)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:263)
Caused by: org.springframework.beans.factory.BeanCreationException: Invocation of init method failed; nested exception is org.springframework.ws.soap.SoapMessageCreationException: Could not create SAAJ MessageFactory: Unable to create SAAJ meta-factorycom.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl cannot be cast to javax.xml.soap.SAAJMetaFactory; nested exception is javax.xml.soap.SOAPException: Unable to create SAAJ meta-factorycom.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl cannot be cast to javax.xml.soap.SAAJMetaFactory
at org.springframework.ws.support.DefaultStrategiesHelper.instantiateBean(DefaultStrategiesHelper.java:188)
at org.springframework.ws.support.DefaultStrategiesHelper.getDefaultStrategies(DefaultStrategiesHelper.java:134)
at org.springframework.ws.support.DefaultStrategiesHelper.getDefaultStrategy(DefaultStrategiesHelper.java:219)
at org.springframework.ws.support.DefaultStrategiesHelper.getDefaultStrategy(DefaultStrategiesHelper.java:203)
at org.springframework.ws.client.core.WebServiceTemplate.initMessageFactory(WebServiceTemplate.java:353)
at org.springframework.ws.client.core.WebServiceTemplate.initDefaultStrategies(WebServiceTemplate.java:342)
at org.springframework.ws.client.core.WebServiceTemplate.<init>(WebServiceTemplate.java:130)
at org.springframework.ws.client.core.support.WebServiceGatewaySupport.<init>(WebServiceGatewaySupport.java:65)
at com.aquent.ws.JobPostingServiceClient.<init>(JobPostingServiceClient.java:8)
at com.aquent.osgi.AquentActivator.start(AquentActivator.java:92)
at com.dotcms.repackage.org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
at com.dotcms.repackage.org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
... 6 more
Caused by: org.springframework.ws.soap.SoapMessageCreationException: Could not create SAAJ MessageFactory: Unable to create SAAJ meta-factorycom.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl cannot be cast to javax.xml.soap.SAAJMetaFactory; nested exception is javax.xml.soap.SOAPException: Unable to create SAAJ meta-factorycom.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl cannot be cast to javax.xml.soap.SAAJMetaFactory
at org.springframework.ws.soap.saaj.SaajSoapMessageFactory.afterPropertiesSet(SaajSoapMessageFactory.java:163)
at org.springframework.ws.support.DefaultStrategiesHelper.instantiateBean(DefaultStrategiesHelper.java:185)
... 17 more
Caused by: javax.xml.soap.SOAPException: Unable to create SAAJ meta-factorycom.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl cannot be cast to javax.xml.soap.SAAJMetaFactory
at javax.xml.soap.SAAJMetaFactory.getInstance(SAAJMetaFactory.java:94)
at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:157)
at org.springframework.ws.soap.saaj.SaajSoapMessageFactory.afterPropertiesSet(SaajSoapMessageFactory.java:141)
... 18 more

Kinda stuck on both issues.  The logger issue it seems I might have to deploy the log4j.properties as a fragment bundle, at least that is what I am reading from my google searches.  The other option I am hearing is to switch to PAXLogger, but then I would have to figure out how to tell gradle not to embed the commons logging jar as well.  

The SAAJMetaFactory thing is most likely that it has 2 different versions of the class on the classpath, not sure how to resolve that either.  I seem to run into this issue whenever I have to add anything from the javax packages.  If I try to deploy my own I get this sort of error, but if I try to use the one on the dotCMS classpath, it fails because it is repackaged.  

My buid.gradle:

apply plugin: 'osgi'
apply plugin: 'eclipse'
apply plugin: 'propdeps'
apply plugin: 'propdeps-maven'
apply plugin: 'propdeps-eclipse'

sourceCompatibility = '1.8'

dependencies {
// dotCMS Dependencies
compile('com.dotcms:dotcms:3.2') { transitive = true }
provided('javax.servlet:servlet-api:2.5')
// Our Dependencies
compile('com.google.api-client:google-api-client:1.20.0')
compile('com.google.code.gson:gson:2.3.1')
compile('com.google.guava:guava:18.0')
compile('com.google.http-client:google-http-client:1.20.0')
compile('com.google.http-client:google-http-client-jackson:1.20.0')
compile('commons-fileupload:commons-fileupload:1.3.1')
compile('commons-httpclient:commons-httpclient:3.1')
compile('commons-io:commons-io:2.4')
compile('commons-lang:commons-lang:2.6')
compile('commons-logging:commons-logging:1.1.3')
compile('javax.xml.soap:saaj-api:1.3.4')
compile('log4j:log4j:1.2.17')
compile('org.apache.commons:commons-csv:1.1')
compile('org.apache.httpcomponents:httpclient:4.3.6')
compile('org.apache.httpcomponents:httpcore:4.3.3')
compile('org.apache.httpcomponents:httpmime:4.3.6')
compile('org.apache.solr:solr-common:1.3.0')
compile('org.apache.solr:solr-solrj:4.10.4')
compile('org.springframework.ws:spring-ws-core:2.2.1.RELEASE')
compile('xml-apis:xml-apis:1.0.b2')
}

repositories {
mavenCentral()
}

buildscript {
repositories {
}
dependencies {
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7'
}
}

jar {
exclude('org/json/*') 

manifest {
name = 'Aquent Main'
symbolicName = 'com.aquent.dotcms.osgi'
instruction 'Bundle-Vendor', 'Aquent, LLC (cfal...@aquent.com)'
instruction 'Bundle-Description', 'Main Aquent OSGI Plugin'
  instruction 'Bundle-DocURL', 'http://www.aquent.com'
instruction 'Bundle-Activator', 'com.aquent.osgi.AquentActivator'
instruction 'DynamicImport-Package', '*'
instruction 'Import-Package', 
'!org.springframework.*',
'!org.apache.commons.*',
'!org.apache.http.*',
'!org.apache.solr.*',
'!com.google.api.*',
'!com.google.common.*',
'!com.google.gson.*',
'!javax.xml.*',
'!org.springframework.ws.*',
'!org.w3c.*',
'!org.xml.*',
'*;version=0'
instruction 'Embed-Dependency',
'commons-csv',
'commons-fileupload',
'commons-httpclient',
'commons-io',
'commons-lang',
'commons-logging',
'google-api-client',
'google-http-client-jackson',
'gson',
'guava',
'httpclient',
'httpcore',
'httpmime',
'log4j',
'saaj-api',
'solr-common',
'solr-solrj',
'spring-ws-core',
'xml-apis'
instruction 'Embed-Transitive', 'true'
}
}

/*
 * reads the OSGI instruction "Embed-Dependency" and "Embed-Transitive"
 * and sets the "Bundle-ClassPath" instruction as well as copy instruction for
 * the related artifacts accordingly
 */
task processEmbedded << {
ext.embedInstruction = jar.manifest.instructions.get("Embed-Dependency")
ext.transitive = jar.manifest.instructions.get("Embed-Transitive");
if(embedInstruction != null){
def includedArtifacts = [] as Set
getDependencies(embedInstruction,transitive).each { dependency ->
dependency.moduleArtifacts.each { artifact ->
includedArtifacts.add(artifact.file)
}
}
jar.manifest.instruction("Bundle-ClassPath",'.') //add the default classpath
includedArtifacts.each { artifact -> 
jar.from(artifact)
jar.manifest.instruction("Bundle-ClassPath",artifact.name)
        }
    }
}

/**
 * Gets the list of ResolvedDependencies for the list of embeded dependency names
 * @param embededList the list with the dependencies to embed
 * @param recursive The embed transitive state
 * @return the list of dependencies. An empty Set if none
 */
def getDependencies(embededList, recursive){
def dependencies = [] as Set //resolved Dependencies
def dependencyMap = [:]; 
// This only considers top level resolved dependencies, but other should 
// not be embeded anyway.
project.configurations.runtime.resolvedConfiguration.firstLevelModuleDependencies.each { dependency -> 
dependencyMap.put(dependency.moduleName,dependency)
}
embededList.each { embeded -> 
ext.dependency = dependencyMap.get(embeded)
if(dependency != null){
println "dependency "+dependency.name
dependencies.add(dependency)
if(recursive){
dependency.children.each { child -> 
println "  child "+child.name+" Parents: "+child.parents
dependencies.add(child) 
}
}
} else {
println "WARNING: dependency "+embeded+" not found"
}
}
return dependencies
}

compileJava.dependsOn processEmbedded


Here is what is ending up in my bundle:

[MANIFEST dotcms-osgi-1.11.0-SNAPSHOT.jar]
Bnd-LastModified                         1436303107000                           
Bundle-Activator                         com.aquent.osgi.AquentActivator         
Bundle-ClassPath                         .,commons-csv-1.1.jar,commons-fileupload-1.3.1.jar,commons-io-2.4.jar,commons-httpclient-3.1.jar,commons-logging-1.1.3.jar,commons-codec-1.6.jar,commons-lang-2.6.jar,google-api-client-1.20.0.jar,google-oauth-client-1.20.0.jar,google-http-client-jackson2-1.20.0.jar,guava-jdk5-13.0.jar,google-http-client-jackson-1.20.0.jar,google-http-client-1.20.0.jar,jackson-core-asl-1.9.11.jar,gson-2.3.1.jar,guava-18.0.jar,httpclient-4.3.6.jar,httpcore-4.3.3.jar,httpmime-4.3.6.jar,log4j-1.2.17.jar,saaj-api-1.3.4.jar,activation-1.1.jar,solr-common-1.3.0.jar,solr-solrj-4.10.4.jar,zookeeper-3.4.6.jar,wstx-asl-3.2.7.jar,noggit-0.5.jar,slf4j-api-1.7.6.jar,spring-ws-core-2.2.1.RELEASE.jar,spring-xml-2.2.1.RELEASE.jar,spring-aop-4.0.9.RELEASE.jar,spring-oxm-4.0.9.RELEASE.jar,spring-beans-4.0.9.RELEASE.jar,spring-core-4.0.9.RELEASE.jar,spring-web-4.0.9.RELEASE.jar,spring-webmvc-4.0.9.RELEASE.jar,xml-apis-1.0.b2.jar
Bundle-Description                       Main Aquent OSGI Plugin                 
Bundle-DocURL                            http://www.aquent.com                   
Bundle-ManifestVersion                   2                                       
Bundle-Name                              Aquent Main                             
Bundle-SymbolicName                      com.aquent.dotcms.osgi                  
Bundle-Vendor                            Aquent, LLC (cfal...@aquent.com)       
Bundle-Version                           1.11.0.SNAPSHOT                         
Created-By                               1.8.0_45 (Oracle Corporation)           
DynamicImport-Package                    *                                       
Embed-Dependency                         commons-csv,commons-fileupload,commons-httpclient,commons-io,commons-lang,commons-logging,google-api-client,google-http-client-jackson,gson,guava,httpclient,httpcore,httpmime,log4j,saaj-api,solr-common,solr-solrj,spring-ws-core,xml-apis
Embed-Transitive                         true                                    
Export-Package                           com.aquent;version="1.11.0.SNAPSHOT";uses:="com.dotcms.repackage.org.tuckey.web.filters.urlrewrite,com.dotmarketing.beans,com.dotmarketing.portlets.categories.model,com.dotmarketing.portlets.contentlet.business,com.dotmarketing.portlets.contentlet.model,com.dotmarketing.portlets.structure.model,com.liferay.portal.model,javax.servlet.http,org.apache.velocity.tools.view.servlet,org.apache.velocity.tools.view.tools",com.aquent.agenttool;version="1.11.0.SNAPSHOT";uses:="javax.servlet,javax.servlet.http",com.aquent.aquentcareers;version="1.11.0.SNAPSHOT";uses:="javax.servlet,javax.servlet.http,org.quartz",com.aquent.auth;version="1.11.0.SNAPSHOT";uses:="javax.servlet,javax.servlet.http",com.aquent.jobs;version="1.11.0.SNAPSHOT";uses:="com.dotmarketing.beans,com.dotmarketing.portlets.categories.model,com.dotmarketing.portlets.contentlet.business,com.dotmarketing.portlets.contentlet.model,com.dotmarketing.portlets.structure.model,com.liferay.portal.model,javax.servlet,javax.servlet.http,org.quartz",com.aquent.leadform;version="1.11.0.SNAPSHOT";uses:="javax.servlet.http",com.aquent.osgi;version="1.11.0.SNAPSHOT";uses:="com.dotcms.repackage.org.osgi.framework,com.dotmarketing.osgi",com.aquent.osgi.job;version="1.11.0.SNAPSHOT";uses:="org.quartz",com.aquent.solr;version="1.11.0.SNAPSHOT";uses:="org.apache.velocity.tools.view.servlet,org.apache.velocity.tools.view.tools",com.aquent.talentcalendar;version="1.11.0.SNAPSHOT";uses:="com.dotmarketing.beans,com.dotmarketing.portlets.categories.model,com.dotmarketing.portlets.contentlet.business,com.dotmarketing.portlets.contentlet.model,com.dotmarketing.portlets.structure.model,com.liferay.portal.model,javax.servlet.http",com.aquent.votes;version="1.11.0.SNAPSHOT";uses:="com.dotmarketing.portlets.contentlet.model,javax.servlet,javax.servlet.http",com.aquent.ws;version="1.11.0.SNAPSHOT"
Import-Package                           com.dotcms.publisher.bundle.bean;version=0,com.dotcms.publisher.bundle.business;version=0,com.dotcms.publisher.business;version=0,com.dotcms.publisher.environment.bean;version=0,com.dotcms.publisher.environment.business;version=0,com.dotcms.repackage.org.apache.felix.http.api;version=0,com.dotcms.repackage.org.osgi.framework;version=0,com.dotcms.repackage.org.osgi.service.http;version=0,com.dotcms.repackage.org.osgi.util.tracker;version=0,com.dotcms.repackage.org.tuckey.web.filters.urlrewrite;version=0,com.dotmarketing.beans;version=0,com.dotmarketing.business;version=0,com.dotmarketing.business.web;version=0,com.dotmarketing.cache;version=0,com.dotmarketing.common.db;version=0,com.dotmarketing.db;version=0,com.dotmarketing.filters;version=0,com.dotmarketing.osgi;version=0,com.dotmarketing.portlets.categories.business;version=0,com.dotmarketing.portlets.categories.model;version=0,com.dotmarketing.portlets.contentlet.business;version=0,com.dotmarketing.portlets.contentlet.model;version=0,com.dotmarketing.portlets.fileassets.business;version=0,com.dotmarketing.portlets.folders.business;version=0,com.dotmarketing.portlets.folders.model;version=0,com.dotmarketing.portlets.structure.factories;version=0,com.dotmarketing.portlets.structure.model;version=0,com.dotmarketing.quartz;version=0,com.dotmarketing.util;version=0,com.dotmarketing.viewtools;version=0,com.liferay.portal.model;version=0,com.liferay.util;version=0,javax.servlet;version=0,javax.servlet.http;version=0,org.apache.velocity.tools.view.context;version=0,org.apache.velocity.tools.view.servlet;version=0,org.apache.velocity.tools.view.tools;version=0,org.quartz;version=0
Manifest-Version                         1.0                                     
Tool                                     Bnd-2.1.0.20130426-122213 


[LIST]

  activation-1.1.jar
  commons-codec-1.6.jar
  commons-csv-1.1.jar
  commons-fileupload-1.3.1.jar
  commons-httpclient-3.1.jar
  commons-io-2.4.jar
  commons-lang-2.6.jar
  commons-logging-1.1.3.jar
  google-api-client-1.20.0.jar
  google-http-client-1.20.0.jar
  google-http-client-jackson-1.20.0.jar
  google-http-client-jackson2-1.20.0.jar
  google-oauth-client-1.20.0.jar
  gson-2.3.1.jar
  guava-18.0.jar
  guava-jdk5-13.0.jar
  httpclient-4.3.6.jar
  httpcore-4.3.3.jar
  httpmime-4.3.6.jar
  jackson-core-asl-1.9.11.jar
  log4j-1.2.17.jar
  log4j.properties
  noggit-0.5.jar
  saaj-api-1.3.4.jar
  slf4j-api-1.7.6.jar
  solr-common-1.3.0.jar
  solr-solrj-4.10.4.jar
  spring-aop-4.0.9.RELEASE.jar
  spring-beans-4.0.9.RELEASE.jar
  spring-core-4.0.9.RELEASE.jar
  spring-oxm-4.0.9.RELEASE.jar
  spring-web-4.0.9.RELEASE.jar
  spring-webmvc-4.0.9.RELEASE.jar
  spring-ws-core-2.2.1.RELEASE.jar
  spring-xml-2.2.1.RELEASE.jar
  wstx-asl-3.2.7.jar
  xml-apis-1.0.b2.jar
  zookeeper-3.4.6.jar


Falzone, Chris

unread,
Jul 8, 2015, 3:04:43 PM7/8/15
to dot...@googlegroups.com
So I got somewhere on both accounts. on the log4j stuff, I found that you have to specify a log4j.xml not a log4j.properties.  On the spring front I found a way to tell it to use a specific Messaging factory and set it to use the one from them.  

Now I am stuck on this one.  It seems when I try to get the spring context it is trying to get the log factory and that ends up throwing a NPE.  Any thoughts on this one:

ERROR: Bundle com.aquent.dotcms.osgi [20] Unable to get module class path. (java.lang.NullPointerException)
java.lang.NullPointerException
at com.dotcms.repackage.org.apache.felix.framework.BundleRevisionImpl.calculateContentPath(BundleRevisionImpl.java:431)
at com.dotcms.repackage.org.apache.felix.framework.BundleRevisionImpl.initializeContentPath(BundleRevisionImpl.java:368)
at com.dotcms.repackage.org.apache.felix.framework.BundleRevisionImpl.getContentPath(BundleRevisionImpl.java:354)
at com.dotcms.repackage.org.apache.felix.framework.BundleRevisionImpl.getResourcesLocal(BundleRevisionImpl.java:514)
at com.dotcms.repackage.org.apache.felix.framework.BundleWiringImpl.findResourcesByDelegation(BundleWiringImpl.java:1173)
at com.dotcms.repackage.org.apache.felix.framework.BundleWiringImpl.getResourcesByDelegation(BundleWiringImpl.java:1083)
at com.dotcms.repackage.org.apache.felix.framework.BundleWiringImpl$BundleClassLoaderJava5.getResources(BundleWiringImpl.java:1870)
at com.dotmarketing.osgi.CombinedLoader.getResources(CombinedLoader.java:112)
at org.apache.commons.logging.LogFactory$4.run(LogFactory.java:1264)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.commons.logging.LogFactory.getResources(LogFactory.java:1282)
at org.apache.commons.logging.LogFactory.getConfigurationFile(LogFactory.java:1360)
at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:453)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:154)
at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:215)
at org.springframework.context.support.AbstractRefreshableApplicationContext.<init>(AbstractRefreshableApplicationContext.java:88)
at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.<init>(AbstractRefreshableConfigApplicationContext.java:58)
at org.springframework.context.support.AbstractXmlApplicationContext.<init>(AbstractXmlApplicationContext.java:61)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:136)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at com.aquent.osgi.AquentActivator.start(AquentActivator.java:74)
at com.dotcms.repackage.org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
at com.dotcms.repackage.org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
at com.dotcms.repackage.org.apache.felix.framework.Felix.startBundle(Felix.java:2064)
at com.dotcms.repackage.org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1175)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1153)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:458)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:263)
at com.dotcms.repackage.org.apache.felix.framework.Felix.activateBundle(Felix.java:2196)
at com.dotcms.repackage.org.apache.felix.framework.Felix.startBundle(Felix.java:2064)
at com.dotcms.repackage.org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1175)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1153)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:458)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:263)
Caused by: java.lang.NullPointerException
at com.dotcms.repackage.org.apache.felix.framework.BundleRevisionImpl.getResourcesLocal(BundleRevisionImpl.java:531)
at com.dotcms.repackage.org.apache.felix.framework.BundleWiringImpl.getResourcesByDelegation(BundleWiringImpl.java:1083)
at com.dotcms.repackage.org.apache.felix.framework.BundleWiringImpl$BundleClassLoaderJava5.getResources(BundleWiringImpl.java:1870)
at com.dotmarketing.osgi.CombinedLoader.getResources(CombinedLoader.java:112)
at com.dotcms.repackage.org.apache.felix.framework.BundleRevisionImpl.initializeContentPath(BundleRevisionImpl.java:368)
at org.apache.commons.logging.LogFactory$4.run(LogFactory.java:1264)
at com.dotcms.repackage.org.apache.felix.framework.BundleRevisionImpl.getResourcesLocal(BundleRevisionImpl.java:514)
at com.dotcms.repackage.org.apache.felix.framework.BundleWiringImpl.findResourcesByDelegation(BundleWiringImpl.java:1173)
at org.apache.commons.logging.LogFactory.getResources(LogFactory.java:1282)
at com.dotcms.repackage.org.apache.felix.framework.BundleWiringImpl$BundleClassLoaderJava5.getResources(BundleWiringImpl.java:1870)
at org.apache.commons.logging.LogFactory.getConfigurationFile(LogFactory.java:1360)
at org.apache.commons.logging.LogFactory$4.run(LogFactory.java:1264)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
at org.apache.commons.logging.LogFactory.getConfigurationFile(LogFactory.java:1360)
at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:154)
at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:215)
at org.springframework.context.support.AbstractRefreshableApplicationContext.<init>(AbstractRefreshableApplicationContext.java:88)
at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.<init>(AbstractRefreshableConfigApplicationContext.java:58)
at org.springframework.context.support.AbstractXmlApplicationContext.<init>(AbstractXmlApplicationContext.java:61)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at com.aquent.osgi.AquentActivator.start(AquentActivator.java:74)



Jason Tesser

unread,
Jul 8, 2015, 3:07:26 PM7/8/15
to dot...@googlegroups.com
are you including your own spring or likft the one on the main dotCMS classpath 

Falzone, Chris

unread,
Jul 8, 2015, 3:29:33 PM7/8/15
to dot...@googlegroups.com
I am including the following now:
compile('org.springframework.ws:spring-ws-core:2.2.1.RELEASE')
compile('org.springframework:spring-context:4.1.7.RELEASE')

This is my activator:

Though restarting dotCMS now I get a different error, which takes me back to the same place I was before :(

Error while starting bundle: file:/data/wwwroot/dotcms/dotcms_3.2/dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/felix/load/dotcms-osgi-1.11.0-SNAPSHOT.jar: com.dotcms.repackage.org.osgi.framework.BundleException: Activator start error in bundle com.aquent.dotcms.osgi [13].
com.dotcms.repackage.org.osgi.framework.BundleException: Activator start error in bundle com.aquent.dotcms.osgi [13].
at com.dotcms.repackage.org.apache.felix.framework.Felix.activateBundle(Felix.java:2196)
at com.dotcms.repackage.org.apache.felix.framework.Felix.startBundle(Felix.java:2064)
at com.dotcms.repackage.org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1175)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1153)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.processAllBundles(DirectoryWatcher.java:1146)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:456)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:263)
Caused by: org.apache.commons.logging.LogConfigurationException: User-specified log class 'org.apache.commons.logging.impl.Log4JLogger' cannot be found or is not useable.
at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:804)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:541)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:292)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:269)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:154)
at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:215)
at org.springframework.context.support.AbstractRefreshableApplicationContext.<init>(AbstractRefreshableApplicationContext.java:88)
at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.<init>(AbstractRefreshableConfigApplicationContext.java:58)
at org.springframework.context.support.AbstractXmlApplicationContext.<init>(AbstractXmlApplicationContext.java:61)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:136)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at com.aquent.osgi.AquentActivator.start(AquentActivator.java:74)
at com.dotcms.repackage.org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
at com.dotcms.repackage.org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
... 7 more

Falzone, Chris

unread,
Jul 10, 2015, 9:38:22 AM7/10/15
to dot...@googlegroups.com
I managed to get past some of the problems I was having.  This is where I am currently stuck, which seems more like a problem with my Spring-Foo than anything else.  Anyone know how to resolve the issue with this?  There are lots of results on google but I wasn't able to find a resolution in any of them.

2015-07-10 09:32:34,416 ERROR com.aquent.osgi.AquentActivator - Exception testing web service client
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobPostingServiceMarshaller' defined in class path resource [spring/ApplicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.oxm.UncategorizedMappingException: Unknown JAXB exception; nested exception is javax.xml.bind.JAXBException: Provider com.sun.xml.internal.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: Provider class com.sun.xml.internal.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "spring/jobPostingService.wsdl" doesnt contain ObjectFactory.class or jaxb.index
 - with linked exception:
[javax.xml.bind.JAXBException: "spring/jobPostingService.wsdl" doesnt contain ObjectFactory.class or jaxb.index]
 - with linked exception:
[javax.xml.bind.JAXBException: Provider class com.sun.xml.internal.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "spring/jobPostingService.wsdl" doesnt contain ObjectFactory.class or jaxb.index
 - with linked exception:
[javax.xml.bind.JAXBException: "spring/jobPostingService.wsdl" doesnt contain ObjectFactory.class or jaxb.index]]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at com.aquent.osgi.AquentActivator.start(AquentActivator.java:31)
at com.dotcms.repackage.org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
at com.dotcms.repackage.org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
at com.dotcms.repackage.org.apache.felix.framework.Felix.startBundle(Felix.java:2064)
at com.dotcms.repackage.org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1175)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1153)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:458)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:263)
Caused by: org.springframework.oxm.UncategorizedMappingException: Unknown JAXB exception; nested exception is javax.xml.bind.JAXBException: Provider com.sun.xml.internal.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: Provider class com.sun.xml.internal.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "spring/jobPostingService.wsdl" doesnt contain ObjectFactory.class or jaxb.index
 - with linked exception:
[javax.xml.bind.JAXBException: "spring/jobPostingService.wsdl" doesnt contain ObjectFactory.class or jaxb.index]
 - with linked exception:
[javax.xml.bind.JAXBException: Provider class com.sun.xml.internal.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "spring/jobPostingService.wsdl" doesnt contain ObjectFactory.class or jaxb.index
 - with linked exception:
[javax.xml.bind.JAXBException: "spring/jobPostingService.wsdl" doesnt contain ObjectFactory.class or jaxb.index]]
at org.springframework.oxm.jaxb.Jaxb2Marshaller.convertJaxbException(Jaxb2Marshaller.java:705)
at org.springframework.oxm.jaxb.Jaxb2Marshaller.getJaxbContext(Jaxb2Marshaller.java:366)
at org.springframework.oxm.jaxb.Jaxb2Marshaller.afterPropertiesSet(Jaxb2Marshaller.java:348)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 20 more
Caused by: javax.xml.bind.JAXBException: Provider com.sun.xml.internal.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: Provider class com.sun.xml.internal.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "spring/jobPostingService.wsdl" doesnt contain ObjectFactory.class or jaxb.index
 - with linked exception:
[javax.xml.bind.JAXBException: "spring/jobPostingService.wsdl" doesnt contain ObjectFactory.class or jaxb.index]
 - with linked exception:
[javax.xml.bind.JAXBException: Provider class com.sun.xml.internal.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "spring/jobPostingService.wsdl" doesnt contain ObjectFactory.class or jaxb.index
 - with linked exception:
[javax.xml.bind.JAXBException: "spring/jobPostingService.wsdl" doesnt contain ObjectFactory.class or jaxb.index]]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:160)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:371)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:446)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:409)
at org.springframework.oxm.jaxb.Jaxb2Marshaller.createJaxbContextFromContextPath(Jaxb2Marshaller.java:386)
at org.springframework.oxm.jaxb.Jaxb2Marshaller.getJaxbContext(Jaxb2Marshaller.java:359)
... 23 more
Caused by: javax.xml.bind.JAXBException: Provider class com.sun.xml.internal.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "spring/jobPostingService.wsdl" doesnt contain ObjectFactory.class or jaxb.index
 - with linked exception:
[javax.xml.bind.JAXBException: "spring/jobPostingService.wsdl" doesnt contain ObjectFactory.class or jaxb.index]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:212)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:146)
... 28 more
Caused by: javax.xml.bind.JAXBException: "spring/jobPostingService.wsdl" doesnt contain ObjectFactory.class or jaxb.index
at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:266)
at sun.reflect.GeneratedMethodAccessor572.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:186)
... 29 more


This is my ApplicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>

    <bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory" />
    
    <bean id="jobPostingServiceMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
        <property name="contextPath" value="spring/jobPostingService.wsdl" />
    </bean>
    
    <bean id="jobPostingServiceTemplate" class="org.springframework.ws.client.core.WebServiceTemplate">
        <constructor-arg ref="messageFactory" />
        <property name="marshaller" ref="jobPostingServiceMarshaller"></property>
        <property name="unmarshaller" ref="jobPostingServiceMarshaller"></property>
        <property name="messageSender">
            <bean
                class="org.springframework.ws.transport.http.CommonsHttpMessageSender">
            </bean>
        </property>
        <property name="defaultUri" value="https://my.aquent.com/AQWS/JobPostingService" />
    </bean>
    
    <bean id="JobPostingServiceClient" class="com.aquent.ws.JobPostingServiceClient">
        <constructor-arg ref="jobPostingServiceTemplate"></constructor-arg>
    </bean>

</beans>



Thanks!

Jason Tesser

unread,
Jul 10, 2015, 10:06:48 AM7/10/15
to dot...@googlegroups.com
So ok I think your key is here AbstractAutowireCapableBeanFactory
The Autowire communicates to me it is probably doing package scanning 

This could be an issue IF you are using any libs from the underneath dotCMS loader.  So whatever is implementing javax.xml.bind.ContextFinder or whatever it is looking for all need to be in your plugin and not coming from the dotCMS exported packages into OSGi. 

Something like this is happening.  Maybe you need to not allow it to autowire.  Manually configure the beaning meaning don't let this guy do it but inject the bean into him org.springframework.oxm.jaxb.Jaxb2Marshaller.createJaxbContextFromContextPath

Falzone, Chris

unread,
Jul 10, 2015, 12:08:24 PM7/10/15
to dot...@googlegroups.com
So I am not not using anything from the dotCMS classpath for spring.  I am back to the same exact error:


In my bundle jar:

jars and other resources:
  axiom-api-1.2.15.jar
  axiom-impl-1.2.15.jar
  commons-csv-1.1.jar
  commons-fileupload-1.3.1.jar
  commons-httpclient-3.1.jar
  commons-io-2.4.jar
  commons-lang-2.6.jar
  geronimo-activation_1.1_spec-1.1.jar
  geronimo-stax-api_1.0_spec-1.0.1.jar
  google-api-client-1.20.0.jar
  google-http-client-jackson-1.20.0.jar
  gson-2.3.1.jar
  guava-18.0.jar
  httpclient-4.3.6.jar
  httpcore-4.3.3.jar
  httpmime-4.3.6.jar
  jaxb-api-2.2.12.jar
  jaxp-api-1.4.5.jar
  solr-common-1.3.0.jar
  solr-solrj-4.10.4.jar
  spring-aop-4.1.7.RELEASE.jar
  spring-beans-4.1.7.RELEASE.jar
  spring-context-4.1.7.RELEASE.jar
  spring-context-support-4.1.7.RELEASE.jar
  spring-core-4.1.7.RELEASE.jar
  spring-expression-4.1.7.RELEASE.jar
  spring-oxm-4.1.7.RELEASE.jar
  spring-web-4.1.7.RELEASE.jar
  spring-webmvc-4.1.7.RELEASE.jar
  spring-ws-core-2.2.1.RELEASE.jar
  spring-xml-2.2.1.RELEASE.jar
  stax2-api-3.1.1.jar
  wstx-asl-3.2.9.jar
  xalan-2.7.2.jar
  xercesImpl-2.11.0.jar
  xml-apis-1.4.01.jar
spring
  ApplicationContext.xml
  jobPostingService.wsdl



My Import-Packages are:
  com.dotcms.publisher.bundle.bean       {version=0}
  com.dotcms.publisher.bundle.business   {version=0}
  com.dotcms.publisher.business          {version=0}
  com.dotcms.publisher.environment.bean  {version=0}
  com.dotcms.publisher.environment.business {version=0}
  com.dotcms.repackage.org.osgi.framework {version=0}
  com.dotcms.repackage.org.tuckey.web.filters.urlrewrite {version=0}
  com.dotmarketing.beans                 {version=0}
  com.dotmarketing.business              {version=0}
  com.dotmarketing.business.web          {version=0}
  com.dotmarketing.cache                 {version=0}
  com.dotmarketing.common.db             {version=0}
  com.dotmarketing.db                    {version=0}
  com.dotmarketing.filters               {version=0}
  com.dotmarketing.osgi                  {version=0}
  com.dotmarketing.portlets.categories.business {version=0}
  com.dotmarketing.portlets.categories.model {version=0}
  com.dotmarketing.portlets.contentlet.business {version=0}
  com.dotmarketing.portlets.contentlet.model {version=0}
  com.dotmarketing.portlets.fileassets.business {version=0}
  com.dotmarketing.portlets.folders.business {version=0}
  com.dotmarketing.portlets.folders.model {version=0}
  com.dotmarketing.portlets.structure.factories {version=0}
  com.dotmarketing.portlets.structure.model {version=0}
  com.dotmarketing.util                  {version=0}
  com.dotmarketing.viewtools             {version=0}
  com.liferay.portal.model               {version=0}
  com.liferay.util                       {version=0}
  javax.servlet                          {version=0}
  javax.servlet.http                     {version=0}
  org.apache.velocity.tools.view.context {version=0}
  org.apache.velocity.tools.view.servlet {version=0}
  org.apache.velocity.tools.view.tools   {version=0}
  org.quartz                             {version=0}



Falzone, Chris

unread,
Jul 10, 2015, 1:14:45 PM7/10/15
to dot...@googlegroups.com
I figured the issue with that was that I needed to tell the marshaller to look at the package instead of the wsdl file:

    <bean id="jobPostingServiceMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
        <property name="contextPath" value="com.aquent.ws" />
    </bean>

Now the issue is something with javax.xml.bind - some version missmatch or it is grabbing something from the dotCMS classloader or something.

We've traced this down to here:

And that comes from here:

Basically a JAXBContext is not a JAXBContext.

My jars are now:

dependencies {
// dotCMS Dependencies
compile('com.dotcms:dotcms:3.2') { transitive = true }
provided('javax.servlet:servlet-api:2.5')
// Our Dependencies
compile('com.google.api-client:google-api-client:1.20.0') { transitive = false }
compile('com.google.code.gson:gson:2.3.1') { transitive = false }
compile('com.google.guava:guava:18.0') { transitive = false }
compile('com.google.http-client:google-http-client:1.20.0') { transitive = false }
compile('com.google.http-client:google-http-client-jackson:1.20.0') { transitive = false }
compile('com.google.oauth-client:google-oauth-client:1.20.0') { transitive = false }
compile('commons-fileupload:commons-fileupload:1.3.1') { transitive = false }
compile('commons-httpclient:commons-httpclient:3.1') { transitive = false }
compile('commons-io:commons-io:2.4') { transitive = false }
compile('commons-lang:commons-lang:2.6') { transitive = false }
compile('org.apache.commons:commons-csv:1.1') { transitive = false }
compile('org.apache.httpcomponents:httpclient:4.3.6') { transitive = false }
compile('org.apache.httpcomponents:httpcore:4.3.3') { transitive = false }
compile('org.apache.httpcomponents:httpmime:4.3.6') { transitive = false }
compile('org.apache.solr:solr-common:1.3.0') { transitive = false }
compile('org.apache.solr:solr-solrj:4.10.4') { transitive = false }
// Spring Dependencies
compile('org.springframework.ws:spring-ws-core:2.2.1.RELEASE') { transitive = false }
compile('org.springframework.ws:spring-xml:2.2.1.RELEASE') { transitive = false }
compile('org.springframework:spring-aop:4.1.7.RELEASE') { transitive = false }
    compile('org.springframework:spring-beans:4.1.7.RELEASE') { transitive = false }
    compile('org.springframework:spring-context:4.1.7.RELEASE') { transitive = false }
    compile('org.springframework:spring-context-support:4.1.7.RELEASE') { transitive = false }
    compile('org.springframework:spring-core:4.1.7.RELEASE') { transitive = false }
    compile('org.springframework:spring-expression:4.1.7.RELEASE') { transitive = false }
    compile('org.springframework:spring-oxm:4.1.7.RELEASE') { transitive = false }
    compile('org.springframework:spring-web:4.1.7.RELEASE') { transitive = false }
    compile('org.springframework:spring-webmvc:4.1.7.RELEASE') { transitive = false }
    compile('javax.xml.bind:jaxb-api:2.2.12') { transitive = false }
    compile('javax.xml.parsers:jaxp-api:1.4.5') { transitive = false }
    compile('org.apache.geronimo.specs:geronimo-activation_1.1_spec:1.1') { transitive = false }
    compile('org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:1.0.1') { transitive = false }
    compile('org.apache.ws.commons.axiom:axiom-api:1.2.15') { transitive = false }
    compile('org.apache.ws.commons.axiom:axiom-impl:1.2.15') { transitive = false }
    compile('org.codehaus.woodstox:stax2-api:3.1.1') { transitive = false }
    compile('org.codehaus.woodstox:wstx-asl:3.2.9') { transitive = false }
    compile('xalan:xalan:2.7.2') { transitive = false }
    compile('xerces:xercesImpl:2.11.0') { transitive = false }
    compile('xml-apis:xml-apis:1.4.01') { transitive = false }
}

Not sure if it is me including the wrong version of something there or if it is picking up something from the dotCMS classloader.  Any thoughts?

Falzone, Chris

unread,
Jul 10, 2015, 4:43:03 PM7/10/15
to dot...@googlegroups.com
I have managed to get everything out of autowiring like you said. It did seem to get me a lot closer.  However, still having some class loading issues. 

This is the current error I am getting:

And my current activator code:

It seems that one class is using the bundle's class loader but the other is using the bootloader one.  

Any thoughts?

Jason Tesser

unread,
Jul 10, 2015, 4:46:00 PM7/10/15
to dot...@googlegroups.com
I think you can inject into the marshaller in spring exactly class to you. use one in yoru OSGi.  All this is the same issue. Stop using underneath classes.  A pain to wire.  But this is all wiring crap with Spring and Axis 

Falzone, Chris

unread,
Jul 13, 2015, 1:01:21 PM7/13/15
to dot...@googlegroups.com
Based on your suggestion, I moved the code for the Marshaller into my source and that seemed to get me further.  I am now here:

Started bundle: file:/data/wwwroot/dotcms/dotcms_3.2/dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/felix/load/dotcms-osgi-1.11.0-SNAPSHOT.jar
2015-07-13 11:46:31,723 ERROR com.aquent.osgi.AquentActivator - Exception testing web service client
org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted. 
at org.apache.axiom.om.impl.dom.ParentNode.insertBefore(ParentNode.java:235)
at org.apache.axiom.om.impl.dom.NodeImpl.appendChild(NodeImpl.java:240)
at org.apache.axis2.saaj.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:111)
at org.springframework.ws.soap.saaj.SaajSoapMessageFactory.createWebServiceMessage(SaajSoapMessageFactory.java:174)
at org.springframework.ws.soap.saaj.SaajSoapMessageFactory.createWebServiceMessage(SaajSoapMessageFactory.java:60)
at org.springframework.ws.context.DefaultMessageContext.<init>(DefaultMessageContext.java:42)
at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:553)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:390)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:383)
at com.aquent.ws.JobPostingServiceClient.getAllPostedJobs(JobPostingServiceClient.java:14)
at com.aquent.osgi.AquentActivator.start(AquentActivator.java:73)
at com.dotcms.repackage.org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
at com.dotcms.repackage.org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
at com.dotcms.repackage.org.apache.felix.framework.Felix.startBundle(Felix.java:2064)
at com.dotcms.repackage.org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1175)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1153)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.processAllBundles(DirectoryWatcher.java:1146)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:456)
at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:263)

One thing after another, any thoughts on this one?  

Thanks!

--
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
Visit this group at http://groups.google.com/group/dotcms.
For more options, visit https://groups.google.com/d/optout.

Falzone, Chris

unread,
Jul 15, 2015, 9:26:22 AM7/15/15
to dot...@googlegroups.com
For those of you interested, I ended up ditching trying to get Spring WS working in an OSGI plugin.  Where I was going I wasn't getting the benefit of Spring anyway.  I switched to using a lightweight soap client and parsing the soap response into java object manually using org.w3c.dom.  Once I got all the imports correct it was fairly simple to do.  

The soap client I am using is:  https://github.com/reficio/soap-ws

Just to give you an idea for the dependencies:

// Soap Client Dependencies
compile('org.reficio:soap-builder:1.0.0-SNAPSHOT') { transitive = false }
compile('org.reficio:soap-client:1.0.0-SNAPSHOT') { transitive = false }
compile('org.reficio:soap-common:1.0.0-SNAPSHOT') { transitive = false }
compile('org.reficio:soap-legacy:1.0.0-SNAPSHOT') { transitive = false }
compile('javax.xml:jsr173:1.0') { transitive = false }
compile('net.sf.saxon:saxon:9.1.0.8') { transitive = false }
compile('net.sf.saxon:saxon-dom:9.1.0.8') { transitive = false }
compile('org.apache.ws.commons.schema:XmlSchema:1.4.7') { transitive = false }
compile('org.apache.xmlbeans:xmlbeans-xmlpublic:2.5.0') { transitive = false }
compile('org.apache.xmlgraphics:batik-util:1.7') { transitive = false }
compile('wsdl4j:wsdl4j:1.6.2') { transitive = false }
compile('wsrf:wsrf-xbeans:1.0') { transitive = false }
compile('xalan:serializer:2.7.2') { transitive = false }
compile('xalan:xalan:2.7.2') { transitive = false }
compile('xerces:xercesImpl:2.10.0') { transitive = false }
compile('xml-apis:xml-apis:1.4.01') { transitive = false }
compile('xmlbeans:xbean:fixed-2.4.0') { transitive = false }
compile('xmlbeans:xbean_xpath:2.4.0') { transitive = false }
compile('xmlunit:xmlunit:1.3') { transitive = false }

His sample code leaves much to be desired, but probably the thing the threw me the most was how to set parameters in the request.  You have to generate the request and then modify the XML to update the parameters of the request.  I used org.w3c.dom to do that, I can provide an example if anyone wants.

I do have one issue that I am not sure how to resolve.  When I undeploy the plugin and then redeploy the plugin I get the following error until I restart the OSGI Framework. It happen on parsing the wsdl file.  Is there something I can do in the activator's stop method to make prevent this?

ERROR: Bundle com.aquent.dotcms.osgi [14] Error starting/stopping bundle. (com.dotcms.repackage.org.osgi.framework.BundleException: Activator start error in bundle com.aquent.dotcms.osgi [14].)
org.reficio.ws.SoapBuilderException: Thread FelixStartLevel: The 1th supplied input is not a schema document: its type is N=
at org.reficio.ws.legacy.SchemaUtils.loadSchemaTypes(SchemaUtils.java:115)
at org.reficio.ws.legacy.SchemaDefinitionWrapper.loadSchemaTypes(SchemaDefinitionWrapper.java:97)
at org.reficio.ws.legacy.SchemaDefinitionWrapper.<init>(SchemaDefinitionWrapper.java:60)
at org.reficio.ws.legacy.SoapMessageBuilder.<init>(SoapMessageBuilder.java:99)
at org.reficio.ws.legacy.SoapLegacyFacade.<init>(SoapLegacyFacade.java:47)
at org.reficio.ws.builder.core.Wsdl.<init>(Wsdl.java:50)
at org.reficio.ws.builder.core.Wsdl.parse(Wsdl.java:64)
at com.aquent.jobs.JobPostingServiceClient.getPostedJobs(JobPostingServiceClient.java:72)
at com.aquent.osgi.AquentActivator.start(AquentActivator.java:21)
at com.dotcms.repackage.org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
at com.dotcms.repackage.org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
at com.dotcms.repackage.org.apache.felix.framework.Felix.startBundle(Felix.java:2064)
at com.dotcms.repackage.org.apache.felix.framework.Felix.setBundleStartLevel(Felix.java:1483)
at com.dotcms.repackage.org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:334)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.reficio.ws.SoapBuilderException: Thread FelixStartLevel: The 1th supplied input is not a schema document: its type is N=
at org.reficio.ws.legacy.SchemaUtils.buildSchemaTypes(SchemaUtils.java:194)
at org.reficio.ws.legacy.SchemaUtils.loadSchemaTypes(SchemaUtils.java:113)
... 14 more
Caused by: org.apache.xmlbeans.XmlException: Thread FelixStartLevel: The 1th supplied input is not a schema document: its type is N=
at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:211)
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:497)
at org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667)
at org.apache.xmlbeans.XmlBeans.compileXsd(XmlBeans.java:553)
at org.reficio.ws.legacy.SchemaUtils.buildSchemaTypes(SchemaUtils.java:187)
... 15 more

Thanks JT for the help so far!  

santosh yadav

unread,
Jul 31, 2019, 9:01:15 AM7/31/19
to dotCMS User Group
Hi,
I have develop a plugin which is working on dotCms version 4.2.2 but it's not working on dotCms 5.1.5, it's give an error like 

error: package com.dotcms.repackage.org.apache.commons.collections does not exist
error: package com.dotcms.repackage.org.apache.commons.lang does not exist
error: package com.dotcms.repackage.org.apache.hadoop.fs.s3 does not exis
can any one help me thanks in advance.


 

Nathan Keiter

unread,
Jul 31, 2019, 9:08:50 AM7/31/19
to dot...@googlegroups.com
OSGI plugins are not compatible across major version levels. Sometimes minor version levels can be a problem as well.


You'll have to recompile your plugin against the latest 5.x source code base. Personally I use Eclipse to test my code, but you could just update the maven repo version in your build.gradle to compile against it as well.


My educated guess would be you need to lose the "com.dotcms.repackage." prefix, but I haven't looked at it to know for sure.


Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993
https://www.gettysburg.edu
________________________________
From: dot...@googlegroups.com <dot...@googlegroups.com> on behalf of santosh yadav <az.san...@gmail.com>
Sent: Wednesday, July 31, 2019 9:01 AM
To: dotCMS User Group
Subject: [dotcms] Re: OSGI Dependency issue with commons logging on 3.x

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,dDDxoO5dwpPiI9RhqkN-Jv13azzD5vgDQgfdImMH5NcpjUgX1Olr25IOV7byBd1OgXVzI2SKNTBUpwMN_9SWbtTGJM9NZgG_Dn1vBz9SgsUO1nA,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/30c0d3d5-0d03-4942-b977-f28a28301fa0%40googlegroups.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f30c0d3d5-0d03-4942-b977-f28a28301fa0%2540googlegroups.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,0n4__kKV8w4wIwnTYL1RMcIgZlhnk3ja6yeAqUYLt-tcK_WHIhoqeE43YowcVKUI9v9GUMtWMyx2EZpoE7K33zwpiGXUm6hrPvb_7DicJEPACX584Cye&typo=1>.

Falzone, Chris

unread,
Jul 31, 2019, 9:35:09 AM7/31/19
to dot...@googlegroups.com
All of the repackaged jars went away in 5x, you will want to provide those dependencies in your osgi bundle instead of using the ones that dotCMS used to provide.  

Hope it helps!

--
http://dotcms.com - Open Source Java Content Management

---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/1564578526334.5485%40gettysburg.edu.


--


Christopher Falzone / Web Developer
https://aquent.com

[ AQUENT ]


santosh yadav

unread,
Jul 31, 2019, 10:16:16 AM7/31/19
to dotCMS User Group
Hi,
please find my attached build.gradle can you help me.
build.gradle
build.gradle

Nathan Keiter

unread,
Jul 31, 2019, 10:48:45 AM7/31/19
to dot...@googlegroups.com
Example:


dependencies {
compile fileTree(dir: 'src/main/resources/libs', include: '*.jar')
compile (group: 'com.dotcms', name: 'dotcms', version: '5.1.5'){
transitive = true
}
providedCompile "javax.servlet:javax.servlet-api:3.1.0"
}


Where dotcms version is your target environment. Then Gradle compile. Gradle will tell you the errors. Then fix the errors. Then Gradle compile again.


It looks like you are on the right track. For a list of all available versions:

https://repo.dotcms.com/artifactory/libs-release/com/dotcms/dotcms/




Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993
https://www.gettysburg.edu
________________________________
From: dot...@googlegroups.com <dot...@googlegroups.com> on behalf of santosh yadav <az.san...@gmail.com>
Sent: Wednesday, July 31, 2019 10:16 AM
To: dotCMS User Group
Subject: [dotcms] Re: OSGI Dependency issue with commons logging on 3.x

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
Hi,
please find my attached build.gradle can you help me.

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,Nr3mdCcun1w2DMqHIkzdSjHalsXb9W7UWiEocjkpEtmlGj3Rs9njLaihbNkiHCf_JzJvoHoOwG39zwEau4qC87cEtNCa-y0lP_fQYu0-cd7sxa_TxBk,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/cff950ac-4534-497c-94ab-a898b58f769e%40googlegroups.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fcff950ac-4534-497c-94ab-a898b58f769e%2540googlegroups.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,4CIpgfEZ0iuWe548qk44qVyTrM8FgUTa9qz5c1cAateeu6KB1WqysAXlScBvqyClj30-4KeWTCyYvxCEWgzUQ9dyM9hNYh2PRZESQt3RzvSWFQ,,&typo=1>.

santosh yadav

unread,
Aug 1, 2019, 9:53:52 AM8/1/19
to dotCMS User Group
Hi,
How can i update maven, I am still struggling.
Capture.JPG
build.gradle

Falzone, Chris

unread,
Aug 1, 2019, 10:12:25 AM8/1/19
to dot...@googlegroups.com
I am not sure it is something the mailing list can easily help you with TBH. 
In General:  You need to add the dependencies to your project, then change your imports in your code.

On Thu, Aug 1, 2019 at 9:53 AM santosh yadav <az.san...@gmail.com> wrote:
Hi,
How can i update maven, I am still struggling.

--
http://dotcms.com - Open Source Java Content Management

---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/ace52b18-0826-484a-ba6e-ba4f333ced7c%40googlegroups.com.

Nathan Keiter

unread,
Aug 1, 2019, 10:23:33 AM8/1/19
to dot...@googlegroups.com
I agree with Chris. This isn't the best way to get help for your problem perhaps.


My general strategy:


Have an IDE workspace or project for each version level of dotCMS you need to support.


Start with an empty workspace at the appropriate version level:

https://dotcms.com/docs/latest/developing-from-source


Then add your custom code to the project. Work out any code compile errors indicated in your IDE. This is typically import path changes, but can also be business logic and API changes.


Finally Gradle compile your plugin and deploy it to test for run-time errors.


Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993
https://www.gettysburg.edu
________________________________
From: 'Falzone, Chris' via dotCMS User Group <dot...@googlegroups.com>
Sent: Thursday, August 1, 2019 10:12 AM
To: dot...@googlegroups.com
Subject: Re: [dotcms] Re: OSGI Dependency issue with commons logging on 3.x

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
I am not sure it is something the mailing list can easily help you with TBH.
In General: You need to add the dependencies to your project, then change your imports in your code.

On Thu, Aug 1, 2019 at 9:53 AM santosh yadav <az.san...@gmail.com<mailto:az.san...@gmail.com>> wrote:
Hi,
How can i update maven, I am still struggling.

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,1XunmkKLiYbN6VAXIMYkIQefkqzIPzRn52yUagbjx7Y-yy2Mm7e16GtB7LaN9oqc7Eq5IMUBJY75J_8B2wY1QviNbkmXkgAY7Qe5PvBz0A,,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/ace52b18-0826-484a-ba6e-ba4f333ced7c%40googlegroups.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2face52b18-0826-484a-ba6e-ba4f333ced7c%2540googlegroups.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,sPkxhCezdAVrutjTp5UrAta4C3NB8VF70WlReG4ay92nnvn5lgglcIdm9rOzfKONpGhnDQTpqyKWeN3b6Ybd2T-fiWSlIjB5YTfgU8DY5LVbh-rgc-oxyi44gtuV&typo=1>.


--


Christopher Falzone / Web Developer
https://aquent.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2faquent.com&c=E,1,j4PMTE3IR713mG21NkxrhMwWI5Noi7LA3ggoSln3k4FO3T-Bu4q5m7ij3aBl2P76MQX0Xz4FpTAVOp5pEOkLcaUyflgYfOxph9Bw40ExN9hcDklAuPF64cA,&typo=1>

[[ AQUENT ]]


--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,ij8kLlfflliO4q5Rmv7Xq_Quz5KXqVaXjA8aB2iXO5yYIQMjmvpR9ljSKhf7u-mTqWf6LoR9PngzSFVNtSaWZWaV-9DFVl08C5aNFATceA,,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAMAbHgW%2BxvXSCK1urowc5ww%2BUM4goBr2_rHgvze_dw5zOCwvzw%40mail.gmail.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAMAbHgW%252BxvXSCK1urowc5ww%252BUM4goBr2_rHgvze_dw5zOCwvzw%2540mail.gmail.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,4OkqXV8Bqois1BfVN2ZqYBEB8FLQWWhsRs5p6HOH4QTxwrc4aIP4XHkU8hcWQYEk1NufAmnT2-SsHL4fcjZF2QekSQg5KK0-fj44Tp9RMCRvWG0,&typo=1>.

Amit Singh

unread,
Aug 5, 2019, 7:37:36 AM8/5/19
to dotCMS User Group
All,
I'm also having the same issue. My team have developed 5 dynamic plugins in 4.2.2 version and it was working fine. However after we upgrade to 5.1.5 , it shows dependency issue. I know that after upgrade dotCMS have changed their existing code and not providing dependency anymore. Now we need to explicitly import the dependencies. Is there any document or reference exist so that we can refer and fix the dependency problem ?

Regards,
Amit

On Tuesday, 7 July 2015 23:27:31 UTC+5:30, Chris Falzone wrote:
I am running into an issue trying to use a library in my OSGI plugin that requires commons-logging as a dependency.

Has anyone run into this and what can I do to resolve it?  Or has anyone gotten a working SOAP Client deployed on dotCMS in an OSGI plugin?  It seems every library I use has some weird dependance issue I can't figure out.  Tried Axis, Axis2, JAX_WS, and now JAXB.

The internet seems to think this is because there are 2 versions on commons-logging in the classloader. I tried telling gradle that commons-logging was provided but it still embeds it as a dependency.  

ERROR: Bundle com.aquent.dotcms.osgi [15] Error starting/stopping bundle. (com.dotcms.repackage.org.osgi.framework.BundleException: Activator start error in bundle com.aquent.dotcms.osgi [15].)
org.apache.commons.logging.LogConfigurationException: User-specified log class 'org.apache.commons.logging.impl.Log4JLogger' cannot be found or is not useable.
at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:804)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:541)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:292)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:269)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:657)
at org.springframework.ws.client.core.support.WebServiceGatewaySupport.<init>(WebServiceGatewaySupport.java:56)
at com.aquent.ws.JobPostingServiceClient.<init>(JobPostingServiceClient.java:8)
at com.aquent.osgi.AquentActivator.start(AquentActivator.java:92)
at com.dotcms.repackage.org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
at com.dotcms.repackage.org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
at com.dotcms.repackage.org.apache.felix.framework.Felix.startBundle(Felix.java:2064)
at com.dotcms.repackage.org.apache.felix.framework.Felix.setBundleStartLevel(Felix.java:1483)
at com.dotcms.repackage.org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:334)
at java.lang.Thread.run(Thread.java:745)


Thanks!

Falzone, Chris

unread,
Aug 5, 2019, 8:34:03 AM8/5/19
to dot...@googlegroups.com
I hate to RTM on you, but .. RTM?  It's not a dotCMS thing, it's a java thing. (And to be more accurate, it's programming thing, not just a java thing.)

Choose your poison and read the docs on how to import dependencies.  Or find some tutorials on the subject.

A quick google search will point you at many more resources on how to do dependency management in Java.  It's not something we can teach you in an email over a mailing list. 

The one part that might be tricky is making sure you get your dependencies in the osgi bundle.  
This uses a fragment bundle, which is way to provide/expose dependencies to other bundles.  It can be useful if you have multiple plugins that need the same dependencies or if you have a larger project so you do not have to upload one really big jar evertime you make a change.  There is an example with just the fragment here:  https://github.com/dotCMS/plugin-seeds/tree/master/OSGi/com.dotcms.fragment

I personally (for smaller projects) prefer to just include everything in one bundle:
https://github.com/aquent/dotcms.plugins.geolocation

Compare the build.gradle file of these projects and see 2 (of many) different ways you can bundle your dependencies.

Hope it helps.


--
http://dotcms.com - Open Source Java Content Management

---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/8f4f108d-bf71-4757-bfcf-a1a11ba2108a%40googlegroups.com.


--


Christopher Falzone / Web Developer
https://aquent.com

[ AQUENT ]


Reply all
Reply to author
Forward
0 new messages