4

Currently I am developing an Storage Extension for Tridion 2013 SP1. I want to intercept storing Binaries to the Broker.

When I publish I get the following error:

2018-04-10 15:45:41,205 ERROR JPADAOFactory - Unable to load JPA DAO with name: Binary and class: com.tridion.storage.extensions.BinaryContentDAOImpl due too exception in DAO construction
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'BinaryContentDAOImpl' is defined
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:529) ~[spring-beans.jar:3.1.0.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1095) ~[spring-beans.jar:3.1.0.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:277) ~[spring-beans.jar:3.1.0.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:201) ~[spring-beans.jar:3.1.0.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105) ~[spring-context.jar:3.1.0.RELEASE]
    at com.tridion.storage.persistence.JPADAOFactory.configureBundle(JPADAOFactory.java:81) ~[cd_datalayer.jar:na]
    at com.tridion.storage.configuration.StorageFactoryConfigurationLoader.configureStorage(StorageFactoryConfigurationLoader.java:91) [cd_datalayer.jar:na]
    at com.tridion.storage.configuration.StorageFactoryConfigurationLoader.configureStorage(StorageFactoryConfigurationLoader.java:65) [cd_datalayer.jar:na]
    at com.tridion.storage.configuration.StorageFactoryConfigurationLoader.configure(StorageFactoryConfigurationLoader.java:51) [cd_datalayer.jar:na]
    at com.tridion.configuration.step.ConfigurationStepLoader.configure(ConfigurationStepLoader.java:47) [cd_core.jar:na]
    at com.tridion.storage.StorageManagerFactory.configure(StorageManagerFactory.java:137) [cd_datalayer.jar:na]
    at com.tridion.services.BaseService.<init>(BaseService.java:107) [cd_core.jar:na]
    at com.tridion.storage.StorageManagerFactory.<init>(StorageManagerFactory.java:104) [cd_datalayer.jar:na]
    at com.tridion.storage.StorageManagerFactory.reloadInstance(StorageManagerFactory.java:84) [cd_datalayer.jar:na]
    at com.tridion.storage.StorageManagerFactory.<clinit>(StorageManagerFactory.java:56) [cd_datalayer.jar:na]
    at com.tridion.storage.deploy.PageHandler.deploy(PageHandler.java:58) [cd_datalayer.jar:na]
    at com.tridion.deployer.DeploymentHandler.deploy(DeploymentHandler.java:90) [cd_datalayer.jar:na]
    at com.tridion.deployer.modules.PageDeploy.processPage(PageDeploy.java:145) [cd_deployer.jar:na]
    at com.tridion.deployer.modules.PageDeploy.processItem(PageDeploy.java:118) [cd_deployer.jar:na]
    at com.tridion.deployer.SectionVisitor.processSection(SectionVisitor.java:83) [cd_deployer.jar:na]
    at com.tridion.deployer.SectionVisitor.process(SectionVisitor.java:60) [cd_deployer.jar:na]
    at com.tridion.deployer.Processor.process(Processor.java:109) [cd_deployer.jar:na]
    at com.tridion.deployer.workers.ProcessorWorker.doWork(ProcessorWorker.java:77) [cd_deployer.jar:na]
    at com.tridion.deployer.phases.ProcessingPhase.execute(ProcessingPhase.java:72) [cd_deployer.jar:na]
    at com.tridion.deployer.phases.DeployPipelineExecutor.runMainExecutePhase(DeployPipelineExecutor.java:186) [cd_deployer.jar:na]
    at com.tridion.deployer.phases.DeployPipelineExecutor.doExecute(DeployPipelineExecutor.java:97) [cd_deployer.jar:na]
    at com.tridion.deployer.phases.DeployPipelineExecutor.execute(DeployPipelineExecutor.java:61) [cd_deployer.jar:na]
    at com.tridion.deployer.TransactionManager.handleDeployPackage(TransactionManager.java:82) [cd_deployer.jar:na]
    at com.tridion.deployer.queue.QueueLocationHandler$1.run(QueueLocationHandler.java:175) [cd_deployer.jar:na]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [na:1.7.0_79]
    at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.7.0_79]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_79]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_79]
    at java.lang.Thread.run(Unknown Source) [na:1.7.0_79]

I think I am missing something very simple in setting up the class / configuration because I am not very familiar with Java / Spring (since I am a .NET developer).

I have the following class:

package com.tridion.storage.extensions;

import java.util.Collection;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.tridion.broker.StorageException;
import com.tridion.storage.BinaryContent;
import com.tridion.storage.dao.BinaryContentDAO;
import com.tridion.storage.persistence.JPABaseDAO;

@Component ("BinaryContentDAOImpl")
@Scope ("prototype")

public class BinaryContentDAOImpl extends JPABaseDAO  implements BinaryContentDAO {

    public BinaryContentDAOImpl(String storageId, EntityManagerFactory entityManagerFactory, EntityManager entityManager, String storageName) {
        super(storageId, entityManagerFactory, entityManager, storageName);
    }

    public BinaryContentDAOImpl(String storageId, EntityManagerFactory entityManagerFactory, String storageName) {
        super(storageId, entityManagerFactory, storageName);
        // TODO Auto-generated constructor stub
    }



    @Override
    public void create(BinaryContent arg0, String arg1) throws StorageException {
        // TODO Auto-generated method stub

    }

    @Override
    public Collection<BinaryContent> findAll(int arg0) throws StorageException {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public BinaryContent findByPrimaryKey(int arg0, int arg1, String arg2) throws StorageException {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public void remove(int arg0, int arg1, String arg2, String arg3) throws StorageException {
        // TODO Auto-generated method stub

    }

    @Override
    public void update(BinaryContent arg0, String arg1, String arg2) throws StorageException {
        // TODO Auto-generated method stub

    }

}

I have created the following dao configuration file:

enter image description here

In my cd_storage_conf.xml I have the following:

enter image description here

At last I have added the jar to the lib folder of the Deployer (the name of the jar can be anything, right?).

Could you please help me out?

  • 2
    Everything seems ok. Are you sure that your class is in the 'com.tridion.storage' package? (first line of your class): package com.tridion.storage.extensions – Albert Romkes Apr 10 '18 at 20:19
  • Thank you for you reply, I use indeed: package com.tridion.storage.extension. I will also update my question. – Peter van der Lugt Apr 11 '18 at 6:10
  • You seem to be missing a constructor: public BinaryContentDAOImpl(String storageId, EntityManagerFactory entityManagerFactory, String storageName) – Albert Romkes Apr 11 '18 at 6:25
  • Indeed, As @AlbertRomkes highlighted constructor missing. refer to this class github.com/SI4T/SI4T/blob/1.1.2013/storage-extensions/src/main/… – Velmurugan Apr 11 '18 at 7:22
  • Hi Albert, Velmurugan. I added the other constructor (thought one was optional) but I get still the same error. – Peter van der Lugt Apr 11 '18 at 8:39
3

FOUND IT! It has cost me (and you) a lot of time, and the issue was indeed not in the code / configuration itselves. The solution is so simple that I am almost ashamed to share it ...

When exporting the jar file I had to select 'Add directory entries':

enter image description here

Thank you all for your advise.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.