Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jspwiki-210-adapters/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.jspwiki</groupId>
<artifactId>jspwiki-builder</artifactId>
<version>2.12.3</version>
<version>2.12.4-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion jspwiki-210-test-adaptees/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.jspwiki</groupId>
<artifactId>jspwiki-builder</artifactId>
<version>2.12.3</version>
<version>2.12.4-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion jspwiki-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.jspwiki</groupId>
<artifactId>jspwiki-builder</artifactId>
<version>2.12.3</version>
<version>2.12.4-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion jspwiki-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.jspwiki</groupId>
<artifactId>jspwiki-builder</artifactId>
<version>2.12.3</version>
<version>2.12.4-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion jspwiki-bootstrap/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.jspwiki</groupId>
<artifactId>jspwiki-builder</artifactId>
<version>2.12.3</version>
<version>2.12.4-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion jspwiki-cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.jspwiki</groupId>
<artifactId>jspwiki-builder</artifactId>
<version>2.12.3</version>
<version>2.12.4-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion jspwiki-event/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.jspwiki</groupId>
<artifactId>jspwiki-builder</artifactId>
<version>2.12.3</version>
<version>2.12.4-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion jspwiki-http/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.jspwiki</groupId>
<artifactId>jspwiki-builder</artifactId>
<version>2.12.3</version>
<version>2.12.4-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion jspwiki-it-tests/jspwiki-it-test-cma-jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent> <!-- tests reuse [1/3]: reads common configuration for ITs and brings jspwiki-war as dependency -->
<groupId>org.apache.jspwiki.it</groupId>
<artifactId>jspwiki-it-builder</artifactId>
<version>2.12.3</version>
<version>2.12.4-SNAPSHOT</version>
</parent>

<!-- Container Managed Authentication using JDBC instead of XML files for user and group info -->
Expand Down
2 changes: 1 addition & 1 deletion jspwiki-it-tests/jspwiki-it-test-cma/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent> <!-- tests reuse [1/3]: reads common configuration for ITs and brings jspwiki-war as dependency -->
<groupId>org.apache.jspwiki.it</groupId>
<artifactId>jspwiki-it-builder</artifactId>
<version>2.12.3</version>
<version>2.12.4-SNAPSHOT</version>
</parent>

<!-- Container Managed Authentication -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent> <!-- tests reuse [1/3]: reads common configuration for ITs and brings jspwiki-war as dependency -->
<groupId>org.apache.jspwiki.it</groupId>
<artifactId>jspwiki-it-builder</artifactId>
<version>2.12.3</version>
<version>2.12.4-SNAPSHOT</version>
</parent>

<artifactId>jspwiki-it-test-custom-absolute-urls</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jspwiki-it-tests/jspwiki-it-test-custom-jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent> <!-- tests reuse [1/3]: reads common configuration for ITs and brings jspwiki-war as dependency -->
<groupId>org.apache.jspwiki.it</groupId>
<artifactId>jspwiki-it-builder</artifactId>
<version>2.12.3</version>
<version>2.12.4-SNAPSHOT</version>
</parent>

<artifactId>jspwiki-it-test-custom-jdbc</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jspwiki-it-tests/jspwiki-it-test-custom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent> <!-- tests reuse [1/3]: reads common configuration for ITs and brings jspwiki-war as dependency -->
<groupId>org.apache.jspwiki.it</groupId>
<artifactId>jspwiki-it-builder</artifactId>
<version>2.12.3</version>
<version>2.12.4-SNAPSHOT</version>
</parent>

<artifactId>jspwiki-it-test-custom</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jspwiki-it-tests/jspwiki-selenide-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.jspwiki.it</groupId>
<artifactId>jspwiki-it-builder</artifactId>
<version>2.12.3</version>
<version>2.12.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion jspwiki-it-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.jspwiki</groupId>
<artifactId>jspwiki-builder</artifactId>
<version>2.12.3</version>
<version>2.12.4-SNAPSHOT</version>
</parent>

<groupId>org.apache.jspwiki.it</groupId>
Expand Down
2 changes: 1 addition & 1 deletion jspwiki-kendra-searchprovider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.jspwiki</groupId>
<artifactId>jspwiki-builder</artifactId>
<version>2.12.3</version>
<version>2.12.4-SNAPSHOT</version>
</parent>

<artifactId>jspwiki-kendra-searchprovider</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jspwiki-main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.jspwiki</groupId>
<artifactId>jspwiki-builder</artifactId>
<version>2.12.3</version>
<version>2.12.4-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Licensed to the Apache Software Foundation (ASF) under one
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.ProgressListener;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.wiki.api.core.Attachment;
Expand Down Expand Up @@ -63,6 +62,8 @@ Licensed to the Apache Software Foundation (ASF) under one
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.ResourceBundle;
import org.apache.commons.fileupload.servlet.ServletFileUpload;


/**
Expand Down Expand Up @@ -257,12 +258,13 @@ public void doGet( final HttpServletRequest req, final HttpServletResponse res
res.sendError( HttpServletResponse.SC_NOT_FOUND, msg );
}
} catch( final ProviderException pe ) {
LOG.debug("Provider failed while reading", pe);
LOG.warn("Provider failed while reading", pe);
//
// This might fail, if the response is already committed. So in that
// case we just log it.
//
sendError( res, "Provider error: "+ pe.getMessage() );
final ResourceBundle rb = ResourceBundle.getBundle( InternationalizationManager.CORE_BUNDLE, req.getLocale() );
sendError( res, rb.getString("operation.failed") );
} catch( final NumberFormatException nfe ) {
LOG.warn( "Invalid version number: " + version );
res.sendError( HttpServletResponse.SC_BAD_REQUEST, "Invalid version number" );
Expand All @@ -279,7 +281,8 @@ public void doGet( final HttpServletRequest req, final HttpServletResponse res
// try to send an error and catch it quietly if it doesn't quite work.
//
LOG.debug( "I/O exception during download", ioe );
sendError( res, "Error: " + ioe.getMessage() );
final ResourceBundle rb = ResourceBundle.getBundle( InternationalizationManager.CORE_BUNDLE, req.getLocale() );
sendError( res, rb.getString("operation.failed") );
}
}

Expand Down Expand Up @@ -456,18 +459,18 @@ protected String upload( final HttpServletRequest req ) throws RedirectException
LOG.warn( msg + " (attachment: " + attName + ")", e );

throw new IOException( msg );
} catch( final IOException e ) {
} catch( final FileUploadException e ) {
// Show the submit page again, but with a bit more intimidating output.
msg = "Upload failure: " + e.getMessage();
LOG.warn( msg + " (attachment: " + attName + ")", e );

throw e;
} catch( final FileUploadException e ) {
throw new IOException( msg, e );
} catch( final IOException e ) {
// Show the submit page again, but with a bit more intimidating output.
msg = "Upload failure: " + e.getMessage();
LOG.warn( msg + " (attachment: " + attName + ")", e );

throw new IOException( msg, e );
throw e;
} finally {
m_engine.getManager( ProgressManager.class ).stopProgress( progressId );
// FIXME: In case of exceptions should absolutely remove the uploaded file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ public void setGroup( final Session session, final Group group ) throws WikiSecu

// We got an exception! Roll back...
catch( final WikiSecurityException e ) {
LOG.warn("setGroup failed, rolling back changes", e);
if( oldGroup != null ) {
// Restore previous version, re-throw...
fireEvent( WikiSecurityEvent.GROUP_REMOVE, group );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,9 @@ public String execute( final Context context, final String classname, final Map<
}

final ResourceBundle rb = Preferences.getBundle( context, Plugin.CORE_PLUGINS_RESOURCEBUNDLE );
final boolean debug = TextUtil.isPositive( params.get( PARAM_DEBUG ) );
//see JSPWIKI-75
final boolean debug = TextUtil.isPositive( params.get( PARAM_DEBUG ) ) && context.hasAdminPermissions();

try {
// Create...
final Plugin plugin = newWikiPlugin( classname, rb );
Expand All @@ -278,15 +280,17 @@ public String execute( final Context context, final String classname, final Map<
try {
return plugin.execute( context, params );
} catch( final PluginException e ) {
LOG.warn(e.getMessage(), e);
if( debug ) {
return stackTrace( params, e );
}

// Just pass this exception onward.
throw ( PluginException )e.fillInStackTrace();
} catch( final Throwable t ) {

// But all others get captured here.
LOG.info( "Plugin failed while executing:", t );
LOG.warn( "Plugin failed while executing:", t );
if( debug ) {
return stackTrace( params, t );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public final int doWikiStartTag() throws IOException {
}
} catch( final ProviderException e ) {
LOG.warn("Providers did not work: ",e);
pageContext.getOut().write("Error determining page size: "+e.getMessage());
pageContext.getOut().write("Error determining page size. More information is available in the system logs.");
}

return SKIP_BODY;
Expand Down
5 changes: 4 additions & 1 deletion jspwiki-main/src/main/java/org/apache/wiki/ui/Installer.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Licensed to the Apache Software Foundation (ASF) under one
import java.util.ResourceBundle;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.log4j.Logger;

/**
* Manages JSPWiki installation on behalf of <code>admin/Install.jsp</code>. The contents of this class were previously part of
Expand All @@ -54,6 +55,7 @@ Licensed to the Apache Software Foundation (ASF) under one
* @since 2.4.20
*/
public class Installer {
private static final Logger LOG = Logger.getLogger(Installer.class);

public static final String ADMIN_ID = "admin";
public static final String ADMIN_NAME = "Administrator";
Expand Down Expand Up @@ -203,7 +205,8 @@ public void saveProperties() {
}
m_session.addMessage( INSTALL_INFO, MessageFormat.format(rb.getString("install.installer.props.saved"), m_propertyFile) );
} catch( final IOException e ) {
final Object[] args = { e.getMessage(), m_props.toString() };
LOG.warn("save properties failed", e);
final Object[] args = { m_props.toString() };
m_session.addMessage( INSTALL_ERROR, MessageFormat.format( rb.getString( "install.installer.props.notsaved" ), args ) );
}
}
Expand Down
5 changes: 4 additions & 1 deletion jspwiki-main/src/main/resources/CoreResources.properties
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,15 @@ install.installer.unable.read.props=Unable to read properties: {0}
install.installer.default.appname=MyWiki
install.installer.default.pagedir=Please provide a directory for the pages!
install.installer.props.saved=Your new properties have been saved to {0}. Copy this file to a directory that is on the classpath of your container (tomcat lib directory for example), then restart your container. Scroll down a bit to see your new jspwiki-custom.properties.
install.installer.props.notsaved=Unable to write properties\: {0}. Please copy the file below as your jspwiki-custom.properties\:\n{1}
install.installer.props.notsaved=Unable to write properties, more information may be available in the system logs. Please manually copy this setting below into your jspwiki-custom.properties\:\n{0}
install.installer.validate.pagedir=You must define the location where the pages are stored.
install.installer.validate.appname=You must define the application name.
install.installer.validate.workdir=You must define a work directory.
install.installer.validate.logfile=You must define a log file.

#general purpose
operation.failed=The operation failed. Additional information may be in the system logs

# RSSImageLinkTag
rss.title=RSS feed for page {0}
rss.title.full=Aggregated RSS feed of the entire wiki
Expand Down
Loading