Creating a Local WLS 10.3.2 Domain

While setting up a new project this morning I was reminded of a somewhat counter-intuitive sequence when setting up a local environment (even with the simple Pointbase install). When you get to this screen:

Clicking Next will give you this warning:

Just click OK. The database isn’t running at this time.

And, for those who haven’t upgraded in a while and don’t read the manual, you will want to click Run Scripts when you see this screen:

After the wizard completes, look for the create_db.cmd in the domain root and run it before starting the server. The first start, the server will have problems starting. Let it run until nothing is spit into the console anymore, then kill it and start it again. This time it should come up.

If you found this interesting, please share.

© Scott S. Nelson

ClassNotFoundException for PageFlowContextListener

I was a bit surprised to run across this issue for the first time in a 10.3.0 installation.  According to a post on OTN, it is caused by the actual Beehive library not added correctly in config.xml. However, when I ran across it, it was a different library (the sample projects) that were missing, but the same error occurred.

Go figure.

If you found this interesting, please share.

© Scott S. Nelson

Dynamic Log Location for log4j

I was really surprised that log4j doesn’t have any facility to set the log file location with a relative path. Hard to build a portable application if you need to set the full value of a local path. And don’t talk to me about config files, because that requires reading documentation, which is only read less than it is written.

So, if you use the standard log4j servlet approach to start your logging, you can weave in the following to set your path relative to your app:

org.w3c.dom.NodeList nodes = doc.getElementsByTagName("param");;
org.w3c.dom.Node node = null;//nodes.item(0);
org.w3c.dom.NamedNodeMap nodeMap = null;
for(int i=0; i < nodes.getLength(); i++)
{
    node = nodes.item(i);
    nodeMap = node.getAttributes();
    if(nodeMap.getNamedItem("name")
        .getNodeValue().equals("File"))
    {
        node = nodeMap.getNamedItem("value");
        outputFile = new File(getServletContext().getRealPath(node.getNodeValue()));
        outPutPath = outputFile.getAbsolutePath();
        outPutPath = outPutPath.replace('', '/');
        node.setNodeValue(outPutPath);
    }
}

Then you can set the log location to outPutPath.

Enjoy 🙂

If you found this interesting, please share.

© Scott S. Nelson

Facelet Face Off on WLP

If you chose the Facelet aspect for your WLP project in 10.3.2, your portlets will use the “native” (i.e., WLP-only) portlet bridge rather than the “JSR-329” (i.e., crystal ball) bridge.  In case you need to reuse your portlets in another portal framework.

I haven’t had time to try it out, but in theory one could write the .portlet file by hand and still get the best of both worlds.

If you found this interesting, please share.

© Scott S. Nelson

WLP 10.3.2 ClassCastException in FacesContext

If you see:

java.lang.ClassCastException: com.bea.portlet.container.ActionRequestImpl

Try adding the following:

import javax.portlet.ActionRequest;


ActionRequest actionRequest = (ActionRequest) ctx.getExternalContext().getRequest();
HttpServletRequest httpRequest = (HttpServletRequest) actionRequest.getAttribute(“javax.servlet.request”);

If you found this interesting, please share.

© Scott S. Nelson