cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco SDK Example

bhupendra9
Champ in-the-making
Champ in-the-making
Hi,

I have just started with Alfresco SDK 4.0.d. My question is while running the FirstFoundationClient.java code I get with following exception

Feb 22, 2013 10:56:01 AM org.activiti.engine.impl.ProcessEngineImpl <init>
INFO: ProcessEngine default created
Feb 22, 2013 10:56:09 AM org.activiti.engine.impl.ProcessEngineImpl <init>
INFO: ProcessEngine activitiBootstrapEngine created
Feb 22, 2013 10:56:09 AM org.activiti.engine.impl.jobexecutor.JobAcquisitionThread run
INFO: JobAcquisitionThread starting to acquire jobs
Exception in thread "main" org.alfresco.error.AlfrescoRuntimeException: 01220000 Workflow deployment failed
   at org.alfresco.repo.workflow.WorkflowDeployer.init(WorkflowDeployer.java:347)
   at org.alfresco.repo.workflow.WorkflowDeployer$1.doWork(WorkflowDeployer.java:465)
   at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:519)
   at org.alfresco.repo.workflow.WorkflowDeployer.onBootstrap(WorkflowDeployer.java:461)
   at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
   at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEventInternal(SafeApplicationEventMulticaster.java:209)
   at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:180)
   at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
   at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428)
   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.jdbc.BadSqlGrammarException:
### Error querying database.  Cause: org.postgresql.util.PSQLException: ERROR: column node.node_deleted does not exist
  Position: 420
### The error may involve alfresco.node.select_NodeByNodeRef-Inline
### The error occurred while setting parameters
### Cause: org.postgresql.util.PSQLException: ERROR: column node.node_deleted does not exist
  Position: 420
; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: column node.node_deleted does not exist
  Position: 420
   at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:98)
   at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
   at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
   at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
   at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:71)
   at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:346)
   at $Proxy2.selectOne(Unknown Source)
   at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:154)
   at org.alfresco.repo.domain.node.ibatis.NodeDAOImpl.selectNodeByNodeRef(NodeDAOImpl.java:408)
   at org.alfresco.repo.domain.node.AbstractNodeDAOImpl$NodesCacheCallbackDAO.findByValue(AbstractNodeDAOImpl.java:886)
   at org.alfresco.repo.domain.node.AbstractNodeDAOImpl$NodesCacheCallbackDAO.findByValue(AbstractNodeDAOImpl.java:842)
   at org.alfresco.repo.cache.lookup.EntityLookupCache.getByValue(EntityLookupCache.java:396)
   at org.alfresco.repo.domain.node.AbstractNodeDAOImpl.getNodePair(AbstractNodeDAOImpl.java:946)
   at org.alfresco.repo.node.db.DbNodeServiceImpl.getNodePairNotNull(DbNodeServiceImpl.java:172)
   at org.alfresco.repo.node.db.DbNodeServiceImpl.getChildAssocs(DbNodeServiceImpl.java:1677)
   at org.alfresco.repo.node.db.DbNodeServiceImpl.getChildAssocs(DbNodeServiceImpl.java:1664)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
   at org.alfresco.repo.tenant.MultiTNodeServiceInterceptor.invoke(MultiTNodeServiceInterceptor.java:104)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy4.getChildAssocs(Unknown Source)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:215)
   at $Proxy5.getChildAssocs(Unknown Source)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
   at org.alfresco.repo.tagging.TagScopePropertyMethodInterceptor.invoke(TagScopePropertyMethodInterceptor.java:152)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:305)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.tagging.TagScopePropertyMethodInterceptor.invoke(TagScopePropertyMethodInterceptor.java:152)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.tagging.TagScopePropertyMethodInterceptor.invoke(TagScopePropertyMethodInterceptor.java:152)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:305)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:269)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:305)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:269)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:269)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy4.getChildAssocs(Unknown Source)
   at org.alfresco.repo.dictionary.DictionaryRepositoryBootstrap.resolveQNamePath(DictionaryRepositoryBootstrap.java:656)
   at org.alfresco.repo.dictionary.DictionaryRepositoryBootstrap.getNodes(DictionaryRepositoryBootstrap.java:446)
   at org.alfresco.repo.dictionary.DictionaryRepositoryBootstrap.onDictionaryInit(DictionaryRepositoryBootstrap.java:253)
   at org.alfresco.repo.dictionary.DictionaryDAOImpl.initDictionaryRegistry(DictionaryDAOImpl.java:261)
   at org.alfresco.repo.dictionary.DictionaryDAOImpl.access$000(DictionaryDAOImpl.java:58)
   at org.alfresco.repo.dictionary.DictionaryDAOImpl$1.doWork(DictionaryDAOImpl.java:207)
   at org.alfresco.repo.dictionary.DictionaryDAOImpl$1.doWork(DictionaryDAOImpl.java:202)
   at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:519)
   at org.alfresco.repo.dictionary.DictionaryDAOImpl.initDictionary(DictionaryDAOImpl.java:201)
   at org.alfresco.repo.dictionary.DictionaryDAOImpl.getDictionaryRegistry(DictionaryDAOImpl.java:1046)
   at org.alfresco.repo.dictionary.DictionaryDAOImpl.getCompiledModels(DictionaryDAOImpl.java:1142)
   at org.alfresco.repo.dictionary.DictionaryDAOImpl.getCompiledModels(DictionaryDAOImpl.java:862)
   at org.alfresco.repo.dictionary.DictionaryDAOImpl.getModels(DictionaryDAOImpl.java:791)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:132)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:105)
   at org.alfresco.repo.workflow.WorkflowDeployer.init(WorkflowDeployer.java:257)
   … 14 more
Caused by: org.postgresql.util.PSQLException: ERROR: column node.node_deleted does not exist
  Position: 420
   at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
   at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
   at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
   at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
   at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
   at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:381)
   at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
   at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
   at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
   at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:39)
   at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:55)
   at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:41)
   at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:120)
   at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:75)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:75)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:69)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:40)
   at sun.reflect.GeneratedMethodAccessor97.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:338)
   … 84 more



I am using postgres as the database.My Alfresco global.properties is


# Sample custom content and index data location
#

dir.root=/opt/alfresco-4.2.c/alf_data


db.username=alfresco
db.password=admin

#
# MySQL connection (This is default and requires mysql-connector-java-3.1.12-bin.jar, which ships with the Alfresco server)
#
db.driver=org.postgresql.Driver
db.url=jdbcSmiley Tongueostgresql://localhost:5432/alfresco


### hibernate settings ###
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.query.substitutions=true TRUE, false FALSE
#
# Oracle connection (requires ojdbc14_g.jar or equivalent jar in shared libraries location)
#
#db.driver=oracle.jdbc.OracleDriver
#db.url=jdbcSmiley Surprisedracle:thin:@localhost:1521:alfresco

#
# Sybase connection (requires jconn2d.jar or equivalent jar in shared libraries location)
#
#db.driver=com.sybase.jdbc2.jdbc.SybDriver
#db.url=jdbc:sybase:Tds:localhost:2638/alfresco

#
# Properties shared between the Alfresco server
# and its remote clients (e.g.: the virtualization server).
#
# Ports used by Alfresco
#
# Note:  These ports are also used by the virtualization server
#        (hence, they're in a seperate file that can be copied easily).

# Remote RMI services
# alfresco.rmi.services.port=50500
# alfresco.rmi.services.host=localhost


Please help me out.






2 REPLIES 2

muralidharand
Star Contributor
Star Contributor
It looks like, there is a schema problem because of the different version.
Because,  your alfresco version is 4.2c and your SDK version is 4.0.2. I would suggest, please try with alfresco 4.2c sdk.

https://wiki.alfresco.com/wiki/Community_file_list_4.2.c

amrorabi
Champ in-the-making
Champ in-the-making
It may help someone:
I faced this issue, and it is solved when i set the "dir.root" in the properties file with the correct value