Tuesday, July 28, 2009

Good settings for netbeans 6.7 on osx

Here are some good settings I have used for netbeans 6.7 on osx 1.5.7

netbeans_default_options="-J-Dorg.glassfish.v3.installRoot=/Applications/NetBeans/sges-v3-prelude -J-Dcom.sun.aas.installRoot=/Applications/NetBeans/SUNWappserver -J-Dorg.glassfish.v3.installRoot=/Applications/NetBeans/sges-v3-prelude -J-Dcom.sun.aas.installRoot=/Applications/N\
etBeans/SUNWappserver -J-Xms512m -J-Xmx1024m -J-XX:NewRatio=20 -J-XX:PermSize=96m -J-XX:MaxPermSize=128m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true -J-XX:+UseConcMarkSweepGC -J-XX:+UseParNewGC -J-XX:+CMSPermGenSweepingEnabled -J-XX:+CMSCl\
assUnloadingEnabled -J-XX:+CMSPermGenPrecleaningEnabled"

Tuesday, February 17, 2009

Problems building the uportal calender portlet

Uportal calender portlet


http://www.jasig.org/portlets/calendar-portlet

When building this seems to require

jakarta-slide-webdavlib version 2.2pre1-httpclient-3.0

as noted by maven.


ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) slide:jakarta-slide-webdavlib:jar:2.2pre1-httpclient-3.0

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=slide -DartifactId=jakarta-slide-webdavlib \
-Dversion=2.2pre1-httpclient-3.0 -Dpackaging=jar -Dfile=/path/to/file

Path to dependency:
1) org.jasig.portlet:CalendarPortlet:war:1.0.0-M2-SNAPSHOT
2) slide:jakarta-slide-webdavlib:jar:2.2pre1-httpclient-3.0

----------
1 required artifact is missing.

for artifact:
org.jasig.portlet:CalendarPortlet:war:1.0.0-M2-SNAPSHOT

from the specified remote repositories:
central (http://repo1.maven.org/maven2),
jasig-repository (http://developer.ja-sig.org/maven2),
jasig-snapshot (http://developer.ja-sig.org/maven2-snapshot),
Codehaus Snapshots (http://snapshots.repository.codehaus.org/)




Solution

Add this to your in your pom.xml file


caldav4j.repo
CalDav4J Repository
http://caldav4j.googlecode.com/svn/trunk/maven/

Wednesday, January 21, 2009

Consuming uPortal User Attributes as JSR-168 User Attributes

You need to add to your portlet.xml something like


User Family Name
user.name.family


where the attribute is the Key mapped within your PersonDirectory.xml or personDirs.xml (see manual chapter on user attributes).

Then from within your Portlet code you can access the values like this


Map userInfo = (Map)request.getAttribute(PortletRequest.USER_INFO);
String surname = (String)userInfo.get("user.name.family");

Using Two Databases with Hibernate

Found this little bit of code on the internet

Properties databaseAProperties = // get properties however you like
Properties databaseBProperties = // get properties however you like

SessionFactory databaseA
= new Configuration().configure("databaseA.cfg.xml")
.setProperties(databaseAProperties)
.buildSessionFactory();
SessionFactory databaseB
= new Configuration().configure("databaseB.cfg.xml")
.setProperties(databaseBProperties)
.buildSessionFactory();

Tuesday, January 20, 2009

Problems with Uportal giving a PermGen space error while using a hibernate portlet.

Apparently

PermGen space is controlled by a different java option:

So I wound recommend using

CATALINA_OPTS "-Xms1024m -Xmx2048m -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled"

as options for your tomcat server.