Hi,
I have to deal some external data in my XE 1.3.2. I am using Mysql 5.0
and Jetty 5.1.5. I followed this
http://xwikisql.gradsoft.ua/docs/XWikiSqlPluginGuide.html and write the
code
##receive database
#set($mydb=$xwiki.sql.getDatabase("test"))
#set($result=$mydb.executeUpdate("update student set Name = ? where RNo =
?", ["Happy", 28]))
When I saved this, nothing on the page but in the start console it shows:-
2008-05-21 12:53:54,781 [
http://localhost:8181/xwiki/bin/view/main/amma]
[P1-18]
ERROR xwikisql.SqlPlugin - exception during creation of
datasource
test
javax.naming.NoInitialContextException: Need to specify class name in
environmen
t or system property, or as an applet parameter, or in an application
resource f
ile: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at ua.gradsoft.xwikisql.SqlPlugin.createDataSource(SqlPlugin.java:95)
at ua.gradsoft.xwikisql.SqlPlugin.createDatabase(SqlPlugin.java:84)
at
ua.gradsoft.xwikisql.SqlPluginApi.getDatabase(SqlPluginApi.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.in
voke(UberspectImpl.java:295)
at
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.j
ava:245)
at
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTRefer
ence.java:203)
at
org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReferen
ce.java:419)
at
org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpres
sion.java:73)
at
org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSet
Directive.java:125)
at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.
java:318)
at
com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRend
erer.java:241)
at
com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRend
erer.java:155)
at
com.xpn.xwiki.render.XWikiVelocityRenderer.render(XWikiVelocityRender
er.java:95)
at
com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXW
ikiRenderingEngine.java:252)
at
com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXW
ikiRenderingEngine.java:176)
at
com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXW
ikiRenderingEngine.java:145)
at
com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderDocument(Defau
ltXWikiRenderingEngine.java:134)
at
com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java
:418)
at com.xpn.xwiki.api.Document.getRenderedContent(Document.java:371)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.in
voke(UberspectImpl.java:295)
at
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.j
ava:245)
at
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTRefer
ence.java:203)
at
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTRefere
nce.java:294)
at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.
java:318)
at
com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRend
erer.java:241)
at
com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRend
erer.java:155)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1429)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:598)
at sun.reflect.GeneratedMethodAccessor83.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.in
voke(UberspectImpl.java:295)
at
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.j
ava:245)
at
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTRefer
ence.java:203)
at
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTRefere
nce.java:294)
at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.
java:318)
at
org.apache.velocity.runtime.directive.VelocimacroProxy.render(Velocim
acroProxy.java:194)
at
org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirect
ive.java:170)
at
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java
:74)
at
org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfSt
atement.java:88)
at
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java
:74)
at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.
java:318)
at
org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfSt
atement.java:107)
at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.
java:318)
at
com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRend
erer.java:241)
at
com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRend
erer.java:155)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1429)
at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:108)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:208)
at
org.apache.struts.action.RequestProcessor.processActionPerform(Reques
tProcessor.java:431)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:236)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:119
6)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428
)
at
org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(
WebApplicationHandler.java:830)
at
com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEnc
odingFilter.java:117)
at
org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(
WebApplicationHandler.java:821)
at
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicati
onHandler.java:471)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:5
68)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
at
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplication
Context.java:633)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
at org.mortbay.http.HttpServer.service(HttpServer.java:954)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
at
org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
at
org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
Where is my fault?
Regards,
Project trainees.