The Atlassian Extension Spaces have been migrated to http://plugins.atlassian.com. These pages are now deprecated and will soon be deleted.

New Code Macro

Name New Code Macro Plugin
Vendor Jeroen Benckhuijsen (Website)
Authors Jeroen Benckhuijsen, Marc Esher, Mark Hrynczak
Homepage http://confluence.atlassian.com/display/CONFEXT/New+Code+Macro
Issue Management https://studio.plugins.atlassian.com/browse/NCODE
Continuous Integration n/a
Categories Confluence Content
Most Recent Version 1.9.5
Availability confluence v2.10 to v3.0.2
State Prerelease
Support By: Jeroen Benckhuijsen
License Freeware / Open Source (Apache License, Version 2.0 (ASL))
Price Free
Release Docs
Java API Docs https://maven.atlassian.com/contrib/com/atlassian/confluence/ext/newcode-macro-plugin/1.9.5/newcode-macro-plugin-1.9.5-javadoc.jar
Download Source https://maven.atlassian.com/contrib/com/atlassian/confluence/ext/newcode-macro-plugin/1.9.5/newcode-macro-plugin-1.9.5-sources.jar
Download JAR 14424

plugin-compatibility-matrix: com.atlassian.plugin.repository.model.RepositoryException: Status code [500] returned while downloading: http://confluence-test.atlassian.com/plugin-repository/proxy.action?profile=jira&decorator=none&buildNumber=-1&repoClientVer=2.1.6&os=i386&javaVer=1.6.0_14&javaVendor=Sun+Microsystems+Inc.
1.9.5 released
The newest version of this plugin, 1.9.5, has been released after a month of development The testing efforts by the Atlassian Q&A team resulted only in some minor bugs, which are solved in this release. Main focus has been on getting copy/paste behaviour to work, which was finally closed due to the upgrade of the Syntax Highlighter library to version 2.1.364. With this release, the following main changes were also made:

Important fixes:

Also, some of our own fixes were incorporated:

Finally, the following major changes were made:

  • Removed 'ruler' feature, nobody seem to be using it
  • Line wrapping now works and looks like in most text editors, no more image
  • <script type="syntaxhighlighter" /> support (see updated usage page)

The following changes have been made:

  • Fixed NCODE-46: Line numbers are copied, even when not shown
  • Fixed NCODE-47: Macro broken in safari (font issue)
  • Fixed NCODE-48: Vertical and horizontal scroll bar in IE8
  • Partially fixed NCODE-49: Export to PDF ignores uploaded font
  • Fixed NCODE-50: Confluence 3.1 JavaScript issue fixed
  • Fixed NCODE-51: Copy to clipboard ignores white-space characters
  • Invalid NCODE-52: White-space characters are ignored on view Wiki-markup (confluence issue)
  • Fixed NCODE-53: Use AJS.log() instead of alert() for rendering errors
  • Fixed NCODE-54: Upgrade to Syntax Highlighter 2.1.364
Separate development page
A separate Development page has been added. This way we can split discussions on the way new features should be implemented from the general usage information.

Description/Features

This is the Newcode Macro plugin. A plugin developed to serve as a replacement
for the Code plugin delivered by Atlassian in the default installation of
Confluence. This plugin has to following goals:

  • Support the widely used programming languages, like Java, C#, C++ and PHP
  • Provide a better-looking result than the Code Macro
  • Leave the development of the source code highlighting to someone else, just
    provide the integration code to speed-up development.
    For live examples of the macro in action, see New Code Macro Examples!

Installation

  • Disable the original Code macro.
  • This plugin serves as a replacement and uses the same macro key.
  • Since 1.9.1 you can configure which macro key you want to use: {code} or {newcode}. The distributed jar defaults to {code}, thus serving as a replacement.
  • Install the distribution Jar-file using the Confluence Plugin Manager.

Configuration

If you want to use {newcode} as the macro key, disable and enable the appropiate plugins in the plugin administration.

As yet there are no other global configuration options which can be set.

Usage

This macro is almost a complete drop in replacement for the existing code block macro bundled with Confluence.

Parameter Since Required Description
lang 1.0 no (default param) the language to highlight, see below for support
title 1.9 no Set a title for the code
collapse 1.0 no "true" will collapse the code fragment by default
linenumbers 1.0 no "true" will show line numbers in the left gutter (up to 1.9.2, default: true)
firstline 1.0 no if showing line numbers, where to start numbering from (default 1)
controls 1.0 no "true" will show controls at the top of the code fragment to copy and print (up to 1.9.2, default: true)
ruler 1.9 no Removed in 1.9.5, "true" will show a ruler to indicate the columns (default: false)
theme 1.9 no If set, use the specified theme instead of the default
exportImage 1.9.3 no If set, force export to image instead of text (if possible)
macro body 1.0 yes the code to format

The macros also has accompanying documentation in the Wiki Notation Guide.

Supported Languages

Currently these are the supported languages and the aliases for them:

Language Aliases Version
ActionScript3 actionscript3, as3  
Bash/shell bash, shell 1.9
C Sharp csharp, c-sharp, c# (since 1.9.5) 1.0
C++ cpp, c 1.9
ColdFusion coldfusion, cf 1.9.3
CSS css 1.9
Delphi delphi, pas, pascal 1.0
Diff diff, patch 1.9
Erlang erlang, erl 1.9.5
Groovy groovy 1.9
Java java 1.0
JavaFX javafx 1.9.2
Javascript js, jscript, javascript 1.0
Perl perl, pl 1.9
PHP php 1.0
Plain text plain, text, none (since 1.9.2) 1.9
Powershell powershell, ps 1.9.1
Python py, python 1.0
Ruby rails, ror, ruby, rb 1.9.0
Scala scala 1.9.0
SQL sql 1.0
Visual Basic vb, vbnet 1.0
XML xml, xhtml, xslt, html 1.0

Supported Themes

Currently these are the supported themes and aliases for them:

  • Default - default (since 1.9)
  • DJango - django (since 1.9)
  • Emacs - emacs (since 1.9)
  • FadeToGrey - fadetogrey (since 1.9)
  • Midnight - midnight (since 1.9)
  • RDark - rdark (since 1.9)
  • Eclipse - eclipse (since 1.9.5)

Screenshots

Labels

plugin plugin Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. May 31, 2006

    Mark Michaelis says:

    The examples for the new code macro really look nice, but: It seems as if unlik...

    The examples for the new code macro really look nice, but:

    It seems as if unlike the old code macro the rendered result is not put into divs. This will break the layout of many old pages. E. g. the following code:

    # Here my code:
    {code:none|title=somefile.txt}
    XYZ
    {code}
    

    will not be rendered anymore with the code-panel beeing on a second line but rather with a textfield just behind "code:" with the bottom line of the field aligned with the bottom line of the text.

    Please at least find a way to make legacy markup look nice. Otherwise enabling this plugin will surely break many carefully designed layouts.

    1. Jun 01, 2006

      Mike Cannon-Brookes says:

      Mark - thanks for the feedback. We discovered this too, as well as a few bugs wi...

      Mark - thanks for the feedback. We discovered this too, as well as a few bugs with the WYSIWYG editor and code macro combined. These are being patched (some live here already) and should be released today.

  2. Jun 14, 2006

    Glenn Stewart says:

    I completely agree with Mark above. I like many of the new features of the "New...

    I completely agree with Mark above.

    I like many of the new features of the "New Code Macro", but have reservations as to the lacking of features the original Code Macro included. For this reason I also wonder if the two can co-exist somehow.

    In my opinion, the feature that is lacking is the ability to include a title. This is very useful for documenting contents of files for example.

    The following code useable by the original, no longer works:

    # Here my code:
    {code:none|title=somefile.txt}
    XYZ
    {code}
    

    The result is as follows:

    somefile.txt
    XYZ
    
  3. Jun 23, 2006

    Andrew J Cosgriff says:

    Here's a very basic Cisco config highlighter window.SyntaxHighlighter.config...

    Here's a very basic Cisco config highlighter

    dp.sh.Brushes.Cisco = function()
    {
    	//
    	// 2006 by Andrew J Cosgriff, based on emacs font-lock keywords at http://www.emacswiki.org/cgi-bin/wiki/cisco-router-mode.el
    	//
    	var toplevel_keywords =	'access-list class-map controller crypto interface policy-map redundancy route-map router username';
    	var command_keywords = 'alias boot card diagnostic ^enable hostname logging service snmp-server version vtp';
    
    	this.regexList = [
    		{ regex: new RegExp('^!.*$', 'gm'),							css: 'comment' },			//  comments
    		{ regex: new RegExp('[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+', 'g'),				css: 'vars' },			// IP addresses
    		{ regex: new RegExp('no ', 'gm'),						css: 'preprocessor' },		// "no" something
    		{ regex: new RegExp(this.GetKeywords(toplevel_keywords), 'gm'),		css: 'keyword' },	// cisco toplevel keywords
    		{ regex: new RegExp(this.GetKeywords(command_keywords), 'gm'),		css: 'keyword' }		// cisco command keywords
    		];
    
    	this.CssClass = 'dp-c';
    }
    
    dp.sh.Brushes.Cisco.prototype	= new dp.sh.Highlighter();
    dp.sh.Brushes.Cisco.Aliases	= ['cisco'];
    
  4. Jul 14, 2006

    Agnes Ro says:

    Note: this macro cannot be exported to PDF. This is a known bug, please use the...

    Note: this macro cannot be exported to PDF. This is a known bug, please use the original code macro if exports are required.

    Agnes.

    1. May 15, 2007

      Ulrich Trampe says:

      Here is a simple workaround for the PDF export bug, until it is fixed : Create a...

      Here is a simple workaround for the PDF export bug, until it is fixed : Create a user macro newcode with the following content and use it instead of code.

      ##check the request URI (if available) for doexport or exportword
      #if(!($req.getRequestURI().length() > 0) || ($req.getRequestURI().indexOf("doexport") == -1 && $req.getRequestURI().indexOf("exportword")== -1))
          ##not exporting, render code macro
          #set($globalHelper=$action.getGlobalHelper())
          #set($renderer=$globalHelper.getWikiStyleRenderer())
          #set($context=$content.toPageContext())
          #if($param0)
              #set($newContent="{code:${param0}}${body}{code}")
          #else
              #set($newContent="{code}${body}{code}")
          #end
          #set($renderedContent=$renderer.convertWikiToXHtml($context, $newContent))
          ${renderedContent}
      #else
          ##exporting, render simple code panel
          ${body}
      #end
      
  5. Jul 18, 2006

    Thomas Wendel says:

    Nifty macro! The only drawback is: Long pieces of code do not work well with th...

    Nifty macro!

    The only drawback is: Long pieces of code do not work well with the macro. The browser pops up a warning:

    Unable to render embedded object: File (unresponsive script.jpg) not found.

    If you click continue, the browser might show the code in the macro. If the code is really long, it takes ages and many continue-clicks.

    Would be awesome if you could fix that problem!

    Cheers
    Thomas

  6. Jul 27, 2006

    David Ruddock says:

    We tries out v1.3 and it but the Rich Text editor lost all the carrage returns i...

    We tries out v1.3 and it but the Rich Text editor lost all the carrage returns in the code, making it hard to edit. (WikiMarkup was fine - but not if you looked at the Rich Text first and then clicked on wiki markup)

    1. Aug 08, 2006

      daren desjardins says:

      We are having the same issue. Any time you switch to the Rich editor, the macros...

      We are having the same issue. Any time you switch to the Rich editor, the macros looses all formatting and becomes a single line.

      1. Aug 09, 2006

        Ivan Benko says:

        Hi Daren and David, What version of Confluence are you using? Could you raise a...

        Hi Daren and David,

        What version of Confluence are you using? Could you raise a support issue please?

        Thanks,
        Ivan

        1. Sep 01, 2006

          David Ruddock says:

          We're on 2.2.5 There's an outstanding issue here: http://jira.atlassian.com/bro...

          We're on 2.2.5

          There's an outstanding issue here: http://jira.atlassian.com/browse/CONF-6826

  7. Jul 28, 2006

    Tom Moore says:

    Thomas, that unresponsive script warning seems to be a bug with the way Firefox ...

    Thomas, that unresponsive script warning seems to be a bug with the way Firefox runs the javascript.  It seems to work fine in IE.  We've had to install IE Tab extension in firefox in order to use this, until the author can resolve this issue.

    1. Aug 02, 2006

      Thomas Wendel says:

      Tom, we also did experience this bug with IE or with the IE Tab extention for Fi...

      Tom, we also did experience this bug with IE or with the IE Tab extention for Firefox.

      Unable to render embedded object: File (unresponsive script IE.jpg) not found.

  8. Aug 02, 2006

    Tom Moore says:

    Oh ok.. Weird.. I stand corrected.  Seems to work fine for us in IE though.

    Oh ok.. Weird.. I stand corrected.  Seems to work fine for us in IE though.

  9. Aug 22, 2006

    David Aldrich says:

    I found that when I first inserted the new code macro and a code sample on a pag...

    I found that when I first inserted the new code macro and a code sample on a page and saved it, the code was displayed nicely. However, when I returned to edit the page, and viewed the Wiki markup and saved the page again, the code collapsed i.e. the line breaks were removed. Atlassian Support has recognised the problem and raised a bug: http://jira.atlassian.com/browse/CONF-6826

    Please vote for this issue to get it fixed.

  10. Sep 09, 2006

    Andrew J Cosgriff says:

    I've done a bit more work on the Cisco syntax highlighting. a diff against 1.0....

    I've done a bit more work on the Cisco syntax highlighting.

    a diff against 1.0.3 and a jar file are available via http://polydistortion.net/monkey/archives/2006/09/10/003819.html

  11. Sep 25, 2006

    Guy Fraser says:

    It would be super-useful to have a "wiki" language file for the syntax highlight...

    It would be super-useful to have a "wiki" language file for the syntax highlighter - there's loads of times when I've had to show chunks of wiki notation in user guides, etc., and having a wiki syntax would be a dream

  12. Oct 05, 2006

    Thomas Burkhart says:

    Hi, the plugin is great, but it would be even better if it would be possible to...

    Hi,

    the plugin is great, but it would be even better if it would be possible to display attached source files. Also a line range and not just a start would be great.

    If you expand a collapsed code fragment it should be possible to collapse them again.

    Best

    Thomas

  13. Oct 27, 2006

    Gary Pullis says:

    This would be a fantastic boon for my developers, but I'm concerned about using ...

    This would be a fantastic boon for my developers, but I'm concerned about using it until it's really stable. I think I'm going to go as far as to hold off until this moves from "New Code Macro" to "Standard Code Macro". When Atlassian trusts it enough to have it enabled, so will I.

  14. Dec 14, 2006

    John Price says:

    I just added a vote for fixing the bug that makes the RTF mode mess up code form...

    I just added a vote for fixing the bug that makes the RTF mode mess up code formatting. My team can't use this until that's fixed. Awesome macro though!

    1. Feb 23, 2007

      Pavlo Kasperskyi says:

      I am just wondering how this macro can have State = Stable.....

      I am just wondering how this macro can have State = Stable...

      1. Nov 07, 2007

        Matt Ryall (Atlassian) says:

        You're right. There are a number of significant bugs with this macro, so I've ch...

        You're right. There are a number of significant bugs with this macro, so I've changed its state to 'beta'.

        The bugs will also be moved from Confluence's issue tracker to the new project for this plugin:

        http://developer.atlassian.com/jira/browse/NCODE

  15. May 10, 2007

    Ric Parks says:

    Does anyone know if the issue with the rich test editor removing all the line br...

    Does anyone know if the issue with the rich test editor removing all the line breaks in code snippets has been resolved? Is there a work-around? This is an extremely, even fatal, problem for many of my existing pages.public void testThis {
    private static aTest;
    }
    Hm...looks like there's still a problem here, just a different one.

  16. May 15, 2007

    Ulrich Trampe says:

    Because of its unpredictable results and the loss of some features (title, borde...

    Because of its unpredictable results and the loss of some features (title, borderStyle, bgColor) the plugin should better not replace the original {code} macro. You can easily change the macros name by editing the atlassian-plugin.xml file within newcode-macro-plugin-1.0.3.jar.

    <macro name='newcode' class='com.atlassian.confluence.ext.code.NewCodeMacro' key='code'>

    After that, the macros name will be {newcode} and you can keep on using {code}.

    Hint for Windows Users: a jar is nothing else than a zip file, simply rename .jar to .zip and open it with windows explorer, rename it back to .jar before uploading it.

    1. May 15, 2007

      Ulrich Trampe says:

      In fact, I've changed the macros name to {newcodeorg}... <macro name='newcod...

      In fact, I've changed the macros name to {newcodeorg}...

      <macro name='newcodeorg' class='com.atlassian.confluence.ext.code.NewCodeMacro' key='code'>

      ...and access the {newcodeorg} macro not directly, but only via another user macro, I called {newcode} (to have a workaround for the PDF export bug, as described above):

      ##check the request URI (if available) for doexport or exportword
      #set($globalHelper=$action.getGlobalHelper())
      #set($renderer=$globalHelper.getWikiStyleRenderer())
      #set($context=$content.toPageContext())
      #if(!($req.getRequestURI().length() > 0) || ($req.getRequestURI().indexOf("doexport") == -1 && $req.getRequestURI().indexOf("exportword")== -1))
          ##not exporting, render new code macro
          #if($param0)
              #set($newContent="{newcodeorg:${param0}}${body}{newcodeorg}")
          #else
              #set($newContent="{newcodeorg}${body}{newcodeorg}")
          #end
      #else
          ##exporting, render simple code panel
          #if($param0 && ($param0 == 'actionscript' || $param0 == 'html' || $param0 == 'java' || $param0 == 'javascript' || $param0 == 'none' || $param0 == 'sql' || $param0 == 'xhtml' || $param0 == 'xml'))
              #set($newContent="{code:${param0}}${body}{code}")
          #else
              #set($newContent="{code}${body}{code}")
          #end
      #end
      #set($renderedContent=$renderer.convertWikiToXHtml($context, $newContent))
      ${renderedContent}
      
  17. Jul 11, 2008

    Treg Anderson says:

    Hi, I am having a problem using the New Code Macro on IE 7.0.  If I have on...

    Hi, I am having a problem using the New Code Macro on IE 7.0.  If I have one long line of text within the {code} tags the macro produces a scrollbar at the bottom of the code box but it covers up the single line of text. I am currently using IE 7.0 to enter this comment and when I shrink the width of the browser the scroll bar pops up over the text on the example below.

    This is some text that could cause a horizantal scroll bar with a narrow enough window

    With the window wide enough the scroll bar goes away and the text can be seen.

    Is this a bug that is known and is in the process of being fixed? I looked for the source code to take a look at it here but there doesn't seem to be any to download.

  18. Jul 23, 2008

    Crystal Johnson says:

    We have 2.8 installed and are trying to use C# with the code macro. I notice ...

    We have 2.8 installed and are trying to use C# with the code macro.

    I notice it is one of the supported languages, but come up with an error.

    Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml

    Please help.

    Thanks,

    Crystal Johnson

    1. Oct 02, 2008

      Erin Barschdorf says:

      We had the same problem. There was a Code macro that atlassian supports in ...

      We had the same problem. There was a Code macro that atlassian supports in the plugin list and enabled as well as the new code macro.  when we disabled the code macro we are able to use the C#  language.

  19. Sep 01, 2008

    Thomas Schmidt says:

    I found these two issues when using the new code macro: Highlightning for Pyth...

    I found these two issues when using the new code macro:

    • Highlightning for Python seems pretty poor.
    • the code inside the macro is messed up whenever you edit the page.

    Can we expect any improvements for this macro ?

  20. Mar 31, 2009

    Ben van Zanten says:

    I have some issues getting firstline to work. I use {NewCode:powershell|theme=...

    I have some issues getting firstline to work.
    I use {NewCode:powershell|theme=rdark|firstline=33} but it always starts counting from 01

    also a strong urge to leave the default {code} intact. If the new code macro keeps this name {NewCode} we don't have to disable the builtin {code} macro.

    And some remark about this page: the ruler is by default False, which is Ok. This page says incorrect it is True by default.

    PS. Where do you want my PowerShell formatter to be uploaded, or shall I send it by mail?

    1. Apr 08, 2009

      Jeroen Benckhuijsen says:

      Hi Ben, First of all, sorry about the late reply (been quite busy lately). Seco...

      Hi Ben,

      First of all, sorry about the late reply (been quite busy lately). Second, thanx for testing the new releases!

      About the issues you're facing and the PowerShell formatter, could you open (preferablly separate) JIRA issues for them. That's the easiest way to keep track of them. De formatter itself can then be attached to the bugreport. Given the impact of these issues (with the exception of the key for the macro, newcode vs. code) I expect to have them fixed by next release which I hope will be pretty soon. As for the key for the macro, I'm thinking about some ways to make this easily configurable. Some uses really want to keep the same key, as they would have to update a lot of pages otherwise. Looking into that!

    2. Apr 13, 2009

      Jeroen Benckhuijsen says:

      Ben, I've already added an issue for "firstline" (NCODE-10) and updated the pag...

      Ben,

      I've already added an issue for "firstline" (NCODE-10) and updated the page to reflect the correct default for ruler. If you could add JIRA issues for the other two, that would be great.

      1. Apr 15, 2009

        Ben van Zanten says:

        I've created Jira issue NCODE-12 ( http://developer.atlassian.com/jira/browse/NC...

        I've created Jira issue NCODE-12 ( http://developer.atlassian.com/jira/browse/NCODE-12 ) and attached my PowerShell / PS highlighter to it, have fun !

  21. Apr 10, 2009

    Fred Bunting says:

    (Filed in Jira: Description, in the Jira NCODE-9 .) When used with the {toc} m...

    (Filed in Jira: Description, in the Jira NCODE-9 .)

    When used with the {toc} macro on same page, and you click Save in the edit window, the first display of the page shrinks the code window.

    {toc}
    
    {code:python}
    # A tall but trivial code block.
    # Consisting of nothing but a few lines of comments.
    #
    #
    #
    #
    #
    #
    #
    #
    # End of code block
    {code} 
    
    

    Renders as:

  22. Apr 12, 2009

    Jeremy Thake says:

    I have disabled the Code Macro plugin and installed the jar package in the Plugi...

    I have disabled the Code Macro plugin and installed the jar package in the Plugins Manager and it states it is enabled. But when I go to any page with a {code} macro I get this error:

    Unknown macro: {code}

    I can enable the Code Macro plugin and it all works with standard {code} but I really want the csharp formatting!

    I am using Confluence 2.10 and have this set up in a Dev Environment so can try a few things if required to debug....

    1. Apr 13, 2009

      Jeroen Benckhuijsen says:

      Hi Jeremy, If you're runnign from a dev-environemnt, it might be the case that ...

      Hi Jeremy,

      If you're runnign from a dev-environemnt, it might be the case that the code is using{newcode} as the macro key instead of {code}. I've implemented this behaviour to be able to use the old code macro and this macro together for testing purposes. Could you check using this other macro key?

      1. Apr 14, 2009

        Jeremy Thake says:

        Yep window.SyntaxHighlighter.config.clipboardSwf = '/s/1724/13/2/_/download/r...

        Yep

        
        
        worked fine, but
        
        

        just doesn't work if I disabled out of the box one.

        How else can I go through my site and do a global replace on these tags?

        Also it does'nt appear in Notation Guide...is there a way to get this to be added?

        1. Apr 14, 2009

          Jeroen Benckhuijsen says:

          Well, the original version you can download from here should be using {code} ins...

          Well, the original version you can download from here should be using {code} instead of {newcode}. If that's not the case, then that's a bug by the way.

          As for the notation guide: I expect that Atlassian determines the Notation Guide based on the default bundled plugins, which Newcode is not currently. Not sure if there is a way to add to it. Could you file a JIRA bug for this?

          1. Apr 14, 2009

            Jeremy Thake says:

            I'm goign to use JQuery to add the content, but adding a script to my space admi...

            I'm goign to use JQuery to add the content, but adding a script to my space admin layouts to check whether that content exists and tweak it slightly. Can see a .vm file in confluence folder, but don't really want to muck with that stuff...

        2. Apr 23, 2009

          Michael Milo says:

          Is there a quick fix for this?  We want to start using this plugin, but lik...

          Is there a quick fix for this?  We want to start using this plugin, but like others, we do not want to have to edit all of the pages that already contain the "code" macro.  Is it possible that if i rebuild this code myself it will work? I am not sure if you built it using debug properties.

          Great plugin though.  When we tested using the "newcode" macro our pages looked very nice.  Much better than the original atlassian macro.

          1. Apr 24, 2009

            Jeroen Benckhuijsen says:

            The quick fix is to edit the atlassian-plugin.xml in the jar-file. There is a &l...

            The quick fix is to edit the atlassian-plugin.xml in the jar-file. There is a <macro> tag in there. Change the "key" attribute from newcode to code and all should work fine.

            If you've got any other feedback about the plugin, just let me know

          2. Apr 25, 2009

            Jeroen Benckhuijsen says:

            Michael, Version 1.9.1 has been release which should fix this issue

            Michael,

            Version 1.9.1 has been release which should fix this issue

      2. Apr 14, 2009

        Fred Bunting says:

        This turned out to be my problem too (it installed using the {newcode} name, not...

        This turned out to be my problem too (it installed using the {newcode} name, not {{{code}
        }} ... testing under {newcode} works great.

        I don't want to do a global replace ... I would like the macro to continue to be called {{{code}
        }} ... which appears to be your intent.

  23. Apr 14, 2009

    Thom Pantazi says:

    Nice replacement for the code macro, but like others have noted it has it's bugs...

    Nice replacement for the code macro, but like others have noted it has it's bugs. Firstline doesn't work and since it doesn't I would suggest removing it as a viable parameter until it is fixed. I wasted 1/2 an hour trying to see what was wrong with my code before Is aw that there is a known bug.

    Also, I wonder why one of the languages isn't wiki/textile/velocity. Seems ironic that the native languages are omitted.

    As someone else observed the notation guide doe not have this macro at least in 2.10.

    One final note, I noticed that the controls tend to obscure the text underneath them rather then rendering a wider box to allow for both the code and the controls.

    1. Apr 15, 2009

      Jeroen Benckhuijsen says:

      Thanks for the feedback Thom. First, about the firstline bug: it's resolved in S...

      Thanks for the feedback Thom. First, about the firstline bug: it's resolved in SVN and will be included in the next release

      About the issues you mention, could you file Jira bugs for them. To go into specifics:

      • About the languages, true... Primary reason is that I'm using a third-party library which doesn't support these languages. I'll try to look into that.
      • Notation guide: looking into that, though it won't make it for the 1.9.1 release.
  24. Apr 25, 2009

    Jeremy Thake says:

    I tried installing 1.9.1, but I get an error: Error: There was a problem loadin...

    I tried installing 1.9.1, but I get an error:

    Error: There was a problem loading the descriptor for module 'code' in plugin 'New Code Macro Plugin'. Error retrieving dependency of class: com.atlassian.confluence.ext.code.NewCodeMacro. Missing class: org/lobobrowser/html/parser/InputSourceImpl

    I have disabled the Code plug-in...gone back to 1.9.0 for now.

    1. Apr 28, 2009

      Jeroen Benckhuijsen says:

      Hmm, very strange, it runs perfectly in the integration test, which should be a ...

      Hmm, very strange, it runs perfectly in the integration test, which should be a regulare confluence installation. I'll try to get a fix out asap, though I might need some help with testing it as I don't have a install of confluence running.

    2. Apr 28, 2009

      Ben van Zanten says:

      I had no problem installing this release, went without a problem. Ben

      I had no problem installing this release, went without a problem.
      Ben

    3. Apr 28, 2009

      Jeroen Benckhuijsen says:

      Jeremy, I've created NCODE-15 for this issue. Could you update it with the info...

      Jeremy,

      I've created NCODE-15 for this issue. Could you update it with the information about your environenment and such. I'll create some updated versions as prereleases which I'll attach to the bug. If you could test them and report and issues, that would be great.

      Ben, as you don't have any issues, could you add your environment as well so I can compare versions in which this problem arrises, tnx

  25. May 05, 2009

    J. Russell Noseworthy says:

    I see that you are planning on fixing the PDF export bug in 1.9.2. Do you have ...

    I see that you are planning on fixing the PDF export bug in 1.9.2. Do you have an estimate when that will be released? We really can't use this shiny new plugin until it works with PDF.

    1. May 05, 2009

      Jeroen Benckhuijsen says:

      I hope quite soon, the initial implementation is ready and tested. The current p...

      I hope quite soon, the initial implementation is ready and tested. The current problem is that the outputted HTML is not converted correctly to PDF, which unfortunately is not in my control. I'm in contact with the guys at Atlassian who work on the export module about this.

    2. May 19, 2009

      Jeroen Benckhuijsen says:

      Version 1.9.2. has been released, including export support. The code is quite ne...

      Version 1.9.2. has been released, including export support. The code is quite new off course, so I'm looking forward to people testing it.

  26. May 07, 2009

    Oliver Hüppe says:

    Hi, i like this Macro but when using the {code} makro the old highligther for ...

    Hi,

    i like this Macro but when using the {code}
    makro the old highligther for "none" does not work anymore. So I tried to add a new language us descripted above, actually I used a copy of plain and modified it, to bring back the none-brush. Still same problem when I open up a page with {code:none} the brush "none" is missing. How can I fix this?
    Oliver

    1. May 19, 2009

      Jeroen Benckhuijsen says:

      Oliver, This has been fixed in the latest release of the plugin, 1.9.2. The pro...

      Oliver,

      This has been fixed in the latest release of the plugin, 1.9.2. The problem itself has been recorded as NCODE-16 in Jira, some in case something is still wrong, please reopen the bug and state the problem there.

  27. May 22, 2009

    Stéphane Bourque says:

    We have a problem with the xml brush file. A bug has been opened at the bug trac...

    We have a problem with the xml brush file. A bug has been opened at the bug tracking tool of the SyntaxHighlighter web site.

    The problem is that semicolon are appearing within the closing element tag when a URL is the element content.

    For instance, using the code macro with the xml brush for the following:

    <some_element>http://my.website.com/</some_element>

    would produce:

    <some_element>http://my.website.com/<;/some_element>

    Notice the semicolon in the closing some_element tag. If you put a space between the content and the closing tag, the semicolon does not appear. If you use one / in the URL instead of two, no problem either. Since using URL is pretty common within XML, this problem is causing us some trouble. We are using version 1.9.2. which otherwise is a great replacement for the default code macro from Atlassian. Great job!

    Thanks

    Stephane

    1. May 22, 2009

      Jeroen Benckhuijsen says:

      Hi Stephane, I'm using the SyntaxHighlighter mainly as a black-box library, so ...

      Hi Stephane,

      I'm using the SyntaxHighlighter mainly as a black-box library, so I'm not really into bugs into the library itself. This plugin will off course keep track of any new versions of the library, so when this bug is solved you can expect it to be included in a new release. You might want to open a Jira issue here so we can use it to track any changes and to discuss when it will be included in a new release of the plugin.

      If you've got a fix in the form of a patch, that can off course be included.

  28. Aug 04, 2009

    sensui says:

    Hi, i found the "Adding New Languages" section has been removed from this page, ...

    Hi, i found the "Adding New Languages" section has been removed from this page, then how can user add new code language option since V1.9.2 seems defaultly do not support C, VB.net, etc?

    1. Aug 05, 2009

      Jeroen Benckhuijsen says:

      Hi Sensui, The description how to develop a new brush for the highlighter has b...

      Hi Sensui,

      The description how to develop a new brush for the highlighter has been moved to the Development page as it currently requires a new packaging of the plugin and thus quite some development knowledge. The situation is about to improve with the upcoming 1.9.3 release with unfortunately a bit more complex description than the current situation. This is unfortunately caused by limitations in the Confluence API which I'm working out with Atlassian.

      A bug has been filed to be able to upload new brushes, however this will require quite some work to get up-and-running.

      By the way: VB.net and C++ are supported by the plugin, so I expect C support to work.

      1. Aug 10

        sensui says:

        Thank you for your reply. Yes I find it works in wiki markup mode, and are there...

        Thank you for your reply.
        Yes I find it works in wiki markup mode, and are there some ways to add options of code macro's language list in Marco browser?

        1. Aug 11

          Jeroen Benckhuijsen says:

          This is planned (and implemented already) for the 1.9.3 release. It will probabl...

          This is planned (and implemented already) for the 1.9.3 release. It will probably be released in a week or two

  29. Aug 27

    Stephan Vollmer says:

    Hi! I just tried version 1.9.3 and it looks very promising! But there i...

    Hi! I just tried version 1.9.3 and it looks very promising!

    But there is one issue that should be improved:

    • I have a code snippet with line numbers turned off
    • The code is copied & pasted from the confluence page.
    • The pasted code now contains line numbers in front of every line. Therefore it is not possible to simply copy code examples from the Confluence page into your favourite editor.
    • A workaround is to enable the controls, click on "View Source" and then copy the code, but this is very counterintuitive and simply too much work.

    In summary: The copied code should not contain the line numbers.

    1. Aug 27

      Jeroen Benckhuijsen says:

      Hi Stephan, Thanks for the feedback and for testing 1.9.3! About your featu...

      Hi Stephan,

      Thanks for the feedback and for testing 1.9.3! About your feature request, I understand your need and preference to leave out the line numbers when copying. Problem, however, is that copying is completely handled by the browserand therefore not something I can alter. However, you don't need to use "View source", beside this button there is a "Copy to clipboard" button which does directly what you want.

      Cheers

      1. Aug 28

        Stephan Vollmer says:

        Hi Jeroen, I don't see the "Copy to clipboard" button. When I enable the contro...

        Hi Jeroen,

        I don't see the "Copy to clipboard" button. When I enable the controls, there are only 3 buttons: View source, Print and Help.

        I tried it with Firefox 3.5, Opera 10 and IE 6.

        Cheers

        1. Sep 01

          caviler says:

          I think problem is in shCore.js window.SyntaxHighlighter.config.clipboardSwf...

          I think problem is in shCore.js

          createDisplayLines : function(code)
          
          {
          
          .....
          
          			code +=
          				'<div class="' + lineClass + '">'
          					+ '<code class="number">' + lineNumber + '.</code>'
          					+ '<span class="content">'
          						+ (spaces != null ? '<code class="spaces">' + spaces.replace(/\s/g, '&nbsp;') + '</code>' : '')
          						+ '<span class="block" style="margin-left: ' + indent + 'px !important;">' + line + '</span>'
          					+ '</span>'
          				+ '</div>'
          			;
          
          .....
          
          }
          
          

          just simply delete or modify the code:

             + '<code class="number">' + lineNumber + '.</code>'
          
          
        2. Sep 01

          Jeroen Benckhuijsen says:

          I just checked and you are correct, the clipboard is currently disabled. I've fi...

          I just checked and you are correct, the clipboard is currently disabled. I've filed a bug for (http://developer.atlassian.com/jira/browse/NCODE-43), which will be fixed in 1.9.4.

          1. Sep 03

            Jeremy Thake says:

            ok, so while we're on this...is there a way we can globally set either way wheth...

            ok, so while we're on this...is there a way we can globally set either way whether certain things show e.g. line numbers, copy to clipboard (which seems to pop up another window) etc.?
            Also,what is really bad is if you click and drag and copy directly from the rendered source and paste you get line numbers regardless of whether they are showing or not. This is not good when you want to grab code snippets to paste straight into visual studio.

            1. Sep 07

              Jeroen Benckhuijsen says:

              Jeremy, About the global options: Implementing a UI for this and handling this ...

              Jeremy,

              About the global options: Implementing a UI for this and handling this in the code is faily easy. However, one would want these settings to be reflected in the macro browser in Confluence 3.0+. Problem is: there is currently no way to alter the definition which is used by the browser.

              To keep track of this, could you file Jira issues for this and the copy/paste issue? For the first one I'll contact the atlassian guys and see what can be done. Can't promise anything off course....

              1. Sep 10

                Don Willis says:

                Filed: http://developer.atlassian.com/jira/browse/NCODE-46
  30. Sep 10

    Nick Rossow says:

    The version 1.9.3 on confluence 3.01 is not recognising the shell / bash option ...

    The version 1.9.3 on confluence 3.01 is not recognising the shell / bash option for formatting.

    Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml

    I have just upgraded my dev environment from 2.10 where everything worked fine in 1.91. So not 100% sure where the problem lies.

    cheers

    Nick

    1. Sep 10

      Nick Rossow says:

      nevermind me... i still had the old code macro enabled.. :S

      nevermind me...

      i still had the old code macro enabled.. :S

  31. Sep 23

    Shrike says:

    I've been using v.1.9.2. Alias "c#" for C# language worked fine. Now I installed...

    I've been using v.1.9.2. Alias "c#" for C# language worked fine. Now I installed 1.9.4. And alias "c#" doesn't work any more! Only "csharp". Why did you change alias for c#???
    The same thing with 1.9.3 - "c#" is unknown lang alias.

    It's not good idea to introduce such breaking change. I have got tons of code samples with "c#" alias. Now I just can't move to new version.

    1. Sep 23

      Jeroen Benckhuijsen says:

      Shrike, The way, the c# is not officialy in the usage guidelines. The 1.9.3 rele...

      Shrike, The way, the c# is not officialy in the usage guidelines. The 1.9.3 release introduced a more strict checking of the parameter values which causes this behaviour. The alias indeed worked for 1.9.2, however this is just coincidence. This will be fixed in the 1.9.5 release.

      1. Sep 24

        Shrike says:

        looking forward, "c#" is much more handy than "csharp"

        looking forward, "c#" is much more handy than "csharp"

  32. Sep 25

    Shrike says:

    During export a page to Word I get numerous exceptions in Tomcat console and wha...

    During export a page to Word I get numerous exceptions in Tomcat console and what's the worst thing - message boxes on server like "Can't find brush 'java'".
    version 1.9.2

  33. Sep 25

    Shrike says:

    One more question about export - is it possible to export (to Word) code snippes...

    One more question about export - is it possible to export (to Word) code snippes as text not as images?

    1. Sep 25

      Jeroen Benckhuijsen says:

      Shrike, About the exceptions; this is already solved in 1.9.4. Word export as a...

      Shrike,

      About the exceptions; this is already solved in 1.9.4. Word export as a code snippet is only possible in Confluence 3.0 or higher. This is due to a limitation in Confluence, although it doesn't work great always (see the exportImage parameter).

  34. Sep 29

    Matt Hodges [Atlassian] says:

    Looks great, Jeroen. Would be awesome if it supported wiki markup. For example, ...

    Looks great, Jeroen. Would be awesome if it supported wiki markup. For example, highlighting macros in another colour.

    1. Sep 30

      Jeroen Benckhuijsen says:

      Thanks Matt, there is already a bug filed for this in Jira (NCODE-14 from the to...

      Thanks Matt, there is already a bug filed for this in Jira (NCODE-14 from the top of my head), however I'm already quite busy ironing out the last issues to get a final release version done. Implementing new features like this is a quite a bit lower on my priority list. I'd be more than happy to accept any patches which implement this. The actual definition isn't that hard, it's just a bit of JavaScript combined with regular expressions.

  35. Oct 20

    Neil Arrowsmith says:

    I'm trying out version 1.9.5 and the "c" option for the lang parameter doesn't s...

    I'm trying out version 1.9.5 and the "c" option for the lang parameter doesn't seem to be working. "cpp" does work but is a bit counter-intuitive for us.

    1. Oct 20

      Jeroen Benckhuijsen says:

      Neil, this is indeed an error in the configuration of the plugin. It is fixed in...

      Neil, this is indeed an error in the configuration of the plugin. It is fixed in SVN, though if you don't want to wait for the next release (which will take some time), you may want to release the file "languages.xml" in the plugin jar using the one from SVN which can be downloaded from here: http://svn.atlassian.com/fisheye/browse/public/contrib/confluence/newcode-macro-plugin/trunk/src/main/resources

  36. Oct 21

    Rolf Steinecke says:

    Description and comments look great - but when I try to install 1.9.5 I get an e...

    Description and comments look great - but when I try to install 1.9.5 I get an error message.

    What ist wrong? Can you give me a hint?

    Rolf

    A system error has occurred — our apologies!

    Please ask your Confluence administrator to create a support issue on Atlassian's support system at http://support.atlassian.com with the following information:

    a description of your problem and what you were doing at the time it occurred
    a copy of the error and system information found below
    a copy of the application logs (if possible).
    Your Confluence administrator can use the support request form to create a support ticket which will include this information.

    We will respond as promptly as possible.
    Thank you!

    Return to site homepage…

    Cause
    java.lang.RuntimeException: There was a problem evicting or flushing a PluginData object
    at com.atlassian.confluence.plugin.persistence.hibernate.HibernatePluginDataDao.saveOrUpdate(HibernatePluginDataDao.java:65)

    caused by: net.sf.hibernate.exception.GenericJDBCException: could not insert: [com.atlassian.confluence.plugin.persistence.PluginData#1409035]
    at net.sf.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:90)

    caused by: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1808905 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.
    at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3245)

    Stack Trace:[hide]

    java.lang.RuntimeException: There was a problem evicting or flushing a PluginData object
    at com.atlassian.confluence.plugin.persistence.hibernate.HibernatePluginDataDao.saveOrUpdate(HibernatePluginDataDao.java:65)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Delegati....

    1. Oct 21

      Jeroen Benckhuijsen says:

      Hi Rolf, No idea what's causing this. Given the logs it seems to be a database c...

      Hi Rolf, No idea what's causing this. Given the logs it seems to be a database configuration issue. However this is not something which is caused by the macro, so I guess you'll have to take this up with Atlassian Support.

    2. Oct 21

      Tim Eddelbuettel says:

      caused by: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (...

      caused by: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1808905 > 1048576).

      You must change the max. packet size in your mysql administrator.

      Error loading plugins or saving content larger than 1Mb
      Known Issues for MySQL

      Regards

      1. Oct 21

        Rolf Steinecke says:

        Thank you Tim. I increased max packet size to 3M and I could install the macro n...

        Thank you Tim. I increased max packet size to 3M and I could install the macro now.

  37. Nov 11

    Jens Melgaard says:

    Im getting the following when trying to install this in Version 1.9.5... We hav...

    Im getting the following when trying to install this in Version 1.9.5...

    We have tried version 1.9.2 and that works, so we will continue with an older version, but thought I would mention it.

    We are rather new to Confluence, and are still only on a Demo licence if that matters.
    Version of Confluence is 3.0.2 and we use an SQL Server 2005 Express database.

    2009-11-11 16:28:03,666 INFO [http-8080-2] [admin.actions.plugins.ManagePluginsAction] logPluginAction User 'admin' uninstall plugin key: com.atlassian.confluence.ext.newcode-macro-plugin
    2009-11-11 16:28:15,307 INFO [http-8080-2] [osgi.extender.support.DefaultOsgiApplicationContextCreator] createApplicationContext Discovered configurations

    Unknown macro: {osgibundle}

    in bundle [newcode-macro-plugin (com.atlassian.confluence.ext.newcode-macro-plugin)]
    2009-11-11 16:28:15,464 INFO [SpringOsgiExtenderThread-13] [osgi.context.support.OsgiBundleXmlApplicationContext] prepareRefresh Refreshing org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@2df62df6: display name []; startup date []; root of context hierarchy
    2009-11-11 16:28:15,464 INFO [SpringOsgiExtenderThread-13] [beans.factory.xml.XmlBeanDefinitionReader] loadBeanDefinitions Loading XML bean definitions from URL bundle://17.0:0/META-INF/spring/newcode-context.xml
    2009-11-11 16:28:15,479 INFO [SpringOsgiExtenderThread-13] [beans.factory.xml.XmlBeanDefinitionReader] loadBeanDefinitions Loading XML bean definitions from URL bundle://17.0:0/META-INF/spring/atlassian-plugins-host-components.xml
    2009-11-11 16:28:15,479 INFO [SpringOsgiExtenderThread-13] [osgi.context.support.OsgiBundleXmlApplicationContext] obtainFreshBeanFactory Bean factory for application context []: org.springframework.beans.factory.support.DefaultListableBeanFactory@132e132e
    2009-11-11 16:28:15,479 INFO [SpringOsgiExtenderThread-13] [internal.dependencies.startup.DependencyWaiterApplicationContextExecutor] stageOne No outstanding OSGi service dependencies, completing initialization for OsgiBundleXmlApplicationContext(bundle=com.atlassian.confluence.ext.newcode-macro-plugin, config=osgibundle:/META-INF/spring/*.xml)
    2009-11-11 16:28:15,495 INFO [SpringOsgiExtenderThread-14] [beans.factory.support.DefaultListableBeanFactory] preInstantiateSingletons Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@132e132e: defining beans []; root of factory hierarchy
    2009-11-11 16:28:15,667 INFO [SpringOsgiExtenderThread-14] [beans.factory.support.DefaultListableBeanFactory] destroySingletons Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@132e132e: defining beans []; root of factory hierarchy
    2009-11-11 16:28:15,667 ERROR [SpringOsgiExtenderThread-14] [osgi.context.support.OsgiBundleXmlApplicationContext] completeRefresh Post refresh error
    – url: /admin/uploadplugin.action | userName: admin | referer: http://localhost:8080/admin/uninstallplugin.action?pluginKey=com.atlassian.confluence.ext.newcode-macro-plugin&atl_token=U2n8a5IYP5 | action: uploadplugin
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'contentFormatter' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Unsatisfied dependency expressed through bean property 'exportFacade': : Error creating bean with name 'exportFacade' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Unsatisfied dependency expressed through bean property 'languageRegistry': : Error creating bean with name 'languageRegistry' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl]: Constructor threw exception; nested exception is com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    --- Debugging information ---
    required-type : com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage
    class : java.util.List
    cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
    path : /list/builtin-language
    cause-message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    line number : 3
    message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    -------------------------------; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'languageRegistry' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl]: Constructor threw exception; nested exception is com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    --- Debugging information ---
    required-type : com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage
    class : java.util.List
    cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
    path : /list/builtin-language
    cause-message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    line number : 3
    message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    -------------------------------; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'exportFacade' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Unsatisfied dependency expressed through bean property 'languageRegistry': : Error creating bean with name 'languageRegistry' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl]: Constructor threw exception; nested exception is com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    --- Debugging information ---
    required-type : com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage
    class : java.util.List
    cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
    path : /list/builtin-language
    cause-message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    line number : 3
    message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    -------------------------------; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'languageRegistry' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl]: Constructor threw exception; nested exception is com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    --- Debugging information ---
    required-type : com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage
    class : java.util.List
    cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
    path : /list/builtin-language
    cause-message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    line number : 3
    message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    -------------------------------
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1091)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:982)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(AccessController.java:215)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:288)
    at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:145)
    at java.lang.Thread.run(Thread.java:801)
    Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'exportFacade' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Unsatisfied dependency expressed through bean property 'languageRegistry': : Error creating bean with name 'languageRegistry' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl]: Constructor threw exception; nested exception is com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    --- Debugging information ---
    required-type : com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage
    class : java.util.List
    cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
    path : /list/builtin-language
    cause-message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    line number : 3
    message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    -------------------------------; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'languageRegistry' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl]: Constructor threw exception; nested exception is com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    --- Debugging information ---
    required-type : com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage
    class : java.util.List
    cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
    path : /list/builtin-language
    cause-message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    line number : 3
    message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    -------------------------------
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1091)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:982)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(AccessController.java:215)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:671)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:610)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1076)
    ... 15 more
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'languageRegistry' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl]: Constructor threw exception; nested exception is com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    --- Debugging information ---
    required-type : com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage
    class : java.util.List
    cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
    path : /list/builtin-language
    cause-message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    line number : 3
    message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    -------------------------------
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(AccessController.java:215)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:671)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:610)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1076)
    ... 28 more
    Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl]: Constructor threw exception; nested exception is com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    --- Debugging information ---
    required-type : com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage
    class : java.util.List
    cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
    path : /list/builtin-language
    cause-message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    line number : 3
    message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    -------------------------------
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
    ... 41 more
    Caused by: com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    --- Debugging information ---
    required-type : com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage
    class : java.util.List
    cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
    path : /list/builtin-language
    cause-message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    line number : 3
    message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    -------------------------------
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:45)
    at com.thoughtworks.xstream.core.ReferenceByXPathUnmarshaller.convertAnother(ReferenceByXPathUnmarshaller.java:39)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:82)
    at com.thoughtworks.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:60)
    at com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:53)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:38)
    at com.thoughtworks.xstream.core.ReferenceByXPathUnmarshaller.convertAnother(ReferenceByXPathUnmarshaller.java:39)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:99)
    at com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy.unmarshal(ReferenceByXPathMarshallingStrategy.java:12)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:549)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:537)
    at com.thoughtworks.xstream.XStream.fromXML(XStream.java:505)
    at com.atlassian.confluence.ext.code.languages.impl.LanguageParser.readXML(LanguageParser.java:70)
    at com.atlassian.confluence.ext.code.languages.impl.LanguageParser.parseLanguages(LanguageParser.java:48)
    at com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl.<init>(LanguageRegistryImpl.java:64)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:521)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
    ... 43 more
    Caused by: com.thoughtworks.xstream.converters.reflection.ObjectAccessException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.newInstance(PureJavaReflectionProvider.java:50)
    at com.thoughtworks.xstream.converters.reflection.ReflectionConverter.instantiateNewInstance(ReflectionConverter.java:145)
    at com.thoughtworks.xstream.converters.reflection.ReflectionConverter.unmarshal(ReflectionConverter.java:87)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:38)
    ... 62 more
    2009-11-11 16:28:15,667 ERROR [SpringOsgiExtenderThread-14] [plugin.osgi.factory.OsgiPlugin] onSpringContextFailed Unable to start the Spring context for plugin com.atlassian.confluence.ext.newcode-macro-plugin
    – url: /admin/uploadplugin.action | userName: admin | referer: http://localhost:8080/admin/uninstallplugin.action?pluginKey=com.atlassian.confluence.ext.newcode-macro-plugin&atl_token=U2n8a5IYP5 | action: uploadplugin
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'contentFormatter' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Unsatisfied dependency expressed through bean property 'exportFacade': : Error creating bean with name 'exportFacade' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Unsatisfied dependency expressed through bean property 'languageRegistry': : Error creating bean with name 'languageRegistry' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl]: Constructor threw exception; nested exception is com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    --- Debugging information ---
    required-type : com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage
    class : java.util.List
    cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
    path : /list/builtin-language
    cause-message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    line number : 3
    message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    -------------------------------; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'languageRegistry' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl]: Constructor threw exception; nested exception is com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    --- Debugging information ---
    required-type : com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage
    class : java.util.List
    cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
    path : /list/builtin-language
    cause-message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    line number : 3
    message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    -------------------------------; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'exportFacade' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Unsatisfied dependency expressed through bean property 'languageRegistry': : Error creating bean with name 'languageRegistry' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl]: Constructor threw exception; nested exception is com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    --- Debugging information ---
    required-type : com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage
    class : java.util.List
    cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
    path : /list/builtin-language
    cause-message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    line number : 3
    message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    -------------------------------; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'languageRegistry' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl]: Constructor threw exception; nested exception is com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    --- Debugging information ---
    required-type : com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage
    class : java.util.List
    cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
    path : /list/builtin-language
    cause-message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    line number : 3
    message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    -------------------------------
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1091)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:982)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(AccessController.java:215)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:288)
    at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:145)
    at java.lang.Thread.run(Thread.java:801)
    Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'exportFacade' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Unsatisfied dependency expressed through bean property 'languageRegistry': : Error creating bean with name 'languageRegistry' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl]: Constructor threw exception; nested exception is com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    --- Debugging information ---
    required-type : com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage
    class : java.util.List
    cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
    path : /list/builtin-language
    cause-message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    line number : 3
    message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    -------------------------------; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'languageRegistry' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl]: Constructor threw exception; nested exception is com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    --- Debugging information ---
    required-type : com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage
    class : java.util.List
    cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
    path : /list/builtin-language
    cause-message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    line number : 3
    message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    -------------------------------
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1091)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:982)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(AccessController.java:215)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:671)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:610)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1076)
    ... 15 more
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'languageRegistry' defined in URL bundle://17.0:0/META-INF/spring/newcode-context.xml: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl]: Constructor threw exception; nested exception is com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    --- Debugging information ---
    required-type : com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage
    class : java.util.List
    cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
    path : /list/builtin-language
    cause-message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    line number : 3
    message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    -------------------------------
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(AccessController.java:215)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:671)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:610)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1076)
    ... 28 more
    Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl]: Constructor threw exception; nested exception is com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    --- Debugging information ---
    required-type : com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage
    class : java.util.List
    cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
    path : /list/builtin-language
    cause-message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    line number : 3
    message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    -------------------------------
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
    ... 41 more
    Caused by: com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    --- Debugging information ---
    required-type : com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage
    class : java.util.List
    cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
    path : /list/builtin-language
    cause-message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    line number : 3
    message : Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    -------------------------------
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:45)
    at com.thoughtworks.xstream.core.ReferenceByXPathUnmarshaller.convertAnother(ReferenceByXPathUnmarshaller.java:39)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:82)
    at com.thoughtworks.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:60)
    at com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:53)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:38)
    at com.thoughtworks.xstream.core.ReferenceByXPathUnmarshaller.convertAnother(ReferenceByXPathUnmarshaller.java:39)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:99)
    at com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy.unmarshal(ReferenceByXPathMarshallingStrategy.java:12)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:549)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:537)
    at com.thoughtworks.xstream.XStream.fromXML(XStream.java:505)
    at com.atlassian.confluence.ext.code.languages.impl.LanguageParser.readXML(LanguageParser.java:70)
    at com.atlassian.confluence.ext.code.languages.impl.LanguageParser.parseLanguages(LanguageParser.java:48)
    at com.atlassian.confluence.ext.code.languages.impl.LanguageRegistryImpl.<init>(LanguageRegistryImpl.java:64)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:521)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
    ... 43 more
    Caused by: com.thoughtworks.xstream.converters.reflection.ObjectAccessException: Cannot construct com.atlassian.confluence.ext.code.languages.impl.BuiltinLanguage as it does not have a no-args constructor
    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.newInstance(PureJavaReflectionProvider.java:50)
    at com.thoughtworks.xstream.converters.reflection.ReflectionConverter.instantiateNewInstance(ReflectionConverter.java:145)
    at com.thoughtworks.xstream.converters.reflection.ReflectionConverter.unmarshal(ReflectionConverter.java:87)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:38)
    ... 62 more
    2009-11-11 16:28:16,464 INFO [http-8080-2] [admin.actions.plugins.UploadPluginAction] execute User 'admin' uploaded a new plugin: com.atlassian.confluence.ext.newcode-macro-plugin

    1. Nov 11

      Jeroen Benckhuijsen says:

      Jens, Could you file a JIRA issue for this and remove this comment? It really ta...

      Jens, Could you file a JIRA issue for this and remove this comment? It really takes a lot of screen real-estate and JIRA bugs allow a much better way to discuss these issues. Also, could you add the logging info as an attachment to the JIRA issue, this really eases handling of these issues and fitlering to the actual info. Thanks

  38. Nov 19

    Nic Brough says:

    With 1.9.5 and Confluence 2.10, the pdf export gives us a box rendered like a wi...

    With 1.9.5 and Confluence 2.10, the pdf export gives us a box rendered like a window - a box with scrollbars etc. Is there a way to stop it doing this? The text is all there, which is great, but the boxes look really bad in PDF.

    1. Nov 23

      Jeroen Benckhuijsen says:

      Nic, please file a Jira issue for this with attached screenshot and example case...

      Nic, please file a Jira issue for this with attached screenshot and example case, thanks

      1. Nov 23

        Nic Brough says:

        Thanks Jeroen, https://developer.atlassian.com/jira/browse/NCODE-66 I wanted to...

        Thanks Jeroen, https://developer.atlassian.com/jira/browse/NCODE-66 I wanted to ask before raising a more formal request, in case I'd missed something.

  39. Dec 03

    Pavel Derendyaev says:

    Hi. Whether this macro can be exported to HTML?

    Hi. Whether this macro can be exported to HTML?

    1. Dec 10

      Jeroen Benckhuijsen says:

      I don't get your question. Exporting is not a feature of a plugin, but of Conflu...

      I don't get your question. Exporting is not a feature of a plugin, but of Confluence itself, Besides, Confluence is a web-app showing HTML, so what do you mean by exporting?

      1. Dec 11

        Pavel Derendyaev says:

        OK, I'll try to be more specific. I have a test page: some text {code:bash} #...

        OK, I'll try to be more specific.

        I have a test page:

        some text
        
        {code:bash}
        # mksnap_ffs /var /var/snapshot/snap — create snapshot of /var
        # mdconfig -a -t vnode -f /var/snapshot/snap -u 4 — create memory disk
        {code}
        
        some text
        

        It's look like it supposed to be.

        Then I go to Browse -> Advanced -> HTML Export to perform export.
        The resulting HTML file is displayed without "code" section as you can see from this screenshot.

        Exported HTML source:

        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
        <html>
        <head>
        <title>Заметки : Backup using snapshots</title>
        <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
        </head>
        
        <body>
        <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
        
        <tr>
        <td valign="top" class="pagebody">
        <div class="pageheader">
        <span class="pagetitle">
        Notes : Backup using snapshots
        </span>
        </div>
        <div class="pagesubheading">
        This page last changed on Dec 11, 2009 by <font color="#0050B2">paul</font>.
        </div>
        
        <p>some text</p>
        
        <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
        <script type="syntaxhighlighter" class="toolbar: false; theme: default; brush: bash; gutter: false"><![CDATA[
        # mksnap_ffs /var /var/snapshot/snap — create snapshot of /var
        # mdconfig -a -t vnode -f /var/snapshot/snap -u 4 — create memory disk
        ]]></script>
        </div></div>
        
        <p>some text</p>
        
        
        </td>
        </tr>
        
        </table>
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
        <td height="12" background="http://docs.reic.ru/images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
        </tr>
        <tr>
        <td align="center"><font color="grey">Document generated by Confluence on Dec 11, 2009 10:57</font></td>
        </tr>
        
        </table>
        </body>
        </html>
        

        There is a <script> block as you can see:

        <script type="syntaxhighlighter" class="toolbar: false; theme: default; brush: bash; gutter: false"><![CDATA[
        # mksnap_ffs /var /var/snapshot/snap — create snapshot of /var
        # mdconfig -a -t vnode -f /var/snapshot/snap -u 4 — create memory disk
        ]]></script>
        

        But I can't see corresponding JS library for this script and it's look like so the browser does.

        Is it Confluence or New Code Macro issue?

        PS: Confluence 3.0.2, New Code Macro 1.9.5.