Announcement Announcement Module
Collapse
No announcement yet.
ORACLE 9 + LOB + Spring Image Database sample application Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ORACLE 9 + LOB + Spring Image Database sample application

    I have this error messages when I am compiling under Eclipse.
    I created all the tables under ORACLE 9 and follow the instructions for the jdbc.properties file.
    But I always have these error messages which are located in the DefaultImageDatabase.java file. This file is the one coming with the samples.
    ------------------------------------------------------------------------------------
    Message 1 :
    The method query(String, ResultSetExtractor) in the type JdbcTemplate is not applicable for the arguments (String, <anonymous implementation of RowMapper>)

    Message 2 :
    Type mismatch: cannot convert from Object to List

    Message 3 :
    The method query(String, ResultSetExtractor) in the type JdbcTemplate is not applicable for the arguments (String, Object[], <anonymous subclass of AbstractLobStreamingResultSetExtractor>)
    ------------------------------------------------------------------------------------

    What is the problem ?

    Thanks in advance for your help.

    txuo

  • #2
    Eclipse indicates me that the problem is coming from this method
    public List getImages() throws DataAccessException
    {
    return getJdbcTemplate().query(
    "SELECT IMAGE_NAME, DESCRIPTION FROM IMAGEDB",
    new RowMapper()
    {
    public Object mapRow(ResultSet rs, int rowNum)
    throws SQLException
    {
    String name = rs.getString(1);
    String description = lobHandler.getClobAsString(rs, 2);
    return new ImageDescriptor(name, description);
    }
    });

    So, I think there is a problem with the 'getJdbcTemplate().query' but how to resolve that ?
    }

    Comment


    • #3
      Can you build ok from the command line?

      Comment


      • #4
        Yes, I can build from the command line.

        I also tried to run but I have this error message

        java.lang.Error: Unresolved compilation problems:
        Type mismatch: cannot convert from Object to List
        The method query(String, ResultSetExtractor) in the type JdbcTemplate is not applicable for the arguments (String, <anonymous implementation of RowMapper>)

        org.springframework.samples.imagedb.DefaultImageDa tabase.getImages(DefaultImageDatabase.java:50)
        sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
        sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
        sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
        java.lang.reflect.Method.invoke(Method.java:324)
        org.springframework.aop.framework.AopProxyUtils.in vokeJoinpointUsingReflection(AopProxyUtils.java:59 )
        org.springframework.aop.framework.ReflectiveMethod Invocation.invokeJoinpoint(ReflectiveMethodInvocat ion.java:149)
        org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :118)
        org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:169)
        org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :138)
        org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:148)
        $Proxy2.getImages(Unknown Source)
        org.springframework.samples.imagedb.web.ImageContr oller.showImageList(ImageController.java:27)
        sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
        sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
        sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
        java.lang.reflect.Method.invoke(Method.java:324)
        org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController.invokeNamedMethod(MultiActionC ontroller.java:320)
        org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController.handleRequestInternal(MultiAct ionController.java:280)
        org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:119)
        org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:45)
        org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:389)
        org.springframework.web.servlet.FrameworkServlet.s erviceWrapper(FrameworkServlet.java:342)
        org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:318)
        javax.servlet.http.HttpServlet.service(HttpServlet .java:697)
        javax.servlet.http.HttpServlet.service(HttpServlet .java:810)


        Thank you for helping me.
        I really appreciate !

        txuo

        Comment


        • #5
          I don't think ou did a clean build from command-line if you are getting that error. The .class file still reflects the error that Eclipse complained about, and was probably not built at all from the command line.

          If you can do an ok, clean build from the command-line, then I think you have a version mismatch for Spring, in the Eclipse case...

          Comment


          • #6
            You were right.

            My build was not corect.
            So, I first did a build clean and after that a build all.
            The result : the sample run great.

            I also created an Eclipse project. The only thing I have had to do is to paramater the classpath for the servlet-api.jar (cf tomcat 5). Now, it is ok.

            Thanks to you, I am able to test this sample and progress a little.

            The next step I want to do is to use Hibernate, Oracle and Spring to realize the CRUD operations on the imagedb. I already read some posts in the forum but did not find a complete sample (a warfile would be great).

            Comment

            Working...
            X