You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by hillj2 <Hi...@michigan.gov> on 2007/09/20 19:09:48 UTC

Embedding wicket in jsp error

I know this has been discussed before, but none of the previous posts have
helped me solve my problem.  I'm trying to embed a wicket page into a jsp
page (until I have time go back and convert all our jsp's to wicket) using
the <jsp:include> tag.  oc4j throws a ServletException: Error in Servlet,
with no further information specifying the problem, nor any indication from
wicket that it's having a problem.  To isolate the problem I tried to
recreate it in a very small app, so I could rule out any issue with other
app code/configurations.  This time, I get a more informative (but not
necessarily more helpful) error message:

java.lang.IllegalStateException: Response has already been committed, be
sure not to write to the OutputStream or to trigger a commit due to any
other action before calling this method.

I'm hoping it's the same error in both cases, and the former case just has a
more generic error message for some reason; but I was hoping someone might
have a clue why I can't get the embedding to work.  I'm using oc4j 10.1.3.3,
and wicket beta2.  I tried it on Tomcat also.  It didn't throw an error, but
the place where the wicket content should be was just empty.

I'd prefer not to have to do this with embedded IFRAME's as I've seen
suggested.  That's the setup I have now, but when a page loads there's a
delay loading the IFRAME content, which doesn't look very nice, especially
since the embedded content is my app's navigation menu.  Any thoughts,
suggestions, alternate solutions to the embedding issue?

Here's the code from my small test app:

embed.jsp
========
<html>
 <head>
  <title>Embed test</title>
 </head>
 <body>
  <jsp:include page="/wicket/" flush="true">
  </jsp:include>
  <p>Here is my JSP content</p>
 </body>
</html>

EmbedServlet.java
==============
public class EmbedServlet extends HttpServlet {

  public void doGet(HttpServletRequest request, HttpServletResponse
response)
    throws ServletException, IOException {
    doPost(request, response);
  }

  public void doPost(HttpServletRequest request, HttpServletResponse
response)
    throws ServletException, IOException {

    RequestDispatcher rd  =
request.getRequestDispatcher("/WEB-INF/jsp/embed.jsp");
    rd.forward(request, response);

  }

}

EmbedApplication.java
=================
public class EmbedApplication extends WebApplication {

  public EmbedApplication() {
    super();
  }

  public Class getHomePage() {
    return EmbedPage.class;
  }

  protected void init() {
    System.out.println("***** Wicket App initialized *****");
  }

}

EmbedPage.java
============
public class EmbedPage extends WebPage {
  public EmbedPage() {
    super();
  }
}

EmbedPage.html
============
<html>
 <head>
  <title>Embeded Wicket</title>
 </head>
 <body>
  <p>Here is my wicket content.</p>
 </body>
</html>

web.xml
======
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.2//EN" 
  "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee">
  <servlet>
    <servlet-name>EmbedServlet</servlet-name>
    <servlet-class>EmbedServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>EmbedServlet</servlet-name>
    <url-pattern>/main</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>EmbedApplication</servlet-name>
   
<servlet-class>org.apache.wicket.protocol.http.WicketServlet</servlet-class>
    <init-param>
      <param-name>applicationClassName</param-name>
      <param-value>EmbedApplication</param-value>
    </init-param>
  </servlet>
  <servlet-mapping>
    <servlet-name>EmbedApplication</servlet-name>
    <url-pattern>/wicket/*</url-pattern>
  </servlet-mapping>
  <session-config>
    <session-timeout>35</session-timeout>
  </session-config>
  <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
  </mime-mapping>
</web-app>



Thanks,
Joel
-- 
View this message in context: http://www.nabble.com/Embedding-wicket-in-jsp-error-tf4488872.html#a12801646
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Embedding wicket in jsp error

Posted by Eelco Hillenius <ee...@gmail.com>.
> Well that doesn't bother me.  The users really shouldn't need to press the
> back button at all, so only having a limited number of previous pages
> shouldn't be a problem.

Consider overriding isVersioned and let it return false in your pages.
That way the URLs will remain stable so the back button only jumps
between bookmarkable pages. It will discourage using the back button
even more if that is what you want.

Eelco

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Embedding wicket in jsp error

Posted by hillj2 <Hi...@michigan.gov>.

Martijn Dashorst wrote:
> 
> ONE_PASS_RENDER does not kill back button support, but does provoke
> that blasted repost on back button for form submissions. So it
> prevents the double submit problem.
> 

Right, of course.  I knew that. :)


Martijn Dashorst wrote:
> 
> The HttpSessionStore is the default store for wicket 1.2 and prior. It
> only limits the number of pages that are stored per session for
> backbutton support. So you will be able to press back, but not
> unlimited as with the disk based store.
> 

Well that doesn't bother me.  The users really shouldn't need to press the
back button at all, so only having a limited number of previous pages
shouldn't be a problem.


Martijn Dashorst wrote:
> 
> As for the serialization errors, somehow either you don't read the log
> too well, or you have a misconfigured Wicket. To fix them, you should
> return to the Disk store: it will report exactly what is wrong. Do you
> run the application in development mode on your local box? If so, you
> should see things like the following in your log:
> 
> ERROR - Objects - Error serializing object class wicket.in.action.HomePage
> 
> Field hierarchy is:
>   0 [class=wicket.in.action.HomePage, path=0]
>     children [class=[Lorg.apache.wicket.Component;]
>       children[0] [class=org.apache.wicket.markup.html.basic.Label,
> path=0:name]
>         model [class=org.apache.wicket.model.PropertyModel]
>           target [class=wicket.in.action.User] <----- field that is
> not serializable
> 	at org.apache.wicket.util.io.SerializableChecker.check()
> 	at org.apache.wicket.util.io.SerializableChecker.checkFields()
> 

Well I thought what I put in the original post was all that I could see in
the logs regarding this issue.  I'll try again and see if I notice more, or
fiddle with some of the config, if I can figure out what to change.  I
probably won't get to this until Mon though.  I'll let you know what I
discover.

Thanks,

Joel
-- 
View this message in context: http://www.nabble.com/Embedding-wicket-in-jsp-error-tf4488872.html#a12829549
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Embedding wicket in jsp error

Posted by Martijn Dashorst <ma...@gmail.com>.
On 9/21/07, hillj2 <Hi...@michigan.gov> wrote:
> Also are there any other issues with using HttpSessionStore besides losing
> back button support?  Since I'm already forced to use ONE_PASS_RENDER (for
> now), I've already lost that support (haven't I?).

ONE_PASS_RENDER does not kill back button support, but does provoke
that blasted repost on back button for form submissions. So it
prevents the double submit problem.

The HttpSessionStore is the default store for wicket 1.2 and prior. It
only limits the number of pages that are stored per session for
backbutton support. So you will be able to press back, but not
unlimited as with the disk based store.

As for the serialization errors, somehow either you don't read the log
too well, or you have a misconfigured Wicket. To fix them, you should
return to the Disk store: it will report exactly what is wrong. Do you
run the application in development mode on your local box? If so, you
should see things like the following in your log:

ERROR - Objects - Error serializing object class wicket.in.action.HomePage

Field hierarchy is:
  0 [class=wicket.in.action.HomePage, path=0]
    children [class=[Lorg.apache.wicket.Component;]
      children[0] [class=org.apache.wicket.markup.html.basic.Label, path=0:name]
        model [class=org.apache.wicket.model.PropertyModel]
          target [class=wicket.in.action.User] <----- field that is
not serializable
	at org.apache.wicket.util.io.SerializableChecker.check()
	at org.apache.wicket.util.io.SerializableChecker.checkFields()

Martijn

-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Embedding wicket in jsp error

Posted by hillj2 <Hi...@michigan.gov>.

Eelco Hillenius wrote:
> 
> One of the better additions to the JDK in my opinion were the
> @Override tags. If you use those (and e.g. use your IDE's autocomplete
> function) you would have avoided this in the first place.
> 

Yeah, I should probably start using more of that real nice stuff they put so
much effort into providing us.  I guess I never realized that annotation
actually would check to make sure you were really overriding something. 
Thanks.

Joel

-- 
View this message in context: http://www.nabble.com/Embedding-wicket-in-jsp-error-tf4488872.html#a12829555
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Embedding wicket in jsp error

Posted by Eelco Hillenius <ee...@gmail.com>.
> My mistake.  I noticed there was a typo in my newSessionStore() declaration
> which caused it not to be called (obviously).

One of the better additions to the JDK in my opinion were the
@Override tags. If you use those (and e.g. use your IDE's autocomplete
function) you would have avoided this in the first place.

> Also are there any other issues with using HttpSessionStore besides losing
> back button support?  Since I'm already forced to use ONE_PASS_RENDER (for
> now), I've already lost that support (haven't I?).

You're not loosing back button support, it is just limited to the last
few entries (which is configurable) whereas the SLCSS is in principle
unlimited.


Eelco

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Embedding wicket in jsp error

Posted by hillj2 <Hi...@michigan.gov>.
My mistake.  I noticed there was a typo in my newSessionStore() declaration
which caused it not to be called (obviously).  Now that I have ACTUALLY
gotten wicket to use HttpSessionStore, it did solve my problem.  So how can
I track down exactly what couldn't serialize so I can fix it (hopefully)?

Also are there any other issues with using HttpSessionStore besides losing
back button support?  Since I'm already forced to use ONE_PASS_RENDER (for
now), I've already lost that support (haven't I?).

Thanks,

Joel
-- 
View this message in context: http://www.nabble.com/Embedding-wicket-in-jsp-error-tf4488872.html#a12829244
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Embedding wicket in jsp error

Posted by hillj2 <Hi...@michigan.gov>.

Martijn Dashorst wrote:
> 
> Does your log contain serialization errors? That typically is a
> problem with trying to deserialize a page from the disk store.
> 

Well the stack trace I posted seems to indicate a serialization problem. 
But there is nothing further in the logs that I didn't already post.


Martijn Dashorst wrote:
> 
> You may want to switch your session store to the HttpSessionStore, if
> you don't mind having a limited back button support. Or at least you
> can try it, to see if it solves the problem. If so, you have a
> serialization problem in your component structure.
> 

I added

  protected ISessionStore newSesionStore() {
    return new HttpSessionStore(this);
  }

to my application class, but I still got the same error.


Joel

-- 
View this message in context: http://www.nabble.com/Embedding-wicket-in-jsp-error-tf4488872.html#a12827823
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Embedding wicket in jsp error

Posted by Martijn Dashorst <ma...@gmail.com>.
Does your log contain serialization errors? That typically is a
problem with trying to deserialize a page from the disk store.

You may want to switch your session store to the HttpSessionStore, if
you don't mind having a limited back button support. Or at least you
can try it, to see if it solves the problem. If so, you have a
serialization problem in your component structure.

Martijn

On 9/21/07, hillj2 <Hi...@michigan.gov> wrote:
>
> I tried implementing the solution from your blog, and after a long struggle I
> finally got it working. . .or so I thought.  Now my wicket links are
> throwing page expired errors.  Maybe it has to do with the fact that the way
> I had to set it up, the pages with embedded JSP are running under the old
> servlet context rather than under the wicket context (the url's seem to bear
> that out, however it's still getting back to wicket when I click on them).
> However, some of the wicket links on my main wicket page (with no embedded
> JSP) were throwing page expired errors too, but not always.  I haven't
> figured out yet when they will and when they won't.
>
> I may have to revert to the ugly, slow loading IFRAMEs solution, because
> nothing else seems to work for me.
>
> This comes out in the logs anytime I get the page expired error:
>
> DEBUG 2007-09-21 13:54:57,359 http.FilePageStore (getPage:504)  - Error
> loading page 90,0 for the sessionid
> 0a080b5722b83ac0afe2682449908b03d150131b49d7 from disk
> java.lang.RuntimeException: Could not deserialize object using
> `org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
> object factory
>         at org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:410)
>         at
> org.apache.wicket.protocol.http.FilePageStore.readPage(FilePageStore.java:541)
>         at
> org.apache.wicket.protocol.http.FilePageStore.getPage(FilePageStore.java:484)
>         at
> org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:192)
>         at org.apache.wicket.Session.getPage(Session.java:725)
>         at
> org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:427)
>         at
> org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1090)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1176)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:499)
>         at
> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:257)
>         at
> org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:126)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>         at
> com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
>         at
> com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
>         at
> com.evermind.server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:259)
>         at
> com.evermind.server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:51)
>         at
> com.evermind.server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:193)
>         at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:283)
>         at
> com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:198)
>         at gov.mi.mdch.event.EventHandlerBase._dispatch(EventHandlerBase.java:153)
>         at gov.mi.mdch.event.EventHandlerBase.forward(EventHandlerBase.java:137)
>         at gov.mi.mdch.event.Controller.doPost(Controller.java:128)
>         at gov.mi.mdch.event.Controller.doGet(Controller.java:81)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>         at
> com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
>         at gov.mi.mdch.filter.ValidationFilter.doFilter(ValidationFilter.java:241)
>         at
> com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:623)
>         at
> com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
>         at
> com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
>         at
> com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
>         at
> com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
>         at
> com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
>         at
> com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
>         at
> oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
>         at
> com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: java.io.StreamCorruptedException: unexpected block data
>         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1313)
>         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
>         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
>         at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
>         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
>         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
>         at org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:396)
>         ... 38 more
>
>
> Hopefully someone has an easy answer to this one, but for some reason, I
> hear those IFRAMEs calling out to me.
>
> Thanks.
>
>
> Joel
> --
> View this message in context: http://www.nabble.com/Embedding-wicket-in-jsp-error-tf4488872.html#a12827068
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Embedding wicket in jsp error

Posted by hillj2 <Hi...@michigan.gov>.
I tried implementing the solution from your blog, and after a long struggle I
finally got it working. . .or so I thought.  Now my wicket links are
throwing page expired errors.  Maybe it has to do with the fact that the way
I had to set it up, the pages with embedded JSP are running under the old
servlet context rather than under the wicket context (the url's seem to bear
that out, however it's still getting back to wicket when I click on them). 
However, some of the wicket links on my main wicket page (with no embedded
JSP) were throwing page expired errors too, but not always.  I haven't
figured out yet when they will and when they won't.

I may have to revert to the ugly, slow loading IFRAMEs solution, because
nothing else seems to work for me.

This comes out in the logs anytime I get the page expired error:

DEBUG 2007-09-21 13:54:57,359 http.FilePageStore (getPage:504)  - Error
loading page 90,0 for the sessionid
0a080b5722b83ac0afe2682449908b03d150131b49d7 from disk
java.lang.RuntimeException: Could not deserialize object using
`org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
object factory
	at org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:410)
	at
org.apache.wicket.protocol.http.FilePageStore.readPage(FilePageStore.java:541)
	at
org.apache.wicket.protocol.http.FilePageStore.getPage(FilePageStore.java:484)
	at
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:192)
	at org.apache.wicket.Session.getPage(Session.java:725)
	at
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:427)
	at
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139)
	at org.apache.wicket.RequestCycle.step(RequestCycle.java:1090)
	at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1176)
	at org.apache.wicket.RequestCycle.request(RequestCycle.java:499)
	at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:257)
	at
org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:126)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
	at
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
	at
com.evermind.server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:259)
	at
com.evermind.server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:51)
	at
com.evermind.server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:193)
	at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:283)
	at
com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:198)
	at gov.mi.mdch.event.EventHandlerBase._dispatch(EventHandlerBase.java:153)
	at gov.mi.mdch.event.EventHandlerBase.forward(EventHandlerBase.java:137)
	at gov.mi.mdch.event.Controller.doPost(Controller.java:128)
	at gov.mi.mdch.event.Controller.doGet(Controller.java:81)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at
com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
	at gov.mi.mdch.filter.ValidationFilter.doFilter(ValidationFilter.java:241)
	at
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:623)
	at
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
	at
com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
	at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
	at
com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
	at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
	at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
	at
oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
	at
com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
	at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.StreamCorruptedException: unexpected block data
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1313)
	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
	at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
	at org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:396)
	... 38 more


Hopefully someone has an easy answer to this one, but for some reason, I
hear those IFRAMEs calling out to me.

Thanks.


Joel
-- 
View this message in context: http://www.nabble.com/Embedding-wicket-in-jsp-error-tf4488872.html#a12827068
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Embedding wicket in jsp error

Posted by hillj2 <Hi...@michigan.gov>.

Al Maw wrote:
> 
> At the very least, you'll need to do what Martijn suggests and set a 
> one-pass render strategy.
> 

Done, with no success.


Al Maw wrote:
> 
> I'd recommend you go and read my blog post about this whole topic:
> http://herebebeasties.com/2007-03-01/jsp-and-wicket-sitting-in-a-tree/
> 
> It comes at things from slightly the other end of the spectrum 
> (embedding JSPs in a Wicket page) but the issues are very similar and 
> you should find it interesting reading.
> 
> You'll probably discover that you want to migrate your template stuff to 
> Wicket anyway at some point, in which case this is the approach you'll 
> need to adopt anyway.
> 

I have seen your blog before.  I was even skimming over it again today
earlier.  I'll have to sit down and read it thoroughly to see what it will
entail to implement, and how long it will take.

I'd love to migrate everything to wicket right now, but it's an very large
app and we barely have time to implement the new component we're working on
now (which IS all wicket).

Thanks for the help.  And thanks to Martijn as well.

Joel
-- 
View this message in context: http://www.nabble.com/Embedding-wicket-in-jsp-error-tf4488872.html#a12803501
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Embedding wicket in jsp error

Posted by Al Maw <wi...@almaw.com>.
hillj2 wrote:
> I know this has been discussed before, but none of the previous posts have
> helped me solve my problem.  I'm trying to embed a wicket page into a jsp
> page (until I have time go back and convert all our jsp's to wicket) using
> the <jsp:include> tag.

At the very least, you'll need to do what Martijn suggests and set a 
one-pass render strategy.

I'd recommend you go and read my blog post about this whole topic:
http://herebebeasties.com/2007-03-01/jsp-and-wicket-sitting-in-a-tree/

It comes at things from slightly the other end of the spectrum 
(embedding JSPs in a Wicket page) but the issues are very similar and 
you should find it interesting reading.

You'll probably discover that you want to migrate your template stuff to 
Wicket anyway at some point, in which case this is the approach you'll 
need to adopt anyway.

Good luck.

Best Regards,

Al

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Embedding wicket in jsp error

Posted by hillj2 <Hi...@michigan.gov>.

Martijn Dashorst wrote:
> 
> I don't have any experience with oc4j nor embedding wicket in JSPs,
> but I know two things that can cause trouble:
>  - make sure you use ONE_PASS_RENDER as a render strategy
> 

I actualy did have this set up in our main app.  I just didn't put it in my
small test app.  I changed the render strategy on the test app and got the
same error.


Martijn Dashorst wrote:
> 
>  - don't use oc4j, or at least look at the threads on this list, as
> there have been more problems with oc4j and Wicket.
> 

I know, several of those posts are probably mine. :)  Frankly I've been
about ready to chuck oc4j myself, but it's not my call.  Although it may
come to it if we finally reach a problem that has no workaround.  However,
when I ran the app in Tomcat it also didn't work, so it doesn't look to be
an oc4j specific problem this time (I'm as shocked as you are).

-- 
View this message in context: http://www.nabble.com/Embedding-wicket-in-jsp-error-tf4488872.html#a12803370
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Embedding wicket in jsp error

Posted by Martijn Dashorst <ma...@gmail.com>.
I don't have any experience with oc4j nor embedding wicket in JSPs,
but I know two things that can cause trouble:
 - make sure you use ONE_PASS_RENDER as a render strategy
 - don't use oc4j, or at least look at the threads on this list, as
there have been more problems with oc4j and Wicket.

Martijn

On 9/20/07, hillj2 <Hi...@michigan.gov> wrote:
>
> I know this has been discussed before, but none of the previous posts have
> helped me solve my problem.  I'm trying to embed a wicket page into a jsp
> page (until I have time go back and convert all our jsp's to wicket) using
> the <jsp:include> tag.  oc4j throws a ServletException: Error in Servlet,
> with no further information specifying the problem, nor any indication from
> wicket that it's having a problem.  To isolate the problem I tried to
> recreate it in a very small app, so I could rule out any issue with other
> app code/configurations.  This time, I get a more informative (but not
> necessarily more helpful) error message:
>
> java.lang.IllegalStateException: Response has already been committed, be
> sure not to write to the OutputStream or to trigger a commit due to any
> other action before calling this method.
>
> I'm hoping it's the same error in both cases, and the former case just has a
> more generic error message for some reason; but I was hoping someone might
> have a clue why I can't get the embedding to work.  I'm using oc4j 10.1.3.3,
> and wicket beta2.  I tried it on Tomcat also.  It didn't throw an error, but
> the place where the wicket content should be was just empty.
>
> I'd prefer not to have to do this with embedded IFRAME's as I've seen
> suggested.  That's the setup I have now, but when a page loads there's a
> delay loading the IFRAME content, which doesn't look very nice, especially
> since the embedded content is my app's navigation menu.  Any thoughts,
> suggestions, alternate solutions to the embedding issue?
>
> Here's the code from my small test app:
>
> embed.jsp
> ========
> <html>
>  <head>
>   <title>Embed test</title>
>  </head>
>  <body>
>   <jsp:include page="/wicket/" flush="true">
>   </jsp:include>
>   <p>Here is my JSP content</p>
>  </body>
> </html>
>
> EmbedServlet.java
> ==============
> public class EmbedServlet extends HttpServlet {
>
>   public void doGet(HttpServletRequest request, HttpServletResponse
> response)
>     throws ServletException, IOException {
>     doPost(request, response);
>   }
>
>   public void doPost(HttpServletRequest request, HttpServletResponse
> response)
>     throws ServletException, IOException {
>
>     RequestDispatcher rd  =
> request.getRequestDispatcher("/WEB-INF/jsp/embed.jsp");
>     rd.forward(request, response);
>
>   }
>
> }
>
> EmbedApplication.java
> =================
> public class EmbedApplication extends WebApplication {
>
>   public EmbedApplication() {
>     super();
>   }
>
>   public Class getHomePage() {
>     return EmbedPage.class;
>   }
>
>   protected void init() {
>     System.out.println("***** Wicket App initialized *****");
>   }
>
> }
>
> EmbedPage.java
> ============
> public class EmbedPage extends WebPage {
>   public EmbedPage() {
>     super();
>   }
> }
>
> EmbedPage.html
> ============
> <html>
>  <head>
>   <title>Embeded Wicket</title>
>  </head>
>  <body>
>   <p>Here is my wicket content.</p>
>  </body>
> </html>
>
> web.xml
> ======
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
> 2.2//EN"
>   "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"
> xmlns="http://java.sun.com/xml/ns/javaee">
>   <servlet>
>     <servlet-name>EmbedServlet</servlet-name>
>     <servlet-class>EmbedServlet</servlet-class>
>   </servlet>
>   <servlet-mapping>
>     <servlet-name>EmbedServlet</servlet-name>
>     <url-pattern>/main</url-pattern>
>   </servlet-mapping>
>   <servlet>
>     <servlet-name>EmbedApplication</servlet-name>
>
> <servlet-class>org.apache.wicket.protocol.http.WicketServlet</servlet-class>
>     <init-param>
>       <param-name>applicationClassName</param-name>
>       <param-value>EmbedApplication</param-value>
>     </init-param>
>   </servlet>
>   <servlet-mapping>
>     <servlet-name>EmbedApplication</servlet-name>
>     <url-pattern>/wicket/*</url-pattern>
>   </servlet-mapping>
>   <session-config>
>     <session-timeout>35</session-timeout>
>   </session-config>
>   <mime-mapping>
>     <extension>html</extension>
>     <mime-type>text/html</mime-type>
>   </mime-mapping>
>   <mime-mapping>
>     <extension>txt</extension>
>     <mime-type>text/plain</mime-type>
>   </mime-mapping>
> </web-app>
>
>
>
> Thanks,
> Joel
> --
> View this message in context: http://www.nabble.com/Embedding-wicket-in-jsp-error-tf4488872.html#a12801646
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org