Friday, March 26, 2010

Eclipse J2EE & IAM - NullPointerException

An internal error occurred during: "Updating classpath container: ...".
java.lang.NullPointerException
    at org.eclipse.wst.common.componentcore.internal.resources.
        VirtualResource.removeLink(VirtualResource.java:300)
    at org.eclipse.iam.wtp.core.internal.war.MavenWarClasspathListener.
        addOverlayWarFolders(MavenWarClasspathListener.java:89)
    at org.eclipse.iam.wtp.core.internal.war.MavenWarClasspathListener.
        resolved(MavenWarClasspathListener.java:57)
You've seen this error in Eclipse? This error occurs on the Eclipse J2EE in conjunction with Eclipse IAM. If you are writing a web application using maven as the build system - your welcome.
On the Internet I found a temporary solution - every time I load the eclipse and it compiles all projects, I should in web applications delete the folder .settings. However, it is not easy and may not be long-term solution.
After a long search for a solution was found.
In the file .project is necessary to add in a tag natures:
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
Furthermore, in the folder .settings need to create or modify file org.eclipse.wst.common.component. It should contain:
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
    <wb-module deploy-name="your-webapp">
         <module-type module-type-id="jst.web">
             <version>2.4</version>
             <property name="context-root" value="your-webapp"/>
             <property name="java-output-path" value="/target/classes/"/>
         </module-type>
         <wb-resource deploy-path="/WEB-INF/classes" source-path="/target/classes"/>
     </wb-module>
</project-modules>
"your-webapp" should be replaced by the name of your project.

I advise you add this file to the version control system.

Thursday, March 25, 2010

Oracle WebCenter Interaction 10.3.0 on Mac OS X

For a week I am a happy owner of MacBook Pro with 8 GB of memory. And since I'm working on a corporate portal for a large company, I needed to install the development environment and the portal directly to Mac OS X. However, the Oracle WebCenter Interaction 10.3.0 distribution does not exist for Mac OS X, I tried to install a version for Linux.
But the distribution of the portal does not install automatically. And I had to unpack it manually.
Since Mac OS X is built on Darwin - clone of FreeBSD, I thought that I could run binary programs for Linux under Mac OS X. But soon it became clear that a Linux program can not run straight under the Mac.
On a Mac there is no Linux emulator or program brandelf, which allows you to run Linux (and Solaris, SCO etc) software on FreeBSD.
Thus, I had the basic portal services installed on Windows 7 x64 in a virtual machine Fusion. In Windows, I installed Api Service, Automation Server, Content Upload, Document Repository, Publisher and Search Server.
Portal itself runs in the Java Virtual Mashine, but to communicate with the portal search server uses a native library. For communication with the search server I had to create RMI bridge between the portal and search server. The portal started running JVM installed on my Mac excelent. Moreover, because now the portal is left native libraries, it runs the same way on 32-bit and 64-bit JVMs.
I must however be noted that an RMI Bridge slowing the search server and can be used only for development. Soon I'll talk about installing programs PTSpy on a Mac.