cancel
Showing results for 
Search instead for 
Did you mean: 

Problem setting up Eclipse on Mac

col_edinburgh
Champ in-the-making
Champ in-the-making
Hello, I am trying to setup the SDK on Eclipse on my Mac but am struggling to get it to work. The main problem is I have no experience of setting up a Java envirnoment and don't understand some of the steps on the guidehttp://wiki.alfresco.com/wiki/Alfresco_SDK_3.4

The parts I didn't understand are in bold.


Reviewing the steps on the guide:

1 JDK 1.6 - check
  Eclipse IDE - check
My SQL - I assume I don't require this as it's installed with Alfresco CE. Do I need a separate database for the SDK ?

2 Download the Alfresco Community Edition Release - check, version 3.4.d installed and working on localhost.

3 Download the Alfresco SDK The SDK bundle - check, downloaded alfresco-community-sdk-3.4.d.zip from http://wiki.alfresco.com/wiki/Community_file_list_3.4.d

4 Unpack the downloaded package to a file system folder of your choice- check, though I note the /extras folder is not there

Getting Started

Install 3.4 Community Edition Alfresco - done

Set Eclipse Compiler Compliance Level to 6.0 - done

Handle finding Win32NetBios or Win64NetBios. Add the alfresco bin folder to the system PATH - I have no idea how to do this

Import the Alfresco Eclipse Projects - done

Modify Projects to run against Alfresco CE installation. I don't know what's required here - do I just change the alfresco-global.properties in SDK AlfrescoEmbedded, etc with the file from the Alfresco CE installation ?

Fix Issues Identified Already - I haven't got a clue what this is referring to

Associate source code and Javadocs with Alfresco Libraries (optional) - done for SDK AlfrescoEmbedded, alfresco-core.jar, alfresco-remote-api.jar, alfresco-web-client.jar and alfresco-web-service-client.jar, only sources are available. Not done for alfresco-share.jar, I dont know where this jar file is

Running your first Alfresco Client: on Eclipse I selected the SDK FirstFoundationClient project and selected Run As Java Application which spat out the following errors:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'RepoServerMgmt' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'transactionService' while setting bean property 'transactionService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionService' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [alfresco/hibernate-context.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [alfresco/hibernate-context.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1305)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
   at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
   at org.alfresco.util.BaseApplicationContextHelper.getApplicationContext(BaseApplicationContextHelper.java:67)
   at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:46)
   at org.alfresco.sample.FirstFoundationClient.main(FirstFoundationClient.java:63)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionService' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [alfresco/hibernate-context.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [alfresco/hibernate-context.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1305)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
   … 17 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [alfresco/hibernate-context.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [alfresco/hibernate-context.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1305)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
   … 27 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [alfresco/hibernate-context.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
   … 37 more
Caused by: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
   at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:59)
   at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
   at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:426)
   at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:128)
   at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2073)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1298)
   at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:855)
   at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:774)
   at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
   … 44 more
1 REPLY 1

jpotts
World-Class Innovator
World-Class Innovator
First off, welcome to the world of Alfresco. We're glad you're here.

Second, I want to apologize for the state of the SDK and for not having better resources out there for people new to both Java and Alfresco. Our doc is constantly improving, but our SDK is something that has been in dire need of some tender loving care for quite some time. If anyone comes across this that would like to volunteer to make the SDK better, let me know. That'd be a fun community project for someone, I think.

Anyway, let's look at each of your concerns in turn.

My SQL - I assume I don't require this as it's installed with Alfresco CE. Do I need a separate database for the SDK ?

Depending on the version of Alfresco you installed, if you installed the bundle, you may be running either MySQL or PostgreSQL. In any case, the database is only required by the Alfresco repository. Your SDK isn't an application–it's just a set of dependencies and examples–so it doesn't need a database.

though I note the /extras folder is not there

I note that as well. I'll probably tweak the wiki accordingly.

Handle finding Win32NetBios or Win64NetBios. Add the alfresco bin folder to the system PATH - I have no idea how to do this

You're on a Mac and this is nasty Windows talk so just ignore. Smiley Happy

Modify Projects to run against Alfresco CE installation. I don't know what's required here - do I just change the alfresco-global.properties in SDK AlfrescoEmbedded, etc with the file from the Alfresco CE installation ?

What's going on here is that many (all?) of the SDK Examples start and run the Alfresco repository in its own process. That means (1) You don't want to have your local Alfresco running when you run them and (2) You need to tell each of those examples how to connect to your repository DB and where your repository data directory lives. If you already have a running local Alfresco install, you can copy your existing alfresco-global.properties over the one in the SDK Example project and it should just work.

Fix Issues Identified Already - I haven't got a clue what this is referring to

Me neither. Seems like a non sequitur that ought to be cleaned up.

Not done for alfresco-share.jar, I dont know where this jar file is

This looks like it no longer exists in the current version.

I hadn't run any of the SDK examples in quite some time, but I did copy my alfresco-global.properties into the alfresco-global.properties in FirstFoundationClient. I then launched the app and it ran successfully, printing nothing (good or bad) to the log. Just to validate it did something I set a breakpoint and launched it again via the debugger, and I could see that it was successfully working with content in the repo.

I hope this helps you get off the mark. I will also suggest that you pick up an Alfresco book (there are many, depending on what you are trying to do) because IDE setup is a typical topic covered.

Hope that helps!

Jeff