cancel
Showing results for 
Search instead for 
Did you mean: 

Need Help on Executing Samples

ajaiking
Champ in-the-making
Champ in-the-making
Hi,

I am new to Alfresco, and am trying to execute a sample program, "FirstFoundationClient". I did the following steps,
1. Downloaded the Alfresco-Enterprise-3.1-Full-Setup and installed it on MySQL and was successfully able to login to the client.
2. Stopped the Alfresco server.
3. Downloaded the alfresco-labs-sdk-3a.1032.zip and configured in eclipse and added jars "alfresco-jlan-embed.jar,
alfresco-webscript-framework.jar" to the java build path as mentioned.
4. I have my "custom-alfresco-shared.properties" file as mentioned below:
#dir.root=./alf_dataC:\Alfresco-sql\alf_data
dir.root=c:/Alfresco-sql/alf_data


db.username=alfresco
db.password=alfresco

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

5.  When i try to execute the Class "FirstFoundationClient" i am facing the below mentioned exception:

20:36:17,084  INFO  [config.xml.XMLConfigService$PropertyConfigurer] Loading properties file from class path resource [alfresco/file-servers.properties]
20:36:19,631  WARN  [remoting.rmi.RmiRegistryFactoryBean] Could not detect RMI registry - creating new one
20:36:26,162  INFO  [domain.schema.SchemaBootstrap] Schema managed by database dialect org.hibernate.dialect.MySQLInnoDBDialect.
20:36:26,897  INFO  [domain.schema.SchemaBootstrap] Executing database script C:\DOCUME~1\ajaig\LOCALS~1\Temp\Alfresco\AlfrescoSchemaUpdate-org.hibernate.dialect.MySQLInnoDBDialect-3595134522819901543.sql (Copied from classpath:alfresco/dbscripts/upgrade/2.2/org.hibernate.dialect.MySQLInnoDBDialect/upgrade-1-drop-indexes-and-constraints.sql).
20:36:27,772  ERROR [domain.schema.SchemaBootstrap] Statement execution failed:
   SQL:  ALTER TABLE alf_audit_fact DROP INDEX FKEAD18174A0F9B8D9, DROP FOREIGN KEY FKEAD18174A0F9B8D9
   Error: Can't DROP 'FKEAD18174A0F9B8D9'; check that column/key exists
   File: C:\DOCUME~1\ajaig\LOCALS~1\Temp\Alfresco\AlfrescoSchemaUpdate-org.hibernate.dialect.MySQLInnoDBDialect-3595134522819901543.sql
   Line: 51
20:36:27,772  ERROR [domain.schema.SchemaBootstrap] Schema auto-update failed
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Can't DROP 'FKEAD18174A0F9B8D9'; check that column/key exists
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
   at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
   at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
   at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
   at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)
   at com.mysql.jdbc.Connection.execSQL(Connection.java:3047)
   at com.mysql.jdbc.Statement.execute(Statement.java:692)
   at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:261)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.executeStatement(SchemaBootstrap.java:872)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.executeScriptFile(SchemaBootstrap.java:841)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.executeScriptUrl(SchemaBootstrap.java:707)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.checkSchemaPatchScripts(SchemaBootstrap.java:678)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.updateSchema(SchemaBootstrap.java:600)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:1005)
   at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62)
   at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
   at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
   at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
   at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:241)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:349)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
   at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:55)
   at org.alfresco.sample.FirstFoundationClient.main(FirstFoundationClient.java:69)
Exception in thread "main" org.alfresco.error.AlfrescoRuntimeException: Schema auto-update failed
   at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:1074)
   at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62)
   at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
   at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
   at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
   at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:241)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:349)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
   at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:55)
   at org.alfresco.sample.FirstFoundationClient.main(FirstFoundationClient.java:69)
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Can't DROP 'FKEAD18174A0F9B8D9'; check that column/key exists
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
   at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
   at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
   at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
   at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)
   at com.mysql.jdbc.Connection.execSQL(Connection.java:3047)
   at com.mysql.jdbc.Statement.execute(Statement.java:692)
   at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:261)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.executeStatement(SchemaBootstrap.java:872)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.executeScriptFile(SchemaBootstrap.java:841)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.executeScriptUrl(SchemaBootstrap.java:707)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.checkSchemaPatchScripts(SchemaBootstrap.java:678)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.updateSchema(SchemaBootstrap.java:600)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:1005)
   … 10 more


Also i took an alternate approach, first executed the class and then starting the installation Alfresco server.
1. When i try to run the FirstFoundationClient class it gave me the following exception

20:39:44,670  INFO  [config.xml.XMLConfigService$PropertyConfigurer] Loading properties file from class path resource [alfresco/file-servers.properties]
20:39:46,342  WARN  [remoting.rmi.RmiRegistryFactoryBean] Could not detect RMI registry - creating new one
20:39:49,717  INFO  [domain.schema.SchemaBootstrap] Schema managed by database dialect org.hibernate.dialect.MySQLInnoDBDialect.
20:39:49,858  INFO  [domain.schema.SchemaBootstrap] Executing database script C:\DOCUME~1\ajaig\LOCALS~1\Temp\Alfresco\AlfrescoSchemaCreate-org.hibernate.dialect.MySQLInnoDBDialect-4343487318631065547.sql (Generated).
20:40:08,515  INFO  [domain.schema.SchemaBootstrap] Executing database script C:\DOCUME~1\ajaig\LOCALS~1\Temp\Alfresco\AlfrescoSchemaUpdate-org.hibernate.dialect.MySQLInnoDBDialect-96231939548160136.sql (Copied from classpath:alfresco/dbscripts/create/2.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-2.2-MappedFKIndexes.sql).
20:40:08,546  INFO  [domain.schema.SchemaBootstrap] Executing database script C:\DOCUME~1\ajaig\LOCALS~1\Temp\Alfresco\AlfrescoSchemaUpdate-org.hibernate.dialect.MySQLInnoDBDialect-7458973477829891943.sql (Copied from classpath:alfresco/dbscripts/create/2.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-2.2-Extra.sql).
20:40:09,171  INFO  [domain.schema.SchemaBootstrap] Executing database script C:\DOCUME~1\ajaig\LOCALS~1\Temp\Alfresco\AlfrescoSchemaUpdate-org.hibernate.dialect.MySQLInnoDBDialect-4052388261487565624.sql (Copied from classpath:alfresco/dbscripts/create/3.0/org.hibernate.dialect.MySQLInnoDBDialect/create-activities-extras.sql).
20:40:09,765  INFO  [domain.schema.SchemaBootstrap] All executed statements written to file C:\DOCUME~1\ajaig\LOCALS~1\Temp\Alfresco\AlfrescoSchemaUpdate-All_Statements-8434988498841173228.sql.
20:41:13,564 User:System INFO  [repo.admin.ConfigurationChecker] The Alfresco root data directory ('dir.root') is: c:\Alfresco-sql\alf_data
20:41:13,595 User:System INFO  [admin.patch.PatchExecuter] Checking for patches to apply …
20:41:15,455 User:System INFO  [admin.patch.PatchExecuter]
=== Applied patch                 ===
ID: patch.db-V3.0-0-CreateActivitiesExtras
RESULT:
Script completed
=====================================
20:41:15,455 User:System INFO  [repo.module.ModuleServiceImpl] Found 0 module(s).
Exception in thread "CIFS Server" java.lang.UnsatisfiedLinkError: org.alfresco.jlan.netbios.win32.Win32NetBIOS.BindSocket(I[BZ)I
   at org.alfresco.jlan.netbios.win32.Win32NetBIOS.BindSocket(Native Method)
   at org.alfresco.jlan.netbios.win32.NetBIOSSocket.createListenerSocket(NetBIOSSocket.java:182)
   at org.alfresco.jlan.netbios.win32.NetBIOSSocket.createListenerSocket(NetBIOSSocket.java:154)
   at org.alfresco.jlan.smb.server.win32.Win32NetBIOSSessionSocketHandler.initializeWinsockNetBIOS(Win32NetBIOSSessionSocketHandler.java:385)
   at org.alfresco.jlan.smb.server.win32.Win32NetBIOSSessionSocketHandler.initializeSessionHandler(Win32NetBIOSSessionSocketHandler.java:334)
   at org.alfresco.jlan.smb.server.ThreadedCifsConnectionsHandler.initializeHandler(ThreadedCifsConnectionsHandler.java:314)
   at org.alfresco.jlan.smb.server.SMBServer.run(SMBServer.java:513)
   at java.lang.Thread.run(Unknown Source)
20:41:17,174 User:System WARN  [alfresco.util.OpenOfficeConnectionTester] An initial OpenOffice connection could not be established.
20:41:17,205 User:System INFO  [service.descriptor.DescriptorService] Alfresco JVM - v1.6.0_11-b03; maximum heap size 63.563MB
20:41:17,205 User:System WARN  [service.descriptor.DescriptorService] Alfresco JVM - WARNING - maximum heap size 63.563MB is less than recommended 512MB
20:41:17,205 User:System INFO  [service.descriptor.DescriptorService] Alfresco started (Labs): Current version 3.0.0 (a 1032) schema 128 - Installed version 3.0.0 (a 1032) schema 128
2. After this when i try to start the Alfresco server, i get the following error

Jun 5, 2009 8:43:23 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jun 5, 2009 8:43:23 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1112 ms
Jun 5, 2009 8:43:23 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jun 5, 2009 8:43:23 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
Jun 5, 2009 8:43:23 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive alfresco.war
Jun 5, 2009 8:43:26 PM org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "org.apache.myfaces.webapp.StartupServletContextListener" is already configured for this context. The duplicate definition has been ignored.
20:43:40,835  INFO  [alfresco.config.SystemPropertiesFactoryBean] Loading properties file from class path resource [alfresco/domain/hibernate-cfg.properties]
20:43:40,835  INFO  [alfresco.config.SystemPropertiesFactoryBean] Loading properties file from class path resource [alfresco/extension/custom-hibernate-dialect.properties]
20:44:00,117  INFO  [config.xml.XMLConfigService$PropertyConfigurer] Loading properties file from class path resource [alfresco/file-servers.properties]
20:44:10,602  INFO  [domain.schema.SchemaBootstrap] Schema managed by database dialect org.hibernate.dialect.MySQLInnoDBDialect.
20:44:10,837  INFO  [domain.schema.SchemaBootstrap] Executing database script C:\Alfresco-sql\tomcat\temp\Alfresco\AlfrescoSchemaUpdate-org.hibernate.dialect.MySQLInnoDBDialect-4252253947123586785.sql (Copied from classpath:alfresco/dbscripts/upgrade/2.2/org.hibernate.dialect.MySQLInnoDBDialect/upgrade-from-2.2SP1.sql).
20:44:13,665  INFO  [domain.schema.SchemaBootstrap] Executing database script C:\Alfresco-sql\tomcat\temp\Alfresco\AlfrescoSchemaUpdate-org.hibernate.dialect.MySQLInnoDBDialect-9022147495361603443.sql (Copied from classpath:alfresco/dbscripts/upgrade/2.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoSchemaUpdate-Person.sql).
20:44:15,680  INFO  [domain.schema.SchemaBootstrap] Executing database script C:\Alfresco-sql\tomcat\temp\Alfresco\AlfrescoSchemaUpdate-org.hibernate.dialect.MySQLInnoDBDialect-1760878858590011382.sql (Copied from classpath:alfresco/dbscripts/upgrade/2.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoSchemaUpdate-2.1-AuditPathIndex.sql).
20:44:15,868  INFO  [domain.schema.SchemaBootstrap] All executed statements written to file C:\Alfresco-sql\tomcat\temp\Alfresco\AlfrescoSchemaUpdate-All_Statements-1637317397016925072.sql.
20:44:16,680  DEBUG [avm.TransactionalLookupCache.init] preRegister called. Server=com.sun.jmx.mbeanserver.JmxMBeanServer@27391d, name=log4j:logger=org.alfresco.repo.avm.TransactionalLookupCache.init
20:44:21,290 User:System WARN  [service.descriptor.DescriptorService] Alfresco license: Failed to verify license - Invalid License!
20:44:21,290 User:System WARN  [service.descriptor.DescriptorService] Alfresco license: Restricted Alfresco Repository to read-only capability
20:44:21,790 User:System INFO  [repo.admin.ConfigurationChecker] The Alfresco root data directory ('dir.root') is: C:\Alfresco-sql\alf_data
20:44:21,868 User:System WARN  [admin.patch.PatchExecuter] Patches cannot be applied to a read-only system.  Possible incompatibilities may exist between the application code and the existing data.
20:44:21,899 User:System INFO  [repo.module.ModuleServiceImpl] Found 1 module(s).
20:44:21,899 User:System ERROR [web.context.ContextLoader] Context initialization failed
org.alfresco.error.AlfrescoRuntimeException: Failed to start modules
        at org.alfresco.repo.module.ModuleComponentHelper$1.doWork(ModuleComponentHelper.java:309)
        at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:489)
        at org.alfresco.repo.module.ModuleComponentHelper.startModules(ModuleComponentHelper.java:203)
        at org.alfresco.repo.module.ModuleServiceImpl.startModules(ModuleServiceImpl.java:137)
        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:304)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy60.startModules(Unknown Source)
        at org.alfresco.repo.module.ModuleStarter$1.execute(ModuleStarter.java:70)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:322)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:248)
        at org.alfresco.repo.module.ModuleStarter.onBootstrap(ModuleStarter.java:74)
        at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62)
        at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
        at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:246)
        at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:617)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:355)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:189)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:516)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
        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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.alfresco.repo.security.permissions.AccessDeniedException: Access Denied.  The system is currently in read-only mode.
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:271)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:229)
        at org.alfresco.repo.module.ModuleComponentHelper$1.doWork(ModuleComponentHelper.java:267)
        … 52 more
Jun 5, 2009 8:44:21 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Jun 5, 2009 8:44:21 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/alfresco] startup failed due to previous errors
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
Jun 5, 2009 8:44:25 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive share.war
20:44:30,494  INFO  [web.site.FrameworkHelper] Successfully Initialized Web Framework
Jun 5, 2009 8:44:31 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jun 5, 2009 8:44:31 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 68128 ms

Kindly guide me on how to proceed further

Thanks in advance

Regards
Ajai G
1 REPLY 1

ajaiking
Champ in-the-making
Champ in-the-making
Hi,

I need this help, Kindly help me out

Regards,
Ajai G