Tuesday 23 December 2008

Jetty 6 : JSP support not configured

Got this when running jetty 6 in eclipse 3.3, make sure to include the jsp jars in the library definition for jetty, so your jsp source can be compiled. See this for more details.

Monday 22 December 2008

confluence.public.thoughtworks.org - 502 error

CruiseControl Wiki 502 Proxy Error : it seems a bit odd that a company that brought us cruisecontrol for continual build intergration, can't seem to keeps its own web servers up and running for continual use.

Wednesday 10 December 2008

Lighttpd & PHP

Trying to get lighttpd and php/php-cgi running on windows. This is the command line output


C:\tools\LightTPD>LightTPD.exe -f lighttpd.conf -m lib -D 2008-12-10 18:52:18: (log.c.97) server started
8 [sig] LightTPD 3936 _cygtls::handle_exceptions: Error while dumping state (probably corrupted stack)
2008-12-10 18:52:32: (mod_cgi.c.1244) cleaning up CGI: process died with signal 11
2008-12-10 18:52:45: (server.c.1354) [note] graceful shutdown started
2008-12-10 18:52:45: (server.c.1468) server stopped by UID = 400 PID = 2404


and the stack dump is


Stack trace:
Frame Function Args
0022C048 7C802542 (0000007C, 0000EA60, 000000A4, 0022C090)
0022C168 61097F54 (00000000, 7C802600, 7C802542, 000000A4)
0022C258 61095AEB (00000000, 003B0023, 00230000, 0022CE68)
0022C2B8 61095FCB (0022C2D0, 00000000, 00000094, 0022C300)
0022C378 61096182 (00000F60, 00000006, 0022C3A8, 61096383)
0022C388 610961AC (00000006, 0022CE88, 64704338, 0022C3C0)
0022C3A8 61096383 (61103150, 64704338, 64704000, 000003EB)
0022C4D8 64703108 (006B1250, 006BE500, 006BBB78, 00000000)
0022C508 6CA85777 (006B1250, 006BE500, 006BE810, 0022C538)
0022C548 00403C8F (006B1250, 006BE500, 00000005, 6CA865A3)
0022C9C8 00406FDD (006B1250, 006BE500, 00000001, 0040145C)
0022CCA8 004027D8 (00000006, 006B1220, 006B0090, 60030000)
0022CD98 610060D8 (00000000, 0022CDD0, 61005450, 0022CDD0)
61005450 61004416 (0000009C, A02404C7, E8611021, FFFFFF48)
Exception: STATUS_ACCESS_VIOLATION at eip=61016583
eax=EC815356 ebx=61108148 ecx=00000000 edx=57E58959 esi=0000000E edi=00000001
ebp=006AC8B8 esp=006AC8B0 program=C:\tools\LightTPD\LightTPD.exe, pid 3936, thread sig
cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023
Stack trace:
Frame Function Args
006AC8B8 61016583 (61108148, 6111C19B, FFFFFF48, 00000000)
006AC8D8 610166EC (00000001, 00000000, 00000000, 006AC960)
006AC918 61017FD5 (000007C4, 006AC960, 00000000, 00000000)
006ACC58 61018638 (000006D4, 006ACC90, 000000A4, 006ACC8C)
006ACD58 61099F57 (61106F00, 00000000, 00000000, 00000000)
006ACD88 61002F32 (006ACE64, 61018970, 00001074, 00000000)
61003650 61003769 (04A16430, 89000000, FFDA90B0, 24468BFF)
8 [sig] LightTPD 3936 _cygtls::handle_exceptions: Error while dumping state (probably corrupted stack)

Tuesday 2 December 2008

Cargo Jboss42x ANT

Getting the following error when i attempt to use an ANT target to start a locally installed jboss 4.2.3 via the cargo jboss42x containter.


C:\projects\5FL_GERMANY\ValidationService>ant -f cargo.xml jboss-start
Buildfile: cargo.xml

jboss-start:
[echo] ./../../Libs/jboss-4.2.3.GA
[echo] ./../../Libs/cargo/0.9/cargo-core-uberjar-0.9.jar

BUILD FAILED
C:\projects\5FL_GERMANY\ValidationService\cargo.xml:28: org.codehaus.cargo.conta
iner.ContainerException: Cannot create configuration. There's no registered conf
iguration for the parameters (container [id = [jboss42x], type = [installed]], c
onfiguration type [existing]). Actually there are no valid types registered for
this configuration. Maybe you've made a mistake spelling it?

Thursday 13 November 2008

Customised Eclipse Java Search Results View

I want to be able to have more control over the export options, on the resuts tree from eclipse java search. i plan to customise the search results view, to enable a table view where i can copy/paste various column details.

I've done my initial googling, but all the examples assume that there is customised search and search results extensions being added. I want my 'org.eclipse.search.searchResultViewPages' extension to recieve the same 'org.eclipse.jdt.internal.ui.search.JavaSearchResult' objects that the default view processes.

I want to reuse the default java search dialog



icon="icons/full/obj16/jsearch_obj.png"
label="%JavaSearchPage.label"
sizeHint="460,160"
extensions="java:90, jav:90"
showScopeSection="true"
canSearchEnclosingProjects="true"
class="org.eclipse.jdt.internal.ui.search.JavaSearchPage">




but have a new customised class, that handles the layout of the search results.


id="JavaSearchResultPage"
point="org.eclipse.search.searchResultViewPages">
id="org.eclipse.jdt.ui.JavaSearchResultPage"
searchResultClass="org.eclipse.jdt.internal.ui.search.JavaSearchResult"
class="org.eclipse.jdt.internal.ui.search.JavaSearchResultPage">




the starting point

http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_search_searchResultViewPages.html

for writing your own java search queries

http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_search.htm

Wednesday 12 November 2008

Apache Forrest - plugin.xmap.output?


site:
[echo]
[echo] Copying the various non-generated resources to site.
[echo] Warnings will be issued if the optional project resources are not found.
[echo] This is often the case, because they are optional and so may not be available.
[echo] Copying project resources and images to site ...
[copy] Warning: C:\projects\5FL_GERMANY\focus\forrest\build\webapp\resources not found.
[copy] Copying 2 files to C:\projects\5FL_GERMANY\focus\forrest\build\site\en
[echo] Copying main skin images to site ...
[copy] Copying 18 files to C:\projects\5FL_GERMANY\focus\forrest\build\site\en\skin\images
[copy] Copying 14 files to C:\projects\5FL_GERMANY\focus\forrest\build\site\en\skin\images
[echo] Copying project skin images to site ...
[copy] Warning: C:\projects\5FL_GERMANY\focus\forrest\src\documentation\skins\common\images not found.
[copy] Warning: C:\projects\5FL_GERMANY\focus\forrest\src\documentation\skins\pelt\images not found.
[echo] Copying main skin css and js files to site ...
[copy] Copying 11 files to C:\projects\5FL_GERMANY\focus\forrest\build\site\en\skin
[copy] Copying 4 files to C:\projects\5FL_GERMANY\focus\forrest\build\site\en\skin
[echo] Copying project skin css and js files to site ...
[copy] Warning: C:\projects\5FL_GERMANY\focus\forrest\src\documentation\skins\common not found.
[copy] Warning: C:\projects\5FL_GERMANY\focus\forrest\src\documentation\skins\pelt not found.
[echo]
[echo] Finished copying the non-generated resources.
[echo] Now Cocoon will generate the rest.
[echo]
[echo] Static site will be generated at:
[echo] C:\projects\5FL_GERMANY\focus\forrest\build\site\en
[echo]
[echo] Cocoon will report the status of each document:
[echo] - in column 1: *=okay X=brokenLink ^=pageSkipped (see FAQ).
[echo]
[java] ------------------------------------------------------------------------
[java] cocoon 2.2.0-dev
[java] Copyright (c) 1999-2005 Apache Software Foundation. All rights reserved.
[java] Build: December 8 2005 (TargetVM=1.4, SourceVM=1.4, Debug=on, Optimize=on)
[java] ------------------------------------------------------------------------
[java] * [1/0] [0/0] 0.891s 0b linkmap.html
[java] org.apache.cocoon.sitemap.PatternException: Cannot get variable 'plugin.xmap.output' in expression '{lm:plugin.xmap.output}'
[java] at org.apache.cocoon.components.treeprocessor.variables.PreparedVariableResolver.processModule(PreparedVariableResolver.java:250)
[java] at org.apache.cocoon.components.treeprocessor.variables.PreparedVariableResolver.resolve(PreparedVariableResolver.java:197)
[java] at org.apache.cocoon.components.treeprocessor.sitemap.SelectNode.invoke(SelectNode.java:77)
[java] at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:77)
[java] at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:155)
[java] at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:77)
[java] at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:95)
[java] at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:292)
[java] at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:223)
[java] at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:289)
[java] at org.apache.cocoon.Cocoon.process(Cocoon.java:557)
[java] at org.apache.cocoon.bean.CocoonWrapper.getPage(CocoonWrapper.java:426)
[java] at org.apache.cocoon.bean.CocoonBean.processTarget(CocoonBean.java:496)
[java] at org.apache.cocoon.bean.CocoonBean.process(CocoonBean.java:357)
[java] at org.apache.cocoon.Main.main(Main.java:311)
[java] Caused by: org.apache.avalon.framework.configuration.ConfigurationException: Unable to build LocationMap.
[java] at org.apache.forrest.locationmap.LocationMapModule.loadConfiguration(LocationMapModule.java:148)
[java] at org.apache.forrest.locationmap.LocationMapModule.getLocationMap(LocationMapModule.java:105)
[java] at org.apache.forrest.locationmap.LocationMapModule.getAttribute(LocationMapModule.java:203)
[java] at org.apache.cocoon.components.treeprocessor.variables.PreparedVariableResolver.processModule(PreparedVariableResolver.java:246)
[java] ... 14 more
[java] Caused by: org.apache.excalibur.source.SourceNotFoundException: Exception during processing of cocoon://locationmap.xml
[java] at org.apache.cocoon.components.source.impl.SitemapSource.getInputStream(SitemapSource.java:207)
[java] at org.apache.forrest.locationmap.LocationMapModule.loadConfiguration(LocationMapModule.java:144)
[java] ... 17 more
[java] Caused by: org.apache.cocoon.ResourceNotFoundException: Resource not found.
[java] at - file:/C:/projects/Libs/apache-forrest-0.8/main/webapp/./sitemap.xmap:403:38
[java] at - file:/C:/projects/Libs/apache-forrest-0.8/main/webapp/./sitemap.xmap:402:63
[java] at org.apache.cocoon.components.source.SourceUtil.handle(SourceUtil.java:377)
[java] at org.apache.cocoon.components.source.SourceUtil.getInputSource(SourceUtil.java:450)
[java] at org.apache.cocoon.components.source.SourceUtil.parse(SourceUtil.java:281)
[java] at org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:118)
[java] at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:537)
[java] at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:174)
[java] at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:437)
[java] at org.apache.cocoon.components.source.impl.SitemapSource.getInputStream(SitemapSource.java:199)
[java] ... 18 more
[java] Caused by: org.apache.excalibur.source.SourceNotFoundException: file:/C:/projects/Libs/apache-forrest-0.8/main/webapp/././../../../Libs/apache-forrest-0.8/main/webapp/locationmap.xml doesn't exist.
[java] at org.apache.excalibur.source.impl.FileSource.getInputStream(FileSource.java:150)
[java] at org.apache.cocoon.components.source.SourceUtil.getInputSource(SourceUtil.java:445)
[java] ... 24 more
[java] Caused by: java.io.FileNotFoundException: C:\projects\Libs\apache-forrest-0.8\main\webapp\.\.\..\..\..\Libs\apache-forrest-0.8\main\webapp\locationmap.xml (The system cannot find the path specified)
[java] at java.io.FileInputStream.open(Native Method)
[java] at java.io.FileInputStream.(FileInputStream.java:106)
[java] at org.apache.excalibur.source.impl.FileSource.getInputStream(FileSource.java:146)
[java] ... 25 more
[java] X [0] linkmap.html BROKEN: URI not found: Cannot get variable 'plugin.xmap.output' in expression '{lm:plugin.xmap.output}'
[java] Total time: 0 minutes 4 seconds, Site size: 0 Site pages: 1
[java] Java Result: 1
[echo]
[echo] Copying broken links file to site root.
[echo]
[copy] Copying 1 file to C:\projects\5FL_GERMANY\focus\forrest\build\site\en

BUILD FAILED
C:\projects\5FL_GERMANY\focus\forrest\build.xml:16: The following error occurred while executing this line:
C:\projects\Libs\apache-forrest-0.8\main\targets\site.xml:180: Error building site.

There appears to be a problem with your site build.

Read the output above:
* Cocoon will report the status of each document:
- in column 1: *=okay X=brokenLink ^=pageSkipped (see FAQ).
* Even if only one link is broken, you will still get "failed".
* Your site would still be generated, but some pages would be broken.
- See C:\projects\5FL_GERMANY\focus\forrest\build\site\en/broken-links.xml

Thursday 25 September 2008

Ordinal 2684 LIBEAY32.dll - CruiseControl SVN

Setting up cruisecontrol today to work against a SVN repository. I got this odd dialog popping up when the modification set or update phases of the process are executed.



Which states "the ordinal 2684 could not be located in the dynamic link library LIBEAY32.dll". It seems the that SVN package has its own version of libeay32.dll, which might cause a conflict with the original windows version.


C:\WINDOWS\system32
C:\tools\svn-win32-1.5.2\bin


It seems that cruisecontrol SVN plugin is using the default JavaHL ( which calls one version of the DLL file via JNI).



I found this simular blog post on eclipse-subversive-ordinal-not-located-in-libeay32dll, where the workaround is to disabled the JavaHL settings.

I think need to find some way to get the modification set plugin to use the SVNKit api when it checks for updates.

Wednesday 24 September 2008

Syntaxhighlighter 1.5.1 Blogger

I updated my blog template this morning to use the latest google syntaxhighlighter which has some extra support of xml snippets in blog posts. The only difference with other solutions is that i load the javascript directly from the google svn servers.


Tuesday 23 September 2008

Cargo Jetty6x Slf4j Logging

I've been getting the following error when i trying to start my cargo/jetty6x plugin via maven.


org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationExc
eption: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You h
ave more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused
by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have
more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.) (Caused by
org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationEx
ception: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logg
ing.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationExcept
ion: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.
Log' visible, which is not allowed.))
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.apache.jasper.servlet.JspServlet.(JspServlet.java:58)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:152)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:593)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1191)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:481)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:434)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)




org.slf4j
jcl-over-slf4j
1.5.3


org.slf4j
slf4j-api
1.5.3


org.slf4j
slf4j-simple
1.5.3



I have found this post Switching to SLF4J and this. I believe i have configured my slf4j jars correctly like so



org.codehaus.cargo
cargo-maven2-plugin

false

jetty6x
embedded



${servlet.port}





start-container
pre-integration-test

start
deploy



stop-container
post-integration-test

stop






The standalone jetty plugin seems to run ok.



org.mortbay.jetty
maven-jetty-plugin
6.1.6



${servlet.port}
30000


/
stop
9091


Monday 15 September 2008

Eclipse 3.4 & Tomcat Runtime Server Config

I'm trying to create a tomcat runtime server configuration

Windows -> Preferences -> Server -> Runtime Env -> Add -> Download additional server adapters

but the dialog always seems to timeout waiting for "com.sdn.sap.com" to respond. Is there a way to remove this url from the eclipse config?

Tuesday 12 August 2008

Dom4j : DocumentHelper.createDocument()

Got this error from a xml file created using the Dom4j API.


javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: The markup in the document preceding the root element must be well-formed.


We were missing the xml header in the file



because we didn't call the DocumentHelper.createDocument() method!


import org.dom4j.Document;
import org.dom4j.DocumentHelper;

Document document = DocumentHelper.createDocument();

Tuesday 22 July 2008

Morzine - Les Gets

Quick 40min spin this morning.


View Larger Map

Monday 21 July 2008

Morzine - Les Prodains

Out with mr kelly, jp not sean for an easy spin this morning.


View Larger Map

Sunday 20 July 2008

Morzine - Avoriaz

Left it a bit late to start, but an hour up and 15mins down.


View Larger Map

Saturday 5 July 2008

Ring of Kerry Cycle

The 175km Ring of Kerry Cycle, complete by myself and mr horan in 8 hours (6.5 on the bike).


View Larger Map

The polar profile.

Sunday 29 June 2008

Sunday 29th June 2008

Easy 35km ride with mr horan around naas - trying to avoid summer showers.




View Larger Map

Monday 5 May 2008

Monday 5th May 2008

48km - Monday 5th May 2008

Naas -> Rathmore -> Crosscoolharbour -> Brittas -> Kilteel -> Rathmore -> Naas

Monday 7 April 2008

Display web request attributes and parameters

To display the list of attributes and parameters that are linked to a http request in a jsp page.


Enumeration attrEnum = request.getAttributeNames();
while(attrEnum.hasMoreElements())
{
Object attr = attrEnum.nextElement();
System.out.println("Attr "+(String)attr+" : "+request.getAttribute((String)attr));
}

Enumeration paramEnum = request.getParameterNames();
while(paramEnum.hasMoreElements())
{
Object attr = paramEnum.nextElement();
System.out.println("Param "+(String)attr+" : "+request.getParameter((String)attr));
}

Friday 28 March 2008

Hibernate 3 - find() -> createQuery() -> createCriteria()

An example of various Hibernate query methods available, see Hibernate 3.2.2 Doc.

find()


List list = session.find(
"from RiskEvaluation where inherentRisk=? and residualRisk=?",
new Object[]{inherent.getLevel(),residual.getLevel()},
new Type[]{Hibernate.STRING,Hibernate.STRING});


createQuery()


List list = session.createQuery(
"from RiskEvaluation where inherentRisk = ? and residualRisk = ?")
.setString(0,inherent.getLevel())
.setString(1,residual.getLevel())
.list();


createCriteria()

  
Criteria criteria = session.createCriteria(RiskEvaluation.class);
criteria.add( Restrictions.eq("inherentRisk", inherent.getLevel()) );
criteria.add( Restrictions.eq("residualRisk", residual.getLevel()) );
List list = criteria.list();

Monday 17 March 2008

Monday 17th March 2008

St Paddy's Day - 3 hours, 65km

Harolds Cross -> Brittas -> Kilbride -> Sally's Gap -> Glencree -> Harolds Cross.

Wednesday 12 March 2008

Hangman with Generics

I'm implementing a hangman game, which uses a HashMap to store a character and result of the character guess.


public abstract class Guess{}

public class CorrectGuess extends Guess{}

public class FailedGuess extends Guess{}

public class Hangman {
private Map<Character,Guess> state = new HashMap<Character,Guess>();
}


I want to be able to get a list of the various correct and failed guesses, so the details can be displayed.

The nasty solution i've currently got is to use "instanceof", but i feel this misses the point of using generics.


// the calling code looks something like
void display()
{
hangmanDisplay.display(getFailedGuesses());
consoleDisplay.display(getCorrectGuesses());
}

public List<CorrectGuess> getCorrectGuesses()
{
List<CorrectGuess> list = new ArrayList<CorrectGuess>(secret.length());
for(Iterator iterator = state.values().iterator();iterator.hasNext();)
{
Guess guess = (Guess) iterator.next();
if(guess instanceof CorrectGuess)
list.add((CorrectGuess)guess);
}
return list;
}

public List<FailedGuess> getFailedGuesses()
{...}


I want to be able to use the generic parameter type to control what is added to the list.


// the calling code would then look something like
void display()
{
hangmanDisplay.display(getGuesses(new ArrayList<FailedGuess>()));
consoleDisplay.display(getGuesses(new ArrayList<CorrectGuess>());
}

/**
* get all values of generic parameter type T in the HashSet and add to the list.
*/
public void getGuesses(List<? super Guess> list)
{
state,values().iterator();
// how can i compare the type thats in the iterator.next() with the type defined by T in the input parameter?
}

Java Generics

I think the The Craftsman 44: Java Generics 2 gives the best exaplaination on when to use extends or super when defining Generics.

Basically use

you can widen the type of a list by using ? extends X, only if you
plan on reading from that list

and

If you plan on writing to that list, use

Tuesday 11 March 2008

The Open Closed Principle

The Open Closed Principle says that you should design modules that never change. When requirements change, you extend the behavior of such modules by adding new code, not by changing old code that already works.

Monday 18 February 2008

Sunday 17th Feb

Naas - Kill - Brittas - NewTownMountKennedy - Blessinton - Naas [45km]



View Larger Map

Thursday 14 February 2008

SVN KIT API


package com.xx;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNNodeKind;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;
import org.tmatesoft.svn.core.internal.io.fs.FSRepositoryFactory;
import org.tmatesoft.svn.core.io.SVNRepository;
import org.tmatesoft.svn.core.io.SVNRepositoryFactory;
import org.tmatesoft.svn.core.wc.SVNWCUtil;

public class FileSvnInfo
{
Log log = LogFactory.getLog(FileSvnInfo.class);

/*
* Default values:
*/
String url = "http://proddev-svn/svn/norkom/Prototypes/Ref2_Transliteration/trunk";
String name = "xx";
String password = "xx";
String filePath = "changelog.txt";

public FileSvnInfo()
{
SVNRepository repository = createSVNRepository();
log.info(createSVNRepository().getLocation().toString());

getFileInfo(repository,"changelog.txt");
getFileInfo(repository,"./Engineering");

}

private void getFileInfo(SVNRepository repository, String filePath)
{
try
{
SVNNodeKind kind = repository.checkPath(filePath, -1);
if(kind.equals(SVNNodeKind.FILE))
log.info(SVNNodeKind.FILE+" "+filePath);
else if(kind.equals(SVNNodeKind.DIR))
log.info(SVNNodeKind.DIR+" "+filePath);
else if(kind.equals(SVNNodeKind.NONE))
log.info(SVNNodeKind.NONE+" "+filePath);
else if(kind.equals(SVNNodeKind.UNKNOWN))
log.info(SVNNodeKind.UNKNOWN+" "+filePath);
}
catch(SVNException e)
{
e.printStackTrace();
}
}

private SVNRepository createSVNRepository()
{
SVNRepository repository = null;
try {
/*
* Creates an instance of SVNRepository to work with the repository.
* All user's requests to the repository are relative to the
* repository location used to create this SVNRepository.
* SVNURL is a wrapper for URL strings that refer to repository locations.
*/
repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(url));
} catch (SVNException svne) {
/*
* Perhaps a malformed URL is the cause of this exception
*/
System.err
.println("error while creating an SVNRepository for the location '"
+ url + "': " + svne.getMessage());
System.exit(1);
}

ISVNAuthenticationManager authManager =
SVNWCUtil.createDefaultAuthenticationManager(name, password);
repository.setAuthenticationManager(authManager);

return repository;
}

private static void setupLibrary()
{
/*
* For using over http:// and https://
*/
DAVRepositoryFactory.setup();
/*
* For using over svn:// and svn+xxx://
*/
//SVNRepositoryFactoryImpl.setup();

/*
* For using over file:///
*/
FSRepositoryFactory.setup();
}

/**
* @param args
*/
public static void main(String[] args)
{
setupLibrary();
new FileSvnInfo();
}
}

Saturday 9 February 2008

Saturday 9th Feb 2008


HC - Glencullen - Kilmalin - Rossbrook - HC


View Larger Map

Tuesday 5 February 2008

NTLM with Firefox

Here are the steps to make sure Firefox supports NTML authentication:

  • Type "about:config" in the address bar,
  • In the Filter, type in "ntlm".  This should make the "network.automatic-ntlm-auth.trusted-uris" property appear,
  • Add ".you.required.url"

It should allow you to use Firefox to access the service.

Saturday 26 January 2008

eclipse.ini

This is my current eclipse ini config.

-showsplash
org.eclipse.platform
-Dosgi.requiredJavaVersion=1.5
-vmargs
-Xms40m
-Xmx512m
-XX:MaxPermSize=128m

More on eclipse memory settings