1
votes

I'm running with the following since three days and debugging/googling doesn't seem very helpful.

Well here's my context :

I have a legacy application -an Alfresco 3.4.d extenstion using war overlay- There's nothing special with the extension it self -a number of specific managers and services were developed and fully functional through spring contexts.

What I did is only upgrading Alfresco version from 3.4.d to 4.2.e, here's what I did :

  1. Installed Alfresco-4.2.e cummunity distribution somewhere on disk.
  2. On Eclipse, created a Tomcat server where CATALINA_BASE is the distribution TOMCAT.
  3. I followed the documentation to be able to deploy my extenstion instead of the original alfresco.war (removed actualy from $ALF/tomcat/webapps.
  4. I'm using MySQL and every thing is working well from this side.

My problem :

At application bootstrap time here's the exception that rises :

I understood that it's related to CXF but I can't figure out how to deal with it

.

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'smsManagerService': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1429)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 86 more
Caused by: java.lang.NullPointerException
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createBindingInfo(AbstractWSDLBasedEndpointFactory.java:338)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.java:252)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:147)
at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:90)
at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:153)
at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:151)
at org.apache.cxf.jaxws.spring.JaxWsProxyFactoryBeanDefinitionParser$JAXWSSpringClientProxyFactoryBean.create(JaxWsProxyFactoryBeanDefinitionParser.java:79)
at org.apache.cxf.jaxws.spring.JaxWsProxyFactoryBeanDefinitionParser$JAXWSSpringClientProxyFactoryBean.getObject(JaxWsProxyFactoryBeanDefinitionParser.java:83)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
... 91 more

Extras added after comments/discussion

smsManagerService code :

import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.Service;

/**
 * This class was generated by Apache CXF 2.7.6
 * 2013-09-20T12:05:27.093+02:00
 * Generated source version: 2.7.6
 * 
 */
@WebServiceClient(name = "managerService", 
              wsdlLocation = "CustomSoapi-dlw-1.61.wsdl",
              targetNamespace = "http://soapi.XXX.com/manager") 
public class ManagerService extends Service {

public final static URL WSDL_LOCATION;

public final static QName SERVICE = new QName("http://soapi.XXX.com/manager", "managerService");
public final static QName ManagerPort = new QName("http://soapi.XXX.com/manager", "managerPort");
static {
    URL url = ManagerService.class.getResource("CustomSoapi-dlw-1.61.wsdl");
    if (url == null) {
        url = ManagerService.class.getClassLoader().getResource("CustomSoapi-dlw-1.61.wsdl");
    } 
    if (url == null) {
        java.util.logging.Logger.getLogger(ManagerService.class.getName())
            .log(java.util.logging.Level.INFO, 
                 "Can not initialize the default wsdl from {0}", "CustomSoapi-dlw-1.61.wsdl");
    }       
    WSDL_LOCATION = url;
}

Migration to Alfresco 5.0.a (9/16/2014)


I recently go back to this issue in order to resolve it (i hope) but it seems it's still being hard to get it done.

Here's what I did and the context :

  1. I have an Alfresco Extension (using maven overlays) based on version 3.4.d and MySQL 5.5 (running in production)

  2. I installed Alfresco-5.0.a (On a Debian 64bits wheezy, JDK7) and run it : it worked

  3. I removed the original alfresco.war (and the exploded war) from $ALF/tomcat/webapps and replaced with a built alfresco.war from my extension project (Java 7, Maven 3.2.1) and of course I updated the Alfresco dependency to meet 5.0.a version.

  4. I kept the Postgres DB as is

  5. started the alfresco ./alfresco.sh start

  6. got this error and especially this part of the error :

    {http://www.alfresco.org/model/content/1.0}copiedfrom has not been defined in the data dictionary

The complete Error

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'copyService' defined in class path resource [alfresco/copy-services-context.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Association {http://www.alfresco.org/model/content/1.0}original of class {http://www.alfresco.org/model/content/1.0}copiedfrom has not been defined in the data dictionary
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
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:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 126 more
Caused by: java.lang.IllegalArgumentException: Association {http://www.alfresco.org/model/content/1.0}original of class **{http://www.alfresco.org/model/content/1.0}copiedfrom has not been defined in the data dictionary**
at org.alfresco.repo.policy.PolicyComponentImpl.bindAssociationBehaviour(PolicyComponentImpl.java:365)
at org.alfresco.repo.copy.CopyServiceImpl.init(CopyServiceImpl.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1544)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 133 more
2
Can you post the bean definition for smsManagerService ? - Gagravarr
I just added the code within the question body extras section. Thanks - Abderrazak BOUADMA
Alfresco uses a patched + old version of CXF, 2.2.2 AFAICT, while your code is generated by a much newer version of CXF. What happens if you try to recreate your class with the old version of CXF that Alfresco ships? (As an aside, I can't see the details of what Alfresco patched in the CXF jar, which is allowed under the license, but IIRC breaks normal Alfresco internal policy...) - Gagravarr
My colleague recently upgraded from 3.x to 4.2f. I remember him mentioning need to upgrade to 4.0 first and later to 4.2f. Simple googling says that other things require this, but I'm curious what you say about this? - Miki
I'll give it a try and make feed back. Thanks Miki - Abderrazak BOUADMA

2 Answers

1
votes

Recompile all of your Java source against the newer Alfresco classes and with JDK 1.7. The exact ones escape me, but some critical method signatures in places like the NodeService (I think) have changed.

0
votes

Verify the version of spring, it is changed.