Building JSPWiki from Source#

These instructions are targeted towards wiki administrators who might not be familiar with Java development.

Requirements#

  1. You'll need to have JDK 1.5.x installed. If it's not available from your platform (OS) provider, you can see if Sun has one available on their Java website.
  2. You'll also need to install the Apache Ant build tool. Note: it's only properly configured once you have added the JAVA_HOME environment variable and also after adding ant to your PATH.

Getting the Source Code#

Determine which release that you wish to get - the stable release or the development release. Source code for both can be obtained from the JSPWikiDownload page. If you can't find it, look harder -- it's there :-)

Compiling#

  1. Open a command-line console to your $JSPWiki_Source directory containing your build.xml file.
  2. There's two basic ways that you can build JSPWIki:
    1. If you plan to deploy JSPWiki as a directory, enter 'ant opened-war' at the command prompt (without the single-quotes).
    2. If you plan to deploy JSPWiki as a WAR file, enter 'ant war'.
  3. When you are prompted about certificates, just press ENTER. You will be prompted a total of three times.
  4. Once the command prompt returns, it should mean that the build process has been completed.

Deploying#

  1. If you had built JSPWiki using 'ant opened-war', then you can copy the the JSPWiki directory underneath your $JSPWiki_Source/build/ dir to your container's deployment dir. Typically, it's $Tomcat_Home/webapps/.
  2. Otherwise, if you had built it using 'ant war', then the last few lines printed to screen by the build process should indicate where the JSPWiki.war file was saved to. Most often, it should be saved to your $User_Temp/JSPWiki/install/ directory.

How do you build JSPWiki with JBuilder?#

May 3, 2002 MattMower#

I've successfully built JSPWiki using the Ant build.xml provided, however I would much rather use JBuilder 6 (my normal IDE) and it seems to be unable to grok the JSP pages.

For example "LeftMenuFooter.jsp" gives the error:

"LeftMenuFooter.jsp": Error #: 300 : variable wiki not found in class LeftMenuFooter_0002ejsp_jsp at line 9

Now looking at the source the very first line is:

<%-- Assumes that a variable called 'wiki' exists --%>

which leads me to assume that there is a JSP related step I am missing (I don't have much experience of JSP's).

Can anyone help?

Answering my own question.#

I've learned that you need to tell JBuilder not to check for errors at build time for files which are meant to be includes. I can now build and deploy my WAR to the integrated Tomcat server within JBuilder!


CVS access to sources#

May 3, 2002 -- MattMower#

Is there a way to get anon-CVS access to the JSPWiki source?

A: Yes. See AnonymousCVSAccess.


JDK version#

What JDK version do you usually compile with?

JanneJalkanen: JSPWiki official distributions are compiled with JDK 1.5.0. See also JSPWikiJDKCompatibility.


Blank page#

After trying to build and run JSPWiki, I am getting blank pages without any error messages in log. Any idea how to find problem?


Runtime Exception during deployment#

Building JSPWiki 2.4.82 using Sun JDK SE 1.5.0_09 on Linux as a NetBeans 5.5 project works. But when I run the project (Tomcat 5.5.17 bundled with NetBeans) the JSPWiki webapp fails to deploy because of this error:
java.lang.ClassCastException: com.ecyrd.jspwiki.tags.AttachmentsIteratorInfo 
cannot be cast to javax.servlet.jsp.tagext.TagExtraInfo

Any ideas how to resolve this issue?

--Scott Douglass, 20-Dec-2006

I have similar problem when running JSPWiki on NetBeans 6.0 against Tomcat 5.5.

4500 [http-8080-Processor25] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/wiki].[jsp]  - Servlet.service() for servlet jsp threw exception
java.lang.ClassCastException: com.ecyrd.jspwiki.tags.AdminBeanIteratorInfo cannot be cast to javax.servlet.jsp.tagext.TagExtraInfo
	at org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:420)
	at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:248)
	at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:162)
	at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
	at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
	at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1543)
	at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
	at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
	at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
	at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at com.ecyrd.jspwiki.ui.WikiServletFilter.doFilter(WikiServletFilter.java:99)
	at com.ecyrd.jspwiki.ui.WikiJSPFilter.doFilter(WikiJSPFilter.java:91)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
	at java.lang.Thread.run(Thread.java:619)

Does anyone able to run JSPWiki on NetBeans 6.0 against Tomcat 5.5?

This problem can be because a mismatch of the jsp-api.jar between Tomcat and JSPWiki.
I del jsp-api.jar from build (in NetBeans you can uncheck checkbox "package" for this jar in Library block
in Project properties because this library neсessary for compiling) and it help me.
--Anatoly, 26-Jan-2009


---oraps1999 27-Feb-2008

Can't use new wiki:Tag#

Added a new tag class to com.ecyrd.jspwiki.tags, and added it to the jspwiki.tld. However, my wiki:Skins tag can't be used and there's no reason that I can see why. Here's the error from the logs:
javax.servlet.jsp.JspException: /templates/sp2/commonheader.jsp(154,2) 
Unable to load tag handler class "com.ecyrd.jspwiki.tags.SkinsTag" for tag "wiki:Skins"

I installed the class in the appropriate package folders under JSPWiki/WEB-INF/classes.

--Scott Douglass, 20-Dec-2006

You can't put anything under com.ecyrd.jspwiki unless you put it in the JSPWiki.jar file and sign the whole thing. This is a requirement from Java security. I recommend you put it in some other package, then it should work.

-- JanneJalkanen, 20-Dec-2006


Tried to "Re"-Build JSPWiki with WSAD (RAD 6.0.1)#

... hmm... in order to make few small changes in a bunch of plugins i tried this method and hit on a problem..

At first i created a new empty "JAVA"-Project in WSAD an importet all the .java-Sources into this Projekt (everything from the /src directory)
After that i changed one Line in the WeblogPlugin.java and tried to Export the whole Project as a .jar..
so i replaced the original JSPWiki.jar of my /WEB-INF/lib path with my "new" JSPWiki.jar and restarted
my Tomcat... everything works apparently fine.. but i if i try to "start" my Wiki a "JSPWiki Permission Denied"
Warning appeared... know anyone why? I just changed this line in the Plugin.. perhaps anything else works wrong with the "source" of JSPWiki or there are any diffrent between the stable?

--MartinU, 18-Apr-2007

Since the new JSPWiki.jar is built as a signed jar file, you'll also need to copy over the jspwiki.jks file from your $JSPWiki_Source/etc/ dir over to your $JSPWiki_Home/WEB-INF/ dir. If you can't find this file, it's possible that the build process used in your WSAD setup did not generate one. In that case, I would suggest following the build method & instructions at the top of this page.

--David Au, 18-Apr-2007

Thanks for your fast answer!

In order to your suggestion, i tried to use "ANT". But...

Searching for build.xml ...
Buildfile: /opt/path/to/jspwiki/JSPWiki_Build/build.xml

BUILD FAILED
file/opt/path/to/jspwiki/JSPWiki_Build/build.xml:664: Unexpected element "macrodef"

mhmmm no idea why... anyone else? --MartinU, 18-Apr-2007, 2:03pm

Hmm just a addition...

i think i need to use this...

>jarsigner
Usage: jarsigner [options] jar-file alias
       jarsigner -verify [options] jar-file

  [-keystore <url>]             keystore location

  [-storepass <password>]       password for keystore integrity

  [-storetype <type>]           keystore type

  [-keypass <password>]         password for private key (if different)

  [-sigfile <file>]             name of .SF/.DSA file

  [-signedjar <file>]           name of signed JAR file

  [-verify]                     verify a signed JAR file

  [-verbose]                    verbose output when signing/verifying

  [-certs]                      display certificates when verbose and verifying

  [-internalsf]                 include the .SF file inside the signature block

  [-sectionsonly]               don't compute hash of entire manifest

right? ... with which options?!

Thanks! --- MartinU - 18.April 2007

This error is probably occurring because you have an older version of ant installed. Also check that you have the latest version of ant defined in your $PATH.

--David Au, 18-Apr-2007

Okay.. i tried it now with ne newest ANT Build (1.7.0) and the build work pretty fine. I skipped the "signing" inputs with four [RETURNS] and this appears:

 [jar] Building jar: /opt/JSPWiki_Build/build/JSPWiki.jar
     [echo] Signing code with this certificate: /opt/JSPWiki_Build/etc/jspwiki.jks
     [exec] Alias name: jspwiki
     [exec] Creation date: Thu Apr 19 07:51:41 CEST 2007
     [exec] Entry type: keyEntry
     [exec] Certificate chain length: 1
     [exec] Certificate[1]:
     [exec] Owner: CN=ÿ, OU=JSPWiki Code Signing Division, O=ÿ, C=ÿ
     [exec] Issuer: CN=ÿ, OU=JSPWiki Code Signing Division, O=ÿ, C=ÿ
     [exec] Serial number: 4627036d
     [exec] Valid from: Thu Apr 19 07:51:41 CEST 2007 until: Wed Jul 18 07:51:41 CEST 2007
     [exec] Certificate fingerprints:
     [exec]      MD5:  07:0E:4D:A6:5A:24:75:CB:CD:D7:37:2C:F9:10:91:D0
     [exec]      SHA1: 6E:0E:E1:5D:60:ED:AC:E3:DC:B9:9B:68:D9:57:FC:93:F3:60:17:91
  [signjar] Signing JAR: /opt/JSPWiki_Build/build/JSPWiki.jar to /opt/JSPWiki_Build/build/JSPWiki.jar as jspwiki
  [signjar] Enter Passphrase for keystore: 

war:
      [war] Building war: /var/tmp/root/JSPWiki/install/JSPWiki.war

know i just changed the jspwiki.jks and the JSPWiki.jar in my running JSPWiki and the same error as before comes up:

Forbidden
Sorry, but you are not allowed to do that. 

Usually we block access to something because you do not have the correct privileges (e.g., read, edit, comment) for the page you are looking for. In this particular case, it is likely that you are not listed in the page’s access control list or that your privileges aren’t high enough (you want to edit, but ACL only allows ‘read’). 

It is also possible that JSPWiki cannot find its security policy, or that the policy is not configured correctly. Either of these cases would cause JSPWiki to block access, too. 

Better luck next time.

Any ideas again?

Thanks for Help ;o)

-- MartinU - 19 April 2007 - 08:11am

You can try replacing your $JSPWiki_Home/WEB-INF/jspwiki.policy file with the one from your $JSPWiki_Source/etc/ dir. I'm not sure if this will work though, there might be a mismatch somewhere else. As a last resort, you might have to just redeploy the entire JSPWiki.war file from a clean slate.

--David Au, 19-Apr-2007

If i would change or overwrite my existing jspwiki.policy all my access-right settings are over... hm.. if i build an entire.war than i lost ALL my changes in jsp-Sites and templates... any other idea anyone?

Thanks for AnswerMe!

-- Martinu - 20 April 2007 - 08:01am

To specify my problem i taked a look on ./admin/SecureConfig.jsp and i see in the Security Policy Restrictions part if i use my "new" JSPWiki.jar that all fields are red.. if i changed back to the original JSPWiki.jar few fields are green like i configured the jspwiki.policy... By the way, the jspwiki.jks is the same of my Build and the Build of the orginal Wiki... ... perhaps this will help you to helpe me?! ;o)

-- MartinU - 20 April 2007 - 01:12pm


So you can avoid my stupid mistake...#

It might not be immediately obvious, but You can't install a "built from source" version of jspwiki in the same Tomcat container as a prebuilt one. I was trying to test a build in the same Tomcat container that I was using for my personal wiki and kept getting a "You don't have access..." error to the Main page. The problem naturally was that the authentication stuff picks up the first jspwiki.jks file that the Tomcat server chooses to initialize, and subsequent JSPWiki.jar and their associated jspwiki.jks files will be considered "tampered with" due to the fact that the security mechanisms can't currently deal with two installations which contain two different jspwiki.jks signatures.

-- Langley - 20 April 2007 - 09:42 am (EST)

Thanks Langley for the great helpful answer... i setted up a know tomcat and everything works fine now!

Thanks to all of you!

-- MartinU - 23 April 2007 - 08:10 am (GMT+1)


strikethrough text

I am getting the same error as some others do:

java.lang.ClassCastException: com.ecyrd.jspwiki.tags.AdminBeanIteratorInfo
	at org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:420)
	at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:248)
	at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:162)

using tomcat 5.5.9 and jdk 1.5.03. I tried neary all, to solve it. Someone has an Idea how to solve?

--LukasWeberruss, 09-Mar-2008

Again a problem with the AdminBeanIteratorInfo:

org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: com.ecyrd.jspwiki.tags.AdminBeanIteratorInfo

This is for the default Wiki.jsp Any Idea?



This problem can be because a mismatch of the jsp-api.jar between Tomcat and JSPWiki.
I del jsp-api.jar from build (in NetBeans you can uncheck checkbox "package" for this jar in Library block
in Project properties because this library neсessary for compiling) and it help me.
--Anatoly, 26-Jan-2009


Build With NetBeans#

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-52) was last changed on 03-Mar-2011 11:15 by Janne Jalkanen