Hello,
I am looking for the best solution to import data from external datasource
(mysql), and using it to produce charts.
Any idea ? SQL Plugin looks obsolete :-(
Thanx for your help
--
- Nicolas Hernandez
a-n - aleph-networks
*manager*
http://www.aleph-networks.com
Hi,
At the outset - I admit to being a complete and total newbie at this.
Apologize for asking what are probably dumb questions - and likely to be
lots more than one. Any help people would be willing to give me would be
much appreciated.
I have been through all the tutorials, the API JavaDoc, and as many examples
of code as I could find, but I still can't seem to find anything that looks
directly applicable or works when I try to adapt it.
What I'm ultimately trying to do seems pretty straightforward. I would like
to have a set of pages which each contain structured data that can be
modified, added, or deleted one object at a time, and which display in
reverse chronological order. I would like each of those objects to be
displayed with specific HTML formatting. Eventually, I will also need to be
able to interact with those objects using the REST API. My current
understanding of the process I need to use to get started is this:
1) Create a new Class (We'll call it "Entry") with specific properties
2) Create the Class Sheet and Template. The Template includes a link to the
Class Sheet for displaying instances of the class.
3) Edit the Class Sheet to get the attached objects to display properly
4) Create a new page from the Template, add several instances of the class
to it - they should then display on the new page.
First two steps are easy - but the first place that I am hung up is figuring
out how to get the Class Sheet to display multiple objects of the same class
attached to the same page.
I have a page with 3 objects of the Entry class attached (with different
info in the properties). Ultimately the info and formatting will need to be
more complex, but I can't even get the basics to work - this is what I have
tried so far:
****START CODE****
#foreach($entry in $doc.getObjects("XWiki.EntryClass"))
#foreach($prop in $entry.properties)
: $doc.display($prop.getName())
#end
#end
****END CODE***
The problem is that this code displays the info for the first object three
times, instead of the unique properties for each class. The fact that it
displays three times seems to indicate that the loop is correctly going
through each object in the document - but it is obviously not incrementing
the properties to the next $entry. Sure it's a simple syntax error, but
don't know what it is.
I also can't tell from the JavaDoc enough about how to use .display() or the
properties of a vector to know how to do basic things like display the
number of objects or the name of each one. Can't figure out how to interact
with objects very well, basically.
Side question - Should I be using one object per page and then including
pages instead of having multiple objects on one page? I have worked my way
through the TOC demo, and it seems that each TOC entry is saved on a
separate page - and the livetable macro is then used on the "display" page
to populate the table with all the entries.
Thank you in advance,
Aaron
Hi,
I've created a page template that has some images on it (like different
logos according to the document). On the template, I've upload the image
and inserted it on wysiwyg option. I used, then, this page on my
template provider. When I create a new page from this template, the
image seems to be not copied from the template to the new page, and the
image is not loaded.
Any way to turn around on this? I'm using XE 3.1-M2.
Regards,
--
* *
* *
*Ramon Gomes Brandão*
*//*
I have just carefully upgraded a wiki from 2.6 to 3.1
At first glance It seemed to have gone fine, but I noticed velocity errors on the new-style Admin page (XWiki.XWikiPreferences):
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
...
Caused by: org.apache.velocity.runtime.parser.TemplateParseException: Encountered "\'checkbox\'" at xwiki:XWiki.AdminSheet[line 231, column 26]
Was expecting one of:
"," ...
")" ...
<WHITESPACE> ...
...
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
(full error message copied below)
The result is that none of the administration pages displays properly.
Has anyone an idea of what might be causing this problem?
Thanks for your help,
Tim
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Failed to execute the [velocity] macro
org.xwiki.rendering.macro.MacroExecutionException: Failed to evaluate Velocity Macro for content [## Constants:
#set($redirectParameter = 'xredirect')
#set($nameOfThisDocument = 'XWiki.ConfigurableClass')
#*
* If this document is saved with programming access or is includeForm'd into a document with programming, we have to
* drop programming rights in order for it to run safely because it evaluates potentially untrustworthy code.
*###
#macro(sandboxDocument)
#if($xcontext.hasProgrammingRights())
$xcontext.dropPermissions()##
#end
#end
#*
* Any documents which are on the provided list ($documentNames) which are locked by the current user will be unlocked.
* If this macro has programming rights, then they are unlocked programmatically, otherwise a javascript tag is
* generated with ajax calls to cancel for all of the documents. If there are documents on this list which are not
* locked by the current user, then they are ignored.
*
* @param $documentNames - List<String> - fullNames of documents which should be unlocked if they are locked by the
* current user.
*###
#macro(unlockDocuments $documentNames)
#if($documentNames.size() > 0)
#set($sql = "doc.fullName=")
#foreach($documentName in $documentNames)
#set($sql = "${sql}'$documentName' or doc.fullName=")
#end
## Trim the dangling ' or doc.fullName=?'
#set($sql = $sql.substring(0, $sql.lastIndexOf(' or doc.fullName=')))
#set($sql = ", XWikiLock lock where lock.docId=doc.id and lock.userName='$xcontext.getUser()' and (${sql})")
#set($namesOfdocumentsToUnlock = $xwiki.searchDocuments($sql))
## Use ajax and hope the user runs javascript.
{{html}}
<script type="text/javascript">
document.observe("dom:loaded", function() {
#foreach($nameOflockedDocument in $namesOfdocumentsToUnlock)
new Ajax.Request("$xwiki.getURL($nameOflockedDocument, 'cancel', 'ajax=1')");
#end
});
</script>
{{/html}}
#end## If output list size > 0
#end
#*
* Try to determine whether a document was edited by a user who has edit right on this page. This is tricky because
* documents are imported with the name XWiki.XWikiGuest who has no access to anything after import.
*
* @param theDoc - Document who's editor should be checked for edit access on this document.
*###
#macro(checkDocumentSavedByAuthorizedUser, $docToCheck, $currentDoc, $hasAccess)
## The system is started and the only user is XWikiGuest who has admin right but gives it up when he imports the default
## documents, we are checking to see if this looks like the guest imported the document with the first import.
#if($docToCheck.getWiki() == $xcontext.getMainWikiName()
&& $docToCheck.getVersion() == '1.1'
&& $docToCheck.getCreator() != $docToCheck.getContentAuthor()
&& $docToCheck.getContentAuthor() == 'XWiki.XWikiGuest')
##
#set($userToCheck = $docToCheck.getCreator())
#else
#set($userToCheck = $docToCheck.getAuthor())
#end
#set ($hasAccess = $util.null)
#setVariable ("$hasAccess" $xwiki.hasAccessLevel('edit', $userToCheck, $currentDoc))
#end
#*
* Find names of documents which contain objects of the class 'XWiki.ConfigurableClass'
*
* @param $section - String - Look for apps which specify that they should be configured in this section,
* if null or "" then returns them for all sections.
*
* @param $globaladmin - boolean - If true then we will look for applications which should be configured globally.
*
* @param $space - String - If not looking for apps which are configured globally, then this is the space where we
* will look for apps in. If null or "" or if $globaladmin is true, then all spaces will be
* searched.
*
* @param $outputList - List - The returns from this macro will be put in this list, passing the list as a parameter
* a safety measure because macros can't return values.
*###
#macro(findNamesOfAppsToConfigure, $section, $globaladmin, $space, $outputList)
## Use a parameterized sql query to prevent injection.
#set($params = [])
#if($section && $section != '')
#set($discard = $params.add("$section"))
#set($sqlA = ' StringProperty as section,')
#set($sqlB = " and section.id=obj.id and section.name='displayInSection' and section.value=?")
#else
## Make sure they are "" in case they were set prior to calling the macro.
#set($sqlA = '')
#set($sqlB = '')
#end
## Set up query based on value of $globaladmin
#if($globaladmin == true)
#set($sqlC = '1')
#else
#if($space && $space != '')
#set($sqlC = '0 and doc.space = ?')
#set($discard = $params.add($space))
#else
#set($sqlC = '0')
#end
#end
#set($sql = ", BaseObject as obj,$sqlA IntegerProperty as global where "
+ "doc.fullName=obj.name and obj.className='" + $nameOfThisDocument + "'$sqlB "
+ "and global.id=obj.id and global.name='configureGlobally' and global.value=$sqlC "
+ "order by doc.creationDate")
##
## Run the search
#set($discard = $outputList.addAll($xwiki.searchDocuments($sql, 0, 0, $params)))
##
#end
#macro(findCustomSectionsToConfigure $adminMenu)
#set ($outputList = [])
#set ($global = ($editor == 'globaladmin'))
#findNamesOfAppsToConfigure('', $global, $currentSpace, $outputList)
#set ($sectionsByName = {})
#set ($categoriesByName = {})
#foreach ($category in $adminMenu)
#set ($discard = $categoriesByName.put($category.id, $category))
#foreach ($section in $category.children)
#set ($discard = $sectionsByName.put($section.id, $section))
#end
#end
##
#set ($query = "editor=$escapetool.url(${editor})")
#if ($editor != 'globaladmin')
#set ($query = $query + "&space=$escapetool.url(${currentSpace})")
#end
#foreach ($appName in $outputList)
##
## Get the configurable application
#set ($app = $xwiki.getDocument($appName))
##
## If getDocument returns null, then warn the user that they don't have view access to that application.
#if (!$app)
! #set ($discard = $appsUserCannotView.add($appName))
#end
##
#foreach ($configurableObject in $app.getObjects($nameOfThisDocument))
#set ($displayInSection = $app.getValue('displayInSection', $configurableObject))
##
## If there is no section for this configurable or if the section cannot be edited, then check if the
## application can be edited by the current user, if so then we display the icon from the current app and
## don't display any message to tell the user they can't edit that section.
#if ($sectionsByName.containsKey($displayInSection))
#set ($appSection = $sectionsByName.get($displayInSection))
#set ($appSection.configurable = true)
#set ($newSection = false)
#else
##
## If there is no section for this configurable, then we will have to add one.
#set ($appSection = {'id' : $displayInSection, 'name' : $msg.get("admin.${displayInSection.toLowerCase()}"), 'url': $xwiki.getURL($currentDoc, $adminAction, "${query}&section=$escapetool.url(${displayInSection})"), 'configurable' : true})
#if ($app.getValue('configureGlobally', $configurableObject) != 1)
#set ($appSection.perSpace = true)
#end
#set ($key = "admin.${displayInSection.toLowerCase()}.description")
#if ($msg.get($key) != $key)
#set ($appSection.description = $msg.get($key))
#end
#set ($discard = $sectionsByName.put($displayInSection, $appSection))
#set ($discard = $categoriesByName.get('applications').children.add($appSection))
#set ($newSection = true)
#end
##
## If an attachment by the filename iconAttachment exists and is an image
#set ($attachment = $app.getAttachment("$!app.getValue('iconAttachment', $configurableObject)"))
#if ($attachment && $attachment.isImage())
## Set the icon for this section as the attachment URL.
#set ($appSection.iconReference = "${appName}(a)${attachment.getFilename()}")
#elseif(!$appSection.iconReference)
#set ($appSection.iconReference = 'XWiki.ConfigurableClass(a)DefaultAdminSectionIcon.png')
#end
##
## If the user doesn't have edit access to the application, we want to show a message on the icon
#if (!$xcontext.hasAccessLevel('edit', $app.getFullName()) && $newSection)
#set ($appSection.readOnly = true)
#elseif ($xcontext.hasAccessLevel('edit', $app.getFullName()) && $appSection.readOnly)
#set ($appSection.readOnly = false)
#end
#end## Foreach configurable object in this app.
#end## Foreach application which is configurable.
#end
#*
* Show the heading for configuration for a given application.
*
* $appName (String) Name of the application to show configuration heading for.
*
* $headingAlreadyShowing (boolean) If true then we don't make another heading. Otherwise it is set to true.
*###
#macro(showHeading, $appName, $headingAlreadyShowing)
#if(!$headingAlreadyShowing)
#set($headingAlreadyShowing = true)
= $msg.get("admin.customize") __[[$appName>>$appName]]__: =
#end
#end
#define($formHtml)
#if ($objClass.getPropertyNames().size() > 0)
<dl>
#foreach($propName in $objClass.getPropertyNames())
#if($propertiesToShow.size() > 0 && !$propertiesToShow.contains($propName))
## Silently skip over this property.
#else
#set($prettyName = "#evaluate($app.displayPrettyName($propName, $obj))")
##
## Further processing of the field display HTML is needed.
## Step 1: Strip <pre> tags which $obj.display inserts, this won't affect content because it's escaped.
#set($out = $obj.display($propName, 'edit').replaceAll('<[/]?+pre>', ''))
## Step 2: Select only content between first < and last > because $obj.display inserts html macros.
## Careful not to remove html macros from the content because they are not escaped!
#set ($out = $out.substring($out.indexOf('<'), $mathtool.add(1, $out.lastIndexOf('>'))))
## Step 3: Prepend app name to all ID and FOR attributes to prevent id collision with multiple apps on one page.
#set ($out = $out.replaceAll(
" id='$objClass.getName()_$obj.getNumber()_$propName", " id='${escapedAppName}_$objClass.getName()_$obj.getNumber()_$propName").replaceAll(
" for='$objClass.getName()_$obj.getNumber()_$propName", " for='${escapedAppName}_$objClass.getName()_$obj.getNumber()_$propName"))
## App Name is prepended to for= to make label work with id which is modified to prevent collisions.
<dt><label for="${escapedAppName}_$objClass.getName()_$obj.getNumber()_$propName">
#if ($out.indexOf('type=''checkbox''') != -1)
$out
#end
$escapetool.xml($prettyName)
</label>
#if($linkPrefix != '')
#set($linkScript = "$linkPrefix$propName")
<a href="$escapetool.xml("#evaluate($linkScript)")" class="xHelp" title="$msg.get('admin.documentation')">$msg.get('admin.documentation')</a>
#end
</dt>
#if ($out.indexOf('type=''checkbox''') == -1)
<dd>$out</dd>
#end
#end## If property is in propertiesToShow
#end## Foreach property in this class
</dl>
#end
#end## define $formHtml]
at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:125)
at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:44)
at org.xwiki.rendering.macro.script.AbstractScriptMacro.evaluateBlock(AbstractScriptMacro.java:298)
at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:190)
at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:57)
at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transformOnce(MacroTransformation.java:184)
at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(MacroTransformation.java:129)
at org.xwiki.rendering.internal.transformation.DefaultTransformationManager.performTransformations(DefaultTransformationManager.java:72)
at com.xpn.xwiki.doc.XWikiDocument.performSyntaxConversion(XWikiDocument.java:7409)
at com.xpn.xwiki.doc.XWikiDocument.performSyntaxConversion(XWikiDocument.java:7358)
at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:831)
at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:782)
at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:874)
at com.xpn.xwiki.api.Document.getRenderedContent(Document.java:537)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:252)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:332)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:196)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:161)
at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:116)
at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1874)
at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:155)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:226)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:117)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:129)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:152)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:218)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:301)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:162)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with id [xwiki:XWiki.AdminSheet]
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:205)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:161)
at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:118)
... 72 more
Caused by: org.apache.velocity.runtime.parser.TemplateParseException: Encountered "\'checkbox\'" at xwiki:XWiki.AdminSheet[line 231, column 26]
Was expecting one of:
"," ...
")" ...
<WHITESPACE> ...
at org.apache.velocity.runtime.parser.Parser.parse(Parser.java:119)
at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1131)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:189)
... 74 more
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Hello,
I am trying to replicate the first example in the tutorial[
http://rendering.xwiki.org/xwiki/bin/view/Main/GettingStarted] using Maven.
It worked great at first, but when I try to build a shaded JAR using the
maven-shade-plugin, I keep getting a nasty exception:
org.xwiki.component.manager.ComponentLookupException: Can't find descriptor
for the component [role = [org.xwiki.rendering.converter.Converter] hint =
[default]]
It seems that some descriptor should have registered itself, but it does not
always do that, depending on the project setup.
My question: is there a way to poke whichever class has to register itself?
If not, can you point me to a place where I can learn more about the
registration process?
All the best,
Wouter
I would like to start a xWiki about "Green Lawns": reel mowers, propane powered mowers and other subjects about organic lawns and landscaping.
note: I am planning to start a business in this field, but I can make the wiki strictly about information people can use and doesn't bennefit me or my business, except an occasional link. I just think it's important for people to be exposed to information on ways to have a organic lawn and garden.
I'm also looking to try out different wiki software to find one that is the easiest to use but is still flexible.
Randy
Hello!
I have a question according to the tree view in xwiki. Is there a possibility to change the velocity code that I can display the treeview of a single space? I didn´t find anything according to this topic.
Thanks for your help!
Florian
Hi all,
I need help with installation...
I'm trying to get xwiki running on:
RHEL 6 x64...
JDK 6 latest...
Mysql 5.1.52...
Tomcat 7.0.14
I've followed the admin guide as near as possible... The deviations I've
made are..
created my db as 'testxwiki' instead of just xwiki...
modified xwiki.db=testxwiki (this was just a stab in the dark - not sure
I need to change this)
made appropriate modifications to the jdbc url in hibernate.cfg.xml...
I've varified that I can connect to the database using:
mysql -uxwiki -psome_password testxwiki
and show tables returns the empty set... xwiki / hibernate is supposed
to create the initial schema on startup right (less indexes)?
A more complete catalina.out snip is below but essentially I'm getting...
FATAL store.DBCPConnectionProvider - Could not create a DBCP pool.
There is an error in the hibernate configuration file, please review it.
Unfortunately I have been through this file many many times... and I
just don't see anything wrong with it...
I also get some interesting results when I stop tomcat after attempting
to browse the xwiki site...
SEVERE: The web application [/xwiki] registered the JDBC driver
[com.mysql.jdbc.Driver] but failed to unregister it when the web
application was stopped. To prevent a memory leak, the JDBC Driver has
been forcibly unregistered.
May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader
clearReferencesThreads
SEVERE: The web application [/xwiki] appears to have started a thread
named [EvictionTimer-0] but has failed to stop it. This is very likely
to create a memory leak.
May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader
clearReferencesThreads
SEVERE: The web application [/xwiki] appears to have started a thread
named [EvictionTimer-1] but has failed to stop it. This is very likely
to create a memory leak.
May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader
checkThreadLocalMapForLeaks
SEVERE: The web application [/xwiki] created a ThreadLocal with key of
type [org.apache.log4j.helpers.ThreadLocalMap] (value
[org.apache.log4j.helpers.ThreadLocalMap@2a717ef5]) and a value of type
[java.util.Hashtable] (value [{}]) but failed to remove it when the web
application was stopped. Threads are going to be renewed over time to
try and avoid a probable memory leak.
May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader
checkThreadLocalMapForLeaks
SEVERE: The web application [/xwiki] created a ThreadLocal with key of
type [org.apache.log4j.helpers.ThreadLocalMap] (value
[org.apache.log4j.helpers.ThreadLocalMap@2a717ef5]) and a value of type
[java.util.Hashtable] (value
[{url=http://neil.nmc.edu:8080/xwiki/bin/view/Main/}]) but failed to
remove it when the web application was stopped. Threads are going to be
renewed over time to try and avoid a probable memory leak.
May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader
checkThreadLocalMapForLeaks
SEVERE: The web application [/xwiki] created a ThreadLocal with key of
type [org.apache.log4j.helpers.ThreadLocalMap] (value
[org.apache.log4j.helpers.ThreadLocalMap@2a717ef5]) and a value of type
[java.util.Hashtable] (value
[{url=http://neil.nmc.edu:8080/xwiki/bin/view/Main/}]) but failed to
remove it when the web application was stopped. Threads are going to be
renewed over time to try and avoid a probable memory leak.
Here's the gory details of everything I did (as well as I can remember)...
====
Installed the 64bit jdk from oracle..
java -version
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)
====
Downloaded tomcat and installed it...
tar -zxvf apache-tomcat-7.0.14.tar.gz
Modified the server.xml file and added:
deployOnStartup="true" to the Host node
Modified catalina.sh and added:
JAVA_HOME=/usr/local/jdk160_25
JAVA_OPTS="-Xmx512m -XX:MaxPermSize=128m"
Removed examples, host-manager, and manager from 'webapps'... I prefer
not to leave them...
====
Started tomcat - at that point I could get to the ROOT application and
browse the tomcat docs...
====
Installed mysql from RPM packages... Configured a few parameters in
my.cnf...
default-storage-engine=INNODB
innodb_file_per_table
skip-external-locking
max_connections=200
read_buffer_size=1M
sort_buffer_size=1M
key_buffer_size=128M
max_allowed_packet=32M
innodb_data_file_path = ibdata1:100M:autoextend
innodb_buffer_pool_size=256M
innodb_additional_mem_pool_size=20M
innodb_log_file_size=64M
innodb_log_buffer_size=8M
innodb_flush_log_at_trx_commit=1
====
Created the database and the user...
create database testxwiki default character set utf8;
grant all privileges on testxwiki.* to xwiki@localhost identified by
'some_password';
flush privileges;
====
Extracted the war file to 'xwiki' inside of webapps...
Added mysql-connector-java-5.1.16-bin.jar to xwiki/WEB-INF/lib
====
Changed hibernate.cfg.xml by:
commenting out the hsqldb section...
moved the comment tag for the mysql section up under the reference to
xwiki-1945 Leaving the property and mapping nodes uncommented:
<property
name="connection.url">jdbc:mysql://localhost/testxwiki?useServerPrepStmts=false&useUnicode=true&characterEncoding=UTF-8&sessionVariables=sql_mode=''</property>
<property name="connection.username">xwiki</property>
<property name="connection.password">some_password</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property
name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property>
<property name="connection.pool_size">2</property>
<property name="statement_cache.size">2</property>
<mapping resource="xwiki.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
<mapping resource="activitystream.hbm.xml"/>
====
changed xwiki.cfg as follows:
diff xwiki.original xwiki.cfg
82c82
< # xwiki.store.hibernate.path=/WEB-INF/hibernate.cfg.xml
---
> xwiki.store.hibernate.path=/WEB-INF/hibernate.cfg.xml
104c104
< # xwiki.db=xwiki
---
> xwiki.db=testxwiki
DO I NEED TO CHANGE THE XWIKI.DB PROPERTY???
====
When I start tomcat and go to the xwiki site I get the following in
catalina.out
STARTING TOMCAT...
May 26, 2011 2:02:57 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path:
/usr/local/jdk160_25/jre/lib/amd64/server:/usr/local/jdk160_25/jre/lib/amd64:/usr/local/jdk160_25/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
May 26, 2011 2:02:57 AM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
May 26, 2011 2:02:57 AM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
May 26, 2011 2:02:57 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1213 ms
May 26, 2011 2:02:57 AM org.apache.catalina.core.StandardService
startInternal
INFO: Starting service Catalina
May 26, 2011 2:02:57 AM org.apache.catalina.core.StandardEngine
startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.14
May 26, 2011 2:02:57 AM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory xwiki
May 26, 2011 2:02:59 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://jakarta.apache.org/struts/tags-html-1.0.2
is already defined
May 26, 2011 2:02:59 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://jakarta.apache.org/struts/tags-bean-1.0.2
is already defined
May 26, 2011 2:02:59 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI:
http://jakarta.apache.org/struts/tags-logic-1.0.2 is already defined
May 26, 2011 2:03:09 AM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory docs
May 26, 2011 2:03:09 AM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory ROOT
May 26, 2011 2:03:09 AM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
May 26, 2011 2:03:09 AM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
May 26, 2011 2:03:09 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 12410 ms
BROWSE TO THE XWIKI APP....
2011-05-26 02:03:29,868 [/xwiki/bin/view/Main/] FATAL
store.DBCPConnectionProvider - Could not create a DBCP pool. There is
an error in the hibernate configuration file, please review it.
org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (Unexpected exception encountered during query.)
at
org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at
com.xpn.xwiki.store.DBCPConnectionProvider.configure(DBCPConnectionProvider.java:193)
at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
at
org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:414)
at
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
at
org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2073)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1298)
at
com.xpn.xwiki.store.XWikiHibernateBaseStore.initHibernate(XWikiHibernateBaseStore.java:166)
at
com.xpn.xwiki.store.XWikiHibernateBaseStore.checkHibernate(XWikiHibernateBaseStore.java:560)
at
com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:1073)
at
com.xpn.xwiki.store.XWikiHibernateBaseStore.executeRead(XWikiHibernateBaseStore.java:1117)
at
com.xpn.xwiki.store.migration.hibernate.XWikiHibernateMigrationManager.getDBVersion(XWikiHibernateMigrationManager.java:68)
at
com.xpn.xwiki.store.migration.AbstractXWikiMigrationManager.<init>(AbstractXWikiMigrationManager.java:68)
at
com.xpn.xwiki.store.migration.hibernate.XWikiHibernateMigrationManager.<init>(XWikiHibernateMigrationManager.java:51)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.xpn.xwiki.XWiki.createClassFromConfig(XWiki.java:1132)
at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:813)
at com.xpn.xwiki.XWiki.<init>(XWiki.java:756)
at com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:408)
at com.xpn.xwiki.XWiki.getXWiki(XWiki.java:496)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:137)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:117)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:129)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:152)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:218)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:317)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:204)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:311)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.sql.SQLException: Unexpected exception encountered
during query.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2665)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1698)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1617)
at
com.mysql.jdbc.ConnectionImpl.setSessionVariables(ConnectionImpl.java:5210)
at
com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3375)
at
com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2385)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2154)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:792)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:381)
at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
at
org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
... 64 more
Caused by: java.lang.NullPointerException
at
com.mysql.jdbc.ConnectionImpl.getServerCharacterEncoding(ConnectionImpl.java:3100)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2095)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2619)
... 83 more
2011-05-26 02:03:29,876 [/xwiki/bin/view/Main/] WARN
action.RequestProcessor - Unhandled Exception thrown: class
com.xpn.xwiki.XWikiException
May 26, 2011 2:22:34 AM org.apache.catalina.core.StandardServer await
WHEN STOPPING TOMCAT....
INFO: A valid shutdown command was received via the shutdown port.
Stopping the Server instance.
May 26, 2011 2:22:34 AM org.apache.coyote.AbstractProtocolHandler pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
May 26, 2011 2:22:35 AM org.apache.coyote.AbstractProtocolHandler pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
May 26, 2011 2:22:36 AM org.apache.catalina.core.StandardService
stopInternal
INFO: Stopping service Catalina
May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader
clearReferencesJdbc
SEVERE: The web application [/xwiki] registered the JDBC driver
[com.mysql.jdbc.Driver] but failed to unregister it when the web
application was stopped. To prevent a memory leak, the JDBC Driver has
been forcibly unregistered.
May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader
clearReferencesThreads
SEVERE: The web application [/xwiki] appears to have started a thread
named [EvictionTimer-0] but has failed to stop it. This is very likely
to create a memory leak.
May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader
clearReferencesThreads
SEVERE: The web application [/xwiki] appears to have started a thread
named [EvictionTimer-1] but has failed to stop it. This is very likely
to create a memory leak.
May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader
checkThreadLocalMapForLeaks
SEVERE: The web application [/xwiki] created a ThreadLocal with key of
type [org.apache.log4j.helpers.ThreadLocalMap] (value
[org.apache.log4j.helpers.ThreadLocalMap@2a717ef5]) and a value of type
[java.util.Hashtable] (value [{}]) but failed to remove it when the web
application was stopped. Threads are going to be renewed over time to
try and avoid a probable memory leak.
May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader
checkThreadLocalMapForLeaks
SEVERE: The web application [/xwiki] created a ThreadLocal with key of
type [org.apache.log4j.helpers.ThreadLocalMap] (value
[org.apache.log4j.helpers.ThreadLocalMap@2a717ef5]) and a value of type
[java.util.Hashtable] (value
[{url=http://neil.nmc.edu:8080/xwiki/bin/view/Main/}]) but failed to
remove it when the web application was stopped. Threads are going to be
renewed over time to try and avoid a probable memory leak.
May 26, 2011 2:22:37 AM org.apache.catalina.loader.WebappClassLoader
checkThreadLocalMapForLeaks
SEVERE: The web application [/xwiki] created a ThreadLocal with key of
type [org.apache.log4j.helpers.ThreadLocalMap] (value
[org.apache.log4j.helpers.ThreadLocalMap@2a717ef5]) and a value of type
[java.util.Hashtable] (value
[{url=http://neil.nmc.edu:8080/xwiki/bin/view/Main/}]) but failed to
remove it when the web application was stopped. Threads are going to be
renewed over time to try and avoid a probable memory leak.
May 26, 2011 2:22:37 AM org.apache.coyote.AbstractProtocolHandler stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
May 26, 2011 2:22:37 AM org.apache.coyote.AbstractProtocolHandler stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Hi
Is there a tool/script that allows for exporting only pages from space XWiki with object XWikiuser
I know the export tool can export pages by selecting all or checkmark individual pages, but we have > 500 users, this becomes a drag....
Nice to have if it could also take group-object and which user is in what group
So we have a whole identity and access export
Gerritjan
Hello all,
In a elearning invironment XWIKI have to be linket to an external
software tool. In a second step XWIKI send some data to the external
tool to open a specific file. At the end of the usage of the external
tool XWIKI will get some date from the external tool and store it in a
page.
What kind of externsion I need to solve these problem?
Are there any examples?
Thank you for help!
Yours
Frank Marrenbach