5 Replies Latest reply on Feb 10, 2007 3:02 AM by Shane Bryzak

    Fail to get dynamic image in SeamSpace

    Gus Gu Expert

      Hi,

      I deployed the Seamspace (Seam 1.1.6) to JBoss4.0.5, and it seems everything was fine except that dynamic images could not be displayed. The images were displayed as black background rectangles. I don't know what is wrong. Does anybody get correct images? Thank you in advance!

        • 1. Re: Fail to get dynamic image in SeamSpace
          Shane Bryzak Master

          Which browser do you use? Have you tried viewing the pictures directly, i.e. http://localhost:8080/seam-space/content/images?id=2 ?

          • 2. Re: Fail to get dynamic image in SeamSpace
            Gus Gu Expert

            Hi Shane,

            I tested it in IE and FF, and both of them have the same result. I also viewed the picture directly, and even copied the picture to Office Word, but the image always display as black. I use MySql database. Any suggestion? Thank you.

            • 3. Re: Fail to get dynamic image in SeamSpace
              Gus Gu Expert

              Hi Shane,

              I checked the JBoss server log, and found many exceptions as below. My seamspace-ds.xml is:(I use the setting for all other seam examples, and they all works fine)

              <?xml version="1.0" encoding="UTF-8"?>
              
              <datasources>
               <local-tx-datasource>
               <jndi-name>seamspaceDatasource</jndi-name>
               <connection-url>jdbc:mysql://localhost:3306/seamspace</connection-url>
               <driver-class>com.mysql.jdbc.Driver</driver-class>
              
               <user-name>root</user-name>
               <password>root</password>
              
               <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
              
              
               <!-- Typemapping for JBoss 4.0 -->
               <metadata>
               <type-mapping>mySQL</type-mapping>
               </metadata>
               </local-tx-datasource>
              </datasources>

              The exceptions are:
              2007-02-08 15:24:36,831 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Warning: 1051, SQLState: 42S02
              2007-02-08 15:24:36,831 WARN [org.hibernate.util.JDBCExceptionReporter] Unknown table 'blogcomment'
              2007-02-08 15:24:36,831 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Warning: 1051, SQLState: 42S02
              2007-02-08 15:24:36,831 WARN [org.hibernate.util.JDBCExceptionReporter] Unknown table 'friendcomment'
              2007-02-08 15:24:36,831 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Warning: 1051, SQLState: 42S02
              2007-02-08 15:24:36,831 WARN [org.hibernate.util.JDBCExceptionReporter] Unknown table 'member'
              2007-02-08 15:24:36,831 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Warning: 1051, SQLState: 42S02
              2007-02-08 15:24:36,831 WARN [org.hibernate.util.JDBCExceptionReporter] Unknown table 'memberblog'
              2007-02-08 15:24:36,831 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Warning: 1051, SQLState: 42S02
              2007-02-08 15:24:36,831 WARN [org.hibernate.util.JDBCExceptionReporter] Unknown table 'memberfriend'
              2007-02-08 15:24:36,831 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Warning: 1051, SQLState: 42S02
              2007-02-08 15:24:36,831 WARN [org.hibernate.util.JDBCExceptionReporter] Unknown table 'memberimage'
              2007-02-08 15:24:36,831 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Warning: 1051, SQLState: 42S02
              2007-02-08 15:24:36,831 WARN [org.hibernate.util.JDBCExceptionReporter] Unknown table 'memberrole'
              2007-02-08 15:24:36,831 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Warning: 1051, SQLState: 42S02
              2007-02-08 15:24:36,831 WARN [org.hibernate.util.JDBCExceptionReporter] Unknown table 'memberroles'
              2007-02-08 15:24:36,831 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] alter table MemberFriend add index FKDC68F9F83682330F (FRIEND_ID), add constraint FKDC68F9F83682330F foreign key (FRIEND_ID) references Member (memberId)
              2007-02-08 15:24:37,128 DEBUG [org.hibernate.util.JDBCExceptionReporter] SQL Warning
              java.sql.SQLWarning: Unknown table 'blogcomment'
               at com.mysql.jdbc.SQLError.convertShowWarningsToSQLWarnings(SQLError.java:730)
               at com.mysql.jdbc.SQLError.convertShowWarningsToSQLWarnings(SQLError.java:658)
               at com.mysql.jdbc.Statement.getWarnings(Statement.java:1930)
               at org.jboss.resource.adapter.jdbc.WrappedStatement.getWarnings(WrappedStatement.java:144)
               at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:309)
               at org.hibernate.tool.hbm2ddl.SchemaExport.drop(SchemaExport.java:284)
               at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:186)
               at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
               at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:311)
               at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
               at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:691)
               at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
               at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)
               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.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:102)
               at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
               at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
               at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
               at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
               at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
               at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
               at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
               at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
               at $Proxy0.start(Unknown Source)
               at org.jboss.system.ServiceController.start(ServiceController.java:417)
               at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
               at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
               at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
               at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
               at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
               at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
               at $Proxy152.start(Unknown Source)
               at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:96)
               at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:467)
               at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:317)
               at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:91)
               at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
               at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
               at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
               at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
               at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
               at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
               at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
               at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
               at $Proxy0.start(Unknown Source)
               at org.jboss.system.ServiceController.start(ServiceController.java:417)
               at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
               at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
               at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
               at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
               at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
               at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
               at $Proxy29.start(Unknown Source)
               at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:449)
               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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
               at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
               at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
               at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
               at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
               at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
               at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
               at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
               at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
               at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
               at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
               at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
               at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
               at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
               at $Proxy30.start(Unknown Source)
               at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
               at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
               at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
               at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
               at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
               at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
               at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
               at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
               at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
               at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
               at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
               at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
               at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
               at $Proxy8.deploy(Unknown Source)
               at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
               at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
               at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
               at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
               at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
               at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
               at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
               at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
               at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
               at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
               at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
               at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
               at $Proxy0.start(Unknown Source)
               at org.jboss.system.ServiceController.start(ServiceController.java:417)
               at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
               at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
               at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
               at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
               at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
               at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
               at $Proxy4.start(Unknown Source)
               at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
               at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
               at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
               at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
               at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
               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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
               at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
               at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
               at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
               at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
               at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
               at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
               at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
               at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
               at $Proxy5.deploy(Unknown Source)
               at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
               at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
               at org.jboss.Main.boot(Main.java:200)
               at org.jboss.Main$1.run(Main.java:490)
               at java.lang.Thread.run(Thread.java:595)
              


              • 4. Re: Fail to get dynamic image in SeamSpace
                Gus Gu Expert

                Hi Shane,

                I got the pictures now after using hsqldb instead of mysql. I think the Seamspace settings is probably different from issues, booking and etc, since I can successfully deploy these examples using mysql.

                One more question, I found that you use servelets to render dynamic images instead of Seam wiki' dynamicImage component. Which one is better for a real project? or both are same? Thank you very much.

                • 5. Re: Fail to get dynamic image in SeamSpace
                  Shane Bryzak Master

                  Ok it looks like MySql choked on the import.sql. The examples are only guaranteed to run on HSQL so I can't really help with that.

                  As for using a servlet vs dynamic images, it depends on your requirements. I can't say which is better, but in my case for the seamspace example I needed image rescaling (and browser rescaling sucks) so writing a servlet was easiest at the time.