Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4546652
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:59:02+00:00 2026-05-21T15:59:02+00:00

I get the following problem when trying to display a list of items. For

  • 0

I get the following problem when trying to display a list of items. For each item, I have to display an image which is dynamically loaded via a Wicket WebResource. The items are loaded step by step — 50 at a time — upon user scrolling, using an Ajax scroll.

[ERROR] 2011-04-19 09:58:18,000 btpool0-1 org.apache.wicket.RequestCycle.logRuntimeException (host=, request=, site=):
org.apache.wicket.WicketRuntimeException: component documentList:scroller:batchElem:666:content:item:3:batchItemContent:linkToPreview:imageThumbnail not found on page com.webapp.document.pages.DocumentListPage[id = 1]
listener interface = [RequestListenerInterface name=IResourceListener, method=public abstract void org.apache.wicket.IResourceListener.onResourceRequested()]

org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.WicketRuntimeException: component documentList:scroller:batchElem:666:content:item:3:batchItemContent:linkToPreview:imageThumbnail
not found on page com.webapp.document.pages.DocumentListPage[id = 1] listener interface = [RequestListenerInterface name=IResourceListener, method=public abstract void org.apache.wicket.IResourceListener.onResourceRequested()]
at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
at org.apache.wicket.protocol.http.WicketFilter$$EnhancerByGuice$$51619816.CGLIB$doGet$6()
at org.apache.wicket.protocol.http.WicketFilter$$EnhancerByGuice$$51619816$$FastClassByGuice$$6d42bf5d.invoke()
at com.google.inject.internal.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:64)
at com.freiheit.monitoring.PerformanceMonitoringMethodInterceptor.invoke(PerformanceMonitoringMethodInterceptor.java:115)
at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:64)
at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:44)
at org.apache.wicket.protocol.http.WicketFilter$$EnhancerByGuice$$51619816.doGet()
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
at org.apache.wicket.protocol.http.WicketFilter$$EnhancerByGuice$$51619816.CGLIB$doFilter$4()

How can this problem be solved?

Here is the part of the code responsible for adding the image:

previewLink.add(createThumbnailSmall("imageThumbnail", documentModel));

in

createThumbnailSmall(final String id, final IModel<BaseDocument> documentModel) {
    // thumbnailResource is an object that contains the path of the image

    if (thumbnailResource != null) {
        final WebResource resource = getWebResource(thumbnailResource);
        final Image image = new Image(id, resource);
        return image;
    }
    return new InvisibleContainer(id);
}

WebResource getWebResource(final DocumentResource documentResource) {
    return new WebResource() {

        private static final long serialVersionUID = 1L;

        @Override
        public IResourceStream getResourceStream() {
            return new BaseStreamResource(documentResource);
        }
    };
}

where BaseStreamResource is the following:

public class BaseStreamResource extends AbstractResourceStream {
    private InputStream      _fileInputStream = null;
    private DocumentResource _resource        = null;

    public BaseStreamResource(final DocumentResource documentResource) {
        _resource = documentResource;
    }

    @Override
    public InputStream getInputStream() throws ResourceStreamNotFoundException {
        if (_fileInputStream == null) {
            try {
                if (_resource == null) {
                    throw new ResourceStreamNotFoundException("Resource was null");
                }
                _fileInputStream = _resource.getFileInputStream();
            } catch (final ResourceNotAvailableException ex) {
                throw new ResourceStreamNotFoundException(ex);
            }
        }
        return _fileInputStream;
    }

In HTML:

<a wicket:id="linkToPreview" href="#">
<img wicket:id="imageThumbnail" alt="Attachment"></img></a>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T15:59:03+00:00Added an answer on May 21, 2026 at 3:59 pm

    The following solution solved the problem:
    – extend WebResource class
    – add extended class as a resource to application shared resources

    Ex:

    public class MyWebResource extends WebResource {
        final ValueMap map = new ValueMap();
    
        @Override
        public IResourceStream getResourceStream() {        
            String fileName = getFileName();
            File file = new File(basePath, fileName);
    
            if (!file.exists()) {
                LOG.error("File does not exist: " + file);
                throw new IllegalStateException("File does not exist: " + file);
            }       
            return new FileResourceStream(file);
        }           
    
        public final void addResource() {
            Application.get().getSharedResources().add(getClass().getName(), this);
        }
    
        protected String getFileName() {
            return getParameters().getString("id");
        }   
    
        public final String urlFor(final String fileName) {         
            final ResourceReference resourceReference = new ResourceReference(getClass().getName());        
            final String encodedValue = WicketURLEncoder.QUERY_INSTANCE.encode(fileName);
            map.add("id", encodedValue);
            final CharSequence result = RequestCycle.get().urlFor(resourceReference, map);       
            if (result == null) {
                throw new IllegalStateException("The resource was not added! "
                    + "In your Application class add the following line:"
                    + "MyConcreteResource.INSTANCE.addResource()");
            }   
    
            String absoluteUrl = RequestUtils.toAbsolutePath(result.toString());        
            return absoluteUrl;     
        } 
    }
    

    In Application class, in init(), I have added MyWebResource to shared resources:

    public void init() {
        ... 
        new MyWebResource().addResource();        
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get the following problem when trying to open an ASPX page in FireFox:
when i run my application, i get following exception. I have no problem with
I have the following problem: I am trying to make 3 links/anchors (with padding
I am trying to display objects for a reminders list with the following fields:
I have a problem trying to display my SSRS reports in a Report Viewer
I'm trying to get the WebBrowser control to display HTML loaded from a variable.
I'm trying to display an image within an iFrame on my page. The problem
I encountered the following problem, and I don't get any warnings or errors, just
I'm struggling with the following problem. I use the jQuery autocomplete plugin to get
The problem is taht I get the following error qhile deploying my project to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.