cancel
Showing results for 
Search instead for 
Did you mean: 

File Upload Problem

rreinart
Champ in-the-making
Champ in-the-making
I have just installed Alfresco, and the installation seems to work fine–in that I can browse spaces and view stock files no prob. But when I try to upload content (i.e. choose 'add content', browse to content file and hit 'upload'), I am instantly logged out of Alfresco and redirected to the login  page. The chosen file is not uploaded as content.
I imagine this is a simple configuration issue, but I've been snooping around the application for a while and haven't been able to solve the problem. I'm on Win XP Pro, running spec (tomcat/mysql).
Any comments?
Thanks.
6 REPLIES 6

gavinc
Champ in-the-making
Champ in-the-making
You have found a security issue here, currently the authentication filter is not being called for the upload form. However, this shouldn't cause you go to back to the login page, I'm not sure why you get that behaviour. Do you see any errors on the console or in the <tomcat-home>/bin/alfresco.log file?

Have you made any configuration changes to any of the files from the preview?

One thing you could try is adding the configuration for the authentication filter to be called before the upload (this will be fixed for the next preview release):

<filter-mapping>
   <filter-name>Authentication Filter</filter-name>
   <url-pattern>/uploadFileServlet</url-pattern>
</filter-mapping>

rreinart
Champ in-the-making
Champ in-the-making
Thanks a lot for the quick reply. No, I haven't made any configuration changes to any of the preview files. But, I have the following errors logged (??):
17:31:07,640 ERROR [org.hibernate.util.JDBCExceptionReporter] Cannot create PoolableConnectionFactory (Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: java.net.ConnectException: Connection refused: connect

STACKTRACE:

java.net.SocketException: java.net.ConnectException: Connection refused: connect
   at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:151)
   at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:280)
   at com.mysql.jdbc.Connection.createNewIO(Connection.java:1774)
   at com.mysql.jdbc.Connection.<init>(Connection.java:437)
   at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:268)
   at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37)
   at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
   at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:877)
   at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851)
   at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
   at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:79)
   at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
   at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
   at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:758)
   at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:685)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:937)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:334)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:222)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:146)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:176)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:105)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:891)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:707)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:316)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:222)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:146)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:176)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:105)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:891)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:707)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:316)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:222)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:146)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getType(AbstractBeanFactory.java:330)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.isBeanTypeMatch(DefaultListableBeanFactory.java:251)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:145)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:200)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:194)
   at org.alfresco.repo.service.ServiceDescriptorRegistry.postProcessBeanFactory(ServiceDescriptorRegistry.java:71)
   at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:371)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:292)
   at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:133)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:156)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3669)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4104)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:788)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:677)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1102)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
   at org.apache.catalina.core.StandardService.start(StandardService.java:450)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
   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:585)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)


** END NESTED EXCEPTION **

)
17:31:11,593 ERROR [org.alfresco.repo.content.transform.magick.AbstractImageMagickContentTransformer] JMagickContentTransformer not available:
17:31:11,625 ERROR [org.alfresco.repo.content.transform.magick.AbstractImageMagickContentTransformer] ImageMagickContentTransformer not available: Failed to execute command: imconvert C:\alfresco\tomcat\temp\Alfresco\ImageMagickContentTransformer_init_source_8915.gif C:\alfresco\tomcat\temp\Alfresco\ImageMagickContentTransformer_init_target_8916.png

The imconvert file is in <alfresco-home>/bin.
I notice that in <tomcat>/alfresco/contentstore there are number of what appear to be temp files (i.e named 20+ alphanumeric strings).
I haven't tried adding the authentication filter configuration, but will if, given the above, you think it might be helpful. (btw, where would I add the reconfig language you suggested?)
Thanks tons!

gavinc
Champ in-the-making
Champ in-the-making
Given the exception you're seeing I'm surprised you're able to see any of the application!

The exception is reporting a problem connecting to the MySQL database, so theoretically you shouldn't have even been able to log in?

From a command window try checking you can login to the database by doing:

mysql -u alfresco -palfresco alfresco

Also check your MySQL version, you need to have 4.1.x and downloaded the one without the installer (see the readme).

The configuration I suggested should go into web.xml (found in <tomcat>/webapps/WEB-INF).

Finally, imconvert needs to be on the system path, you can either copy it to somewhere like c:\windows\system32 or you can add <alfresco-home>/bin to your PATH environment variable.

rreinart
Champ in-the-making
Champ in-the-making
Hmm.

I'm running mysql 4.1.14-nt. The mysql window that launches after starting the alfresco application shows the server (at mysql\bin\mysql-nt) ready for connections, but I can't connect through command prompt. The imconvert file is in my system32 folder, but I'm still logging the same error.

Also, I can add spaces and users in Alfresco (suggesting database connectivity). . . Just no uploads.

gavinc
Champ in-the-making
Champ in-the-making
I managed to reproduce the behaviour you are seeing but only in the portal environment after I had added the authentication filter around the download servlet as I suggested earlier in the thread.

So if you have added it I would remove it as it won't help. The issue when this is applied is that the portal and the download servlet are in different web contexts, "/portal" and "/web-client", respectively. These get treated as separate HTTP sessions and I therefore saw the login page, but you were seeing this problem WITHOUT the filter, which unfortunately I can't explain!

Are you using the JBoss portal bundle?

I have to say I'm still a bit confused as to why you can't connect to MySQL from the command prompt but the application seems to manage it!! If you do "mysql -u alfresco -p" then enter the password when prompted and finally enter "use alfresco;", what happens, what error message do you get?

We also released PR5 over the weekend which includes some bug fixes, maybe you could try that to see if you still get the same issue?

kevinr
Star Contributor
Star Contributor
Hi,

We have found the issue here - it is a problem with the JBoss Portal version of Alfresco client bundle. We have fixed it for the next preview release (PR6)

Thanks,

Kevin