Tuesday, February 27, 2007

The reel Sweetxml

pencil icon, that"s clickable to start editing the post
To my surprise I've discovered that my others also have fallen for the Sweetxml name, and that it's about XML in an non-XML way, it's clearly not for me as XML without angel brackets simply isn't XML - to me ;-). If you absolute has to see it you can read more about it on Paul Cantrell's creative effort on software and the Google groups on the software project. The purpose should be a more readable document, but I doesn't do it for me and the lack of tools/knowledge and the non-standard just doesn't make me join in. I allways try to respect other peoples choices, som I'll do the same with this and just because i own Sweetxml.org doesn't cange that.

Read more

Portlet Resources using clean JSTL

pencil icon, that"s clickable to start editing the post

Since I'm a great fan of XML I prefer to write my JSP pages as XML, since it guarantees wellformed markup and makes it easier to find errors in JSP's at development time (ant task to check for wellformedness) and naturally all the normal advantages of scriptlet free pages. This is also valid for my JSP's for my portlets and JSTL once more proved value to me when I had to reference a static resource (and image). In the test portlet application that comes with WSRP4J it's written as:

<IMG SRC=<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/images/project-logo.jpg")%>" align="TOP" />

Adhering to best practice with URLencoding, this can be achived with JSTL:

<c:url var="imageUrl" context="${renderRequest.contextPath}" value="/images/project-logo.jpg" />
<img src="${imageUrl}" />

Easy and clean just as it should be. The only improvement I can think of would be to ectend the portlet taglib to include an image tag that would do it automatically in one simpel tag, like:

<portlet:img src="/images/project-logo.jpg" />

much like Struts and Spring.

Read more

Sunday, February 25, 2007

Pluto 1.0.1 and web-app 2.4

pencil icon, that"s clickable to start editing the post
I wanted to get started on using WSRP by the WSRP4J project at apache , and has ended up in non-productive try and fails and google searches. Long story short, to get started WSRP4J doesn't have a binary to start with and therefore i had to use it from the svn repo, to find out that it uses Maven, which i havn't used before. I did get it running after some time, and then i wanted to tryit on my own portlets. I've tried the 1.1 beta branch of Pluto, but WSRP4J still uses Pluto 1.0.1, and for days i've been hassling to get i running. Logging/debugging in Tomcat 5.5/6.0 still puzzles me (worth and entry of it's own) but the last piece that i've got working was after endless log entries like
Feb 25, 2007 12:34:26 PM org.apache.pluto.portalImpl.services.log.LoggerImpl error
SEVERE: Error in Portlet
java.lang.NullPointerException
   at org.apache.pluto.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.java:109)
   at org.apache.pluto.invoker.impl.PortletInvokerImpl.load(PortletInvokerImpl.java:80)
   at org.apache.pluto.PortletContainerImpl.portletLoad(PortletContainerImpl.java:218)
   at org.apache.pluto.portalImpl.core.PortletContainerWrapperImpl.portletLoad(PortletContainerWrapperImpl.java:94)
   at org.apache.pluto.portalImpl.aggregation.PortletFragment.service(PortletFragment.java:120)
   at org.apache.jsp.WEB_002dINF.aggregation.ColumnFragment_jsp._jspService(ColumnFragment_jsp.java:76)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
   at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590)
   at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505)
   at org.apache.pluto.portalImpl.aggregation.AbstractFragment.service(AbstractFragment.java:112)
   at org.apache.jsp.WEB_002dINF.aggregation.RowFragment_jsp._jspService(RowFragment_jsp.java:76)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
   at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590)
   at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505)
   at org.apache.pluto.portalImpl.aggregation.AbstractFragment.service(AbstractFragment.java:112)
   at org.apache.jsp.WEB_002dINF.aggregation.PageFragment_jsp._jspService(PageFragment_jsp.java:85)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
   at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590)
   at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505)
   at org.apache.pluto.portalImpl.aggregation.AbstractFragment.service(AbstractFragment.java:112)
   at org.apache.jsp.WEB_002dINF.aggregation.RootFragment_jsp._jspService(RootFragment_jsp.java:147)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
   at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590)
   at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505)
   at org.apache.pluto.portalImpl.aggregation.AbstractFragment.service(AbstractFragment.java:112)
   at org.apache.pluto.portalImpl.Servlet.doGet(Servlet.java:254)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
   at java.lang.Thread.run(Thread.java:595)
I had an idea that web-app versions might be a problem, and had it running when i changed to version 2.3, I then changed it to 2.4 and redeployed and i still worked, but that was probably due to me lack of understanding on redeploying to tomcat. Any how it's also described in the mail archives (this from the google cache) Re: Supporting web.xml with 2.4 XSD The solution was to only put the version="2.4" attribute on the <web-app> tag and not the namespace information. Now I'll have to make sure everything else works without the namespace attributes. That's right for me as well. Now I'm not sure wether it'll actually run as a 2.4 web-app in tomcat, but time will show.

Read more

Tuesday, February 13, 2007

First entry at blog.sweetxml.org aka sweetxml.blogger.com

pencil icon, that"s clickable to start editing the post
I've finally decided to try out a hosted blog, since my own server is often off line and during my lateste upgrade of fedora I somehow lost my database backup. I'll try to restore my few postings from my last blog thanks to google cache.

Read more