Hello Karen,

I strongly advice to use the Image Servlet and not the servdb. The Servdb is
deprecated code. It will be harder to migrate your site to a new mmbase
release in the future if you use the servdb.

Some settings of the current project I work on. (Migrating WebInABOx from
mmbase 1.5 to mmbase 1.6.x)

The WEB-INF/web.xml has the following entries

  <!-- The MMBase image serving servlet. -->
  <servlet>
    <servlet-name>images</servlet-name>
    <description>To extract images from MMBase</description>
    <servlet-class>org.mmbase.servlet.ImageServlet</servlet-class>
    <init-param>
      <!-- Expire time of original images. Cached images never expire. -->
      <param-name>expire</param-name>
      <!-- 10 minutes (default is one hour)-->
      <param-value>600</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
  </servlet>  <!-- mapping for image-requests -->

  <servlet-mapping>
    <servlet-name>images</servlet-name>
    <url-pattern>/img.db</url-pattern>
  </servlet-mapping>


I use the resource mmbase application in WEB-INF/config/applications to
install the images builder. The resource mmbase application installs the
images builder to the WEB-INF/config/builder/applications dir.
The images.xml should have this entry set to the imagemagick path and
command

<properties>
        <!-- convert using ImageMagick -->
        <property
name="ImageConvertClass">org.mmbase.module.builders.ConvertImageMagick</prop
erty>
        <property name="ImageConvert.ConverterCommand">convert</property>
        <property name="ImageConvert.ConverterRoot"></property>

        <!-- generic property for all converters -->
        <property name="MaxConcurrentRequests">3</property>
</properties>

After the resource application is installed the log should mention somewhere

INFO  mmbase.module.builders.Images  - loaded
'org.mmbase.module.builders.ConvertImageMagick' for builder 'images'
INFO  mmbase.module.builders.ConvertImageMagick  - Will use: convert,
Version: @(#)ImageMagick 5.4.7 07/18/02 Q:16 http://www.imagemagick.org

And 

INFO  org.mmbase.servlet.MMBaseServlet  - Init of servlet images.
SERVICE org.mmbase.servlet.MMBaseServlet  - Associating function 'images'
with servletname images

These messages ometimes only appear when the log level is set high enough.
My WEB-INF/config/log/log4j.xml has this entry

<root>
    <level class="&mmlevel;" value ="service" />
    <appender-ref ref="logfile" />
</root>


The log mentions this when I access the servlet by <mm:node
number="867"><img src="<mm:image template="s(128x128)" />" /></mm:node>

SERVICE mmbase.module.builders.AbstractServletBuilder  - images are served
on: /site/img.db
INFO  mmbase.module.builders.ImageCaches  - cached node not found, returning
null
SERVICE mmbase.module.builders.Images  - getting image bytes of [867,
s(128x128)]
SERVICE mmbase.module.builders.ConvertImageMagick  - converted image(#11152
bytes)  to 'jpeg'-image(#3821 bytes)('[convert, -, -geometry, 128x128,
jpeg:-]')

I grabbed this information from a tomcat 4.1.18 server with mmbase 1.6.3. I
requested the test.jsp directly on port 8080 from tomcat.

Provide a zip somewhere (download or email) with your webapp if you can't
find what is wrong and i will take a look at it (this weekend). I don't need
all the jsp pages. A zip with one jsp with the image problem, config files,
web.xml and mmbase.jar is fine. Maybe, the tomcat configuration will help
too.

Nico Klasens

Finalist IT Group
Java Specialists


-----Oorspronkelijk bericht-----
Van: Ploeg, Karen van der (Fin) [mailto:[EMAIL PROTECTED] 
Verzonden: vrijdag 18 juli 2003 9:30
Aan: '[EMAIL PROTECTED]'
Onderwerp: servdb problem returns


Hi developers, 

I had a servdb problem earlier this week with scanpage.getHostNames, and you
advised me to replace the servdb servlet for an images servlet for
displaying my images. Unfortunately, the images servlet although not
throwing any exceptions couldn't handle the resizing of the images. (first I
though that to be a problem of the tomcat connector I was using, then I
though it might have something to do with ImageMagick but I guess it's the
images servlet that cannot handle the resizing).  I also read that
downloading the pre-release of mmbase might solve my servdb problems in
regard to the hostname resolving. I tried the 20030707 release but: 
2003-07-18 10:20:33 StandardWrapperValve[servdb]: Servlet.service() for
servlet servdb threw exception java.lang.NullPointerException
        at org.mmbase.util.scanpage.getHostNames(scanpage.java:346)
        at org.mmbase.util.scanpage.getAddress(scanpage.java:327)
        at org.mmbase.servlet.servdb.checkImgMirror(servdb.java:922)
        at org.mmbase.servlet.servdb.service(servdb.java:275)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
        at org.mmbase.servlet.JumpersFilter.doFilter(JumpersFilter.java:92)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:213)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
        at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

Any ideas what I should do next? 

Karen. 

Reply via email to