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();