[xwiki-devs] Problems deploying custom Authentication
Hi, i've been writing a custom authentication plugin for xwiki. The implementation was pretty straightforward, however I'm having trouble deploying the plugin. I bundled it with other plugins for the same purpose in a jar file. The jar file is deployed to my local repository. It's pulled in when I build the xe-debug-web in Eclipse and it's present in the xe-debug-web/WEB-INF/ lib directory of the deployed app (in .metadata/.plugins/org.eclipse.wst.server.core/ tmp0 ...). I altered the xwiki.cfg, adding the following line: xwiki .authentication .authclass=com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin However, when starting the application, I get the following problem: - Initializing AuthService... - Failed to initialize AuthService com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin using Reflection, trying default implementations using 'new'. java.lang.ClassNotFoundException: com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin at org .apache .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1387) at org .apache .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1233) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at com.xpn.xwiki.XWiki.getAuthService(XWiki.java:4630) at com.xpn.xwiki.XWiki.checkAuth(XWiki.java:3566) at com .xpn .xwiki .user .impl .xwiki.XWikiRightServiceImpl.checkAccess(XWikiRightServiceImpl.java:170) at com.xpn.xwiki.XWiki.checkAccess(XWiki.java:3574) at com.xpn.xwiki.XWiki.prepareDocuments(XWiki.java:4480) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:190) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115) 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:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org .apache .catalina .core .ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 290) at org .apache .catalina .core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com .xpn .xwiki .wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java: 94) at org .apache .catalina .core .ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 235) at org .apache .catalina .core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com .xpn .xwiki .web .SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java: 287) at org .apache .catalina .core .ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 235) at org .apache .catalina .core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com .xpn .xwiki .web .SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java: 112) at org .apache .catalina .core .ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 235) at org .apache .catalina .core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org .apache .catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 233) at org .apache .catalina.core.StandardContextValve.invoke(StandardContextValve.java: 191) at org .apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java: 128) at org .apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java: 102) at org .apache .catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java: 286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java: 845) at org.apache.coyote.http11.Http11Protocol $Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java: 447) at java.lang.Thread.run(Thread.java:637) Any idea what I've missed? Thanks in advance, J.L.Simon
Hi, All seems ok to me. You don't need more that pointing the right class in xwiki.cfg... Are you really sure that the jar contains the class and is in the published /lib folder ? I don't see anything else yet. On Tue, Dec 9, 2008 at 3:36 PM, Juergen Lorenz Simon <[email protected]> wrote:
Hi,
i've been writing a custom authentication plugin for xwiki. The implementation was pretty straightforward, however I'm having trouble deploying the plugin. I bundled it with other plugins for the same purpose in a jar file.
The jar file is deployed to my local repository. It's pulled in when I build the xe-debug-web in Eclipse and it's present in the xe-debug-web/WEB-INF/ lib directory of the deployed app (in .metadata/.plugins/org.eclipse.wst.server.core/ tmp0 ...).
I altered the xwiki.cfg, adding the following line:
xwiki .authentication .authclass=com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin
However, when starting the application, I get the following problem:
- Initializing AuthService... - Failed to initialize AuthService com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin using Reflection, trying default implementations using 'new'. java.lang.ClassNotFoundException: com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin at org .apache .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1387) at org .apache .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1233) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at com.xpn.xwiki.XWiki.getAuthService(XWiki.java:4630) at com.xpn.xwiki.XWiki.checkAuth(XWiki.java:3566) at com .xpn .xwiki .user .impl .xwiki.XWikiRightServiceImpl.checkAccess(XWikiRightServiceImpl.java:170) at com.xpn.xwiki.XWiki.checkAccess(XWiki.java:3574) at com.xpn.xwiki.XWiki.prepareDocuments(XWiki.java:4480) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:190) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115) 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:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org .apache .catalina .core .ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 290) at org .apache .catalina .core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com .xpn .xwiki .wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java: 94) at org .apache .catalina .core .ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 235) at org .apache .catalina .core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com .xpn .xwiki .web .SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java: 287) at org .apache .catalina .core .ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 235) at org .apache .catalina .core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com .xpn .xwiki .web .SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java: 112) at org .apache .catalina .core .ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 235) at org .apache .catalina .core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org .apache .catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 233) at org .apache .catalina.core.StandardContextValve.invoke(StandardContextValve.java: 191) at org .apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java: 128) at org .apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java: 102) at org .apache .catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java: 286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java: 845) at org.apache.coyote.http11.Http11Protocol $Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java: 447) at java.lang.Thread.run(Thread.java:637)
Any idea what I've missed?
Thanks in advance, J.L.Simon
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
Hi Thomas, thanks for the reply. I have two plugins in the jarfile in question. I double-checked the problem by setting up on scratch on a new machine. Everything looks fine, one plugin from the same jar file is found and works as it should. The authentication plugin is not found: - Initializing AuthService... - Failed to initialize AuthService com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin using Reflection, trying default implementations using 'new'. java.lang.ClassNotFoundException: com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin at org .apache .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1360) at org .apache .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1206) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at com.xpn.xwiki.XWiki.getAuthService(XWiki.java:4630) I'm a bit confounded now. Any more ideas? Could it be some problem with classpath ordering? Cheers, J.L.Simon On 10.12.2008, at 12:38, Thomas Mortagne wrote:
Hi,
All seems ok to me. You don't need more that pointing the right class in xwiki.cfg...
Are you really sure that the jar contains the class and is in the published /lib folder ? I don't see anything else yet.
On Tue, Dec 9, 2008 at 3:36 PM, Juergen Lorenz Simon <[email protected]
wrote: Hi,
i've been writing a custom authentication plugin for xwiki. The implementation was pretty straightforward, however I'm having trouble deploying the plugin. I bundled it with other plugins for the same purpose in a jar file.
The jar file is deployed to my local repository. It's pulled in when I build the xe-debug-web in Eclipse and it's present in the xe-debug-web/WEB-INF/ lib directory of the deployed app (in .metadata/.plugins/ org.eclipse.wst.server.core/ tmp0 ...).
I altered the xwiki.cfg, adding the following line:
xwiki .authentication .authclass =com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin
However, when starting the application, I get the following problem:
- Initializing AuthService... - Failed to initialize AuthService com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin using Reflection, trying default implementations using 'new'. java.lang.ClassNotFoundException: com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin at org .apache .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1387) at org .apache .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1233) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java: 374) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at com.xpn.xwiki.XWiki.getAuthService(XWiki.java:4630) at com.xpn.xwiki.XWiki.checkAuth(XWiki.java:3566) at com .xpn .xwiki .user .impl .xwiki.XWikiRightServiceImpl.checkAccess(XWikiRightServiceImpl.java: 170) at com.xpn.xwiki.XWiki.checkAccess(XWiki.java:3574) at com.xpn.xwiki.XWiki.prepareDocuments(XWiki.java:4480) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:190) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115) 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:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org .apache .catalina .core .ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 290) at org .apache .catalina .core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: 206) at com .xpn .xwiki .wysiwyg .server.filter.ConversionFilter.doFilter(ConversionFilter.java: 94) at org .apache .catalina .core .ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 235) at org .apache .catalina .core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: 206) at com .xpn .xwiki .web .SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java: 287) at org .apache .catalina .core .ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 235) at org .apache .catalina .core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: 206) at com .xpn .xwiki .web .SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java: 112) at org .apache .catalina .core .ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 235) at org .apache .catalina .core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: 206) at org .apache .catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 233) at org .apache .catalina.core.StandardContextValve.invoke(StandardContextValve.java: 191) at org .apache .catalina.core.StandardHostValve.invoke(StandardHostValve.java: 128) at org .apache .catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java: 102) at org .apache .catalina.core.StandardEngineValve.invoke(StandardEngineValve.java: 109) at org .apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java: 286) at org .apache.coyote.http11.Http11Processor.process(Http11Processor.java: 845) at org.apache.coyote.http11.Http11Protocol $Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint $Worker.run(JIoEndpoint.java: 447) at java.lang.Thread.run(Thread.java:637)
Any idea what I've missed?
Thanks in advance, J.L.Simon
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
How exactly did you write the authentication class? It should not be a plugin (implementing XWikiPlugin), but an authenticator, implementing the XWikiAuthService interface. Juergen Lorenz Simon wrote:
Hi Thomas,
thanks for the reply. I have two plugins in the jarfile in question. I double-checked the problem by setting up on scratch on a new machine. Everything looks fine, one plugin from the same jar file is found and works as it should. The authentication plugin is not found:
- Initializing AuthService... - Failed to initialize AuthService com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin using Reflection, trying default implementations using 'new'. java.lang.ClassNotFoundException: com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin at org .apache .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1360) at org .apache .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1206) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at com.xpn.xwiki.XWiki.getAuthService(XWiki.java:4630)
I'm a bit confounded now. Any more ideas? Could it be some problem with classpath ordering?
Cheers, J.L.Simon
On 10.12.2008, at 12:38, Thomas Mortagne wrote:
Hi,
All seems ok to me. You don't need more that pointing the right class in xwiki.cfg...
Are you really sure that the jar contains the class and is in the published /lib folder ? I don't see anything else yet.
On Tue, Dec 9, 2008 at 3:36 PM, Juergen Lorenz Simon <[email protected]
wrote: Hi,
i've been writing a custom authentication plugin for xwiki. The implementation was pretty straightforward, however I'm having trouble deploying the plugin. I bundled it with other plugins for the same purpose in a jar file.
The jar file is deployed to my local repository. It's pulled in when I build the xe-debug-web in Eclipse and it's present in the xe-debug-web/WEB-INF/ lib directory of the deployed app (in .metadata/.plugins/ org.eclipse.wst.server.core/ tmp0 ...).
I altered the xwiki.cfg, adding the following line:
xwiki .authentication .authclass =com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin
However, when starting the application, I get the following problem:
-- Sergiu Dumitriu http://purl.org/net/sergiu/
Hi, On 10.12.2008, at 15:13, Sergiu Dumitriu wrote:
How exactly did you write the authentication class? It should not be a plugin (implementing XWikiPlugin), but an authenticator, implementing the XWikiAuthService interface.
I don't think that's the problem. True, the class name suggests plugin and maybe I need to fix that. But the issue is not related to the name of class surely? Just in case i simply paste the declaration here: public class PortalAuthenticationPlugin extends XWikiAuthServiceImpl { /** * Authenticates the user * @param context * @return authenticated XWiki user * @throws com.xpn.xwiki.XWikiException */ @SuppressWarnings("unchecked") @Override public XWikiUser checkAuth(XWikiContext context) throws XWikiException { ... stuff ... } } To make sure its not a problem with both my plugins in the same jarfile, I created one project per jarfile. Both compile fine, install fine and i can see them in the deploy conduit in WEB-INF/lib. Both jar files contain the classes. One is found by the class loader, the other is not.
Juergen Lorenz Simon wrote:
Hi Thomas,
thanks for the reply. I have two plugins in the jarfile in question. I double-checked the problem by setting up on scratch on a new machine. Everything looks fine, one plugin from the same jar file is found and works as it should. The authentication plugin is not found:
- Initializing AuthService... - Failed to initialize AuthService com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin using Reflection, trying default implementations using 'new'. java.lang.ClassNotFoundException: com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin at org .apache .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1360) at org .apache .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1206) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at com.xpn.xwiki.XWiki.getAuthService(XWiki.java:4630)
I'm a bit confounded now. Any more ideas? Could it be some problem with classpath ordering?
Cheers, J.L.Simon
On 10.12.2008, at 12:38, Thomas Mortagne wrote:
Hi,
All seems ok to me. You don't need more that pointing the right class in xwiki.cfg...
Are you really sure that the jar contains the class and is in the published /lib folder ? I don't see anything else yet.
On Tue, Dec 9, 2008 at 3:36 PM, Juergen Lorenz Simon <[email protected]
wrote: Hi,
i've been writing a custom authentication plugin for xwiki. The implementation was pretty straightforward, however I'm having trouble deploying the plugin. I bundled it with other plugins for the same purpose in a jar file.
The jar file is deployed to my local repository. It's pulled in when I build the xe-debug-web in Eclipse and it's present in the xe-debug-web/WEB- INF/ lib directory of the deployed app (in .metadata/.plugins/ org.eclipse.wst.server.core/ tmp0 ...).
I altered the xwiki.cfg, adding the following line:
xwiki .authentication .authclass =com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin
However, when starting the application, I get the following problem:
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Juergen Lorenz Simon wrote:
Hi,
On 10.12.2008, at 15:13, Sergiu Dumitriu wrote:
How exactly did you write the authentication class? It should not be a plugin (implementing XWikiPlugin), but an authenticator, implementing the XWikiAuthService interface.
I don't think that's the problem. True, the class name suggests plugin and maybe I need to fix that. But the issue is not related to the name of class surely? Just in case i simply paste the declaration here:
public class PortalAuthenticationPlugin extends XWikiAuthServiceImpl {
/** * Authenticates the user * @param context * @return authenticated XWiki user * @throws com.xpn.xwiki.XWikiException */ @SuppressWarnings("unchecked") @Override public XWikiUser checkAuth(XWikiContext context) throws XWikiException { ... stuff ... }
}
Yes, this is OK. Are you sure you put the right package name? A ClassNotFound exception usually doesn't depend on the code inside the class. Please check for extra or missing letters in the configuration file.
To make sure its not a problem with both my plugins in the same jarfile, I created one project per jarfile. Both compile fine, install fine and i can see them in the deploy conduit in WEB-INF/lib. Both jar files contain the classes. One is found by the class loader, the other is not.
Juergen Lorenz Simon wrote:
Hi Thomas,
thanks for the reply. I have two plugins in the jarfile in question. I double-checked the problem by setting up on scratch on a new machine. Everything looks fine, one plugin from the same jar file is found and works as it should. The authentication plugin is not found:
- Initializing AuthService... - Failed to initialize AuthService com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin using Reflection, trying default implementations using 'new'. java.lang.ClassNotFoundException: com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin at org .apache .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1360) at org .apache .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1206) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at com.xpn.xwiki.XWiki.getAuthService(XWiki.java:4630)
I'm a bit confounded now. Any more ideas? Could it be some problem with classpath ordering?
Cheers, J.L.Simon
On 10.12.2008, at 12:38, Thomas Mortagne wrote:
Hi,
All seems ok to me. You don't need more that pointing the right class in xwiki.cfg...
Are you really sure that the jar contains the class and is in the published /lib folder ? I don't see anything else yet.
On Tue, Dec 9, 2008 at 3:36 PM, Juergen Lorenz Simon <[email protected]
wrote: Hi,
i've been writing a custom authentication plugin for xwiki. The implementation was pretty straightforward, however I'm having trouble deploying the plugin. I bundled it with other plugins for the same purpose in a jar file.
The jar file is deployed to my local repository. It's pulled in when I build the xe-debug-web in Eclipse and it's present in the xe-debug-web/WEB- INF/ lib directory of the deployed app (in .metadata/.plugins/ org.eclipse.wst.server.core/ tmp0 ...).
I altered the xwiki.cfg, adding the following line:
xwiki .authentication .authclass =com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin
However, when starting the application, I get the following problem:
-- Sergiu Dumitriu http://purl.org/net/sergiu/
Hi, On 10.12.2008, at 16:00, Sergiu Dumitriu wrote:
Juergen Lorenz Simon wrote:
Hi,
On 10.12.2008, at 15:13, Sergiu Dumitriu wrote:
How exactly did you write the authentication class? It should not be a plugin (implementing XWikiPlugin), but an authenticator, implementing the XWikiAuthService interface.
I don't think that's the problem. True, the class name suggests plugin and maybe I need to fix that. But the issue is not related to the name of class surely? Just in case i simply paste the declaration here:
public class PortalAuthenticationPlugin extends XWikiAuthServiceImpl {
/** * Authenticates the user * @param context * @return authenticated XWiki user * @throws com.xpn.xwiki.XWikiException */ @SuppressWarnings("unchecked") @Override public XWikiUser checkAuth(XWikiContext context) throws XWikiException { ... stuff ... }
}
Yes, this is OK. Are you sure you put the right package name? A ClassNotFound exception usually doesn't depend on the code inside the class. Please check for extra or missing letters in the configuration file.
Yes, checked and double checked. Spelling A-OK. I'm in the process of trying out the latest release (1.7). I let you know what I find.
To make sure its not a problem with both my plugins in the same jarfile, I created one project per jarfile. Both compile fine, install fine and i can see them in the deploy conduit in WEB-INF/lib. Both jar files contain the classes. One is found by the class loader, the other is not.
Juergen Lorenz Simon wrote:
Hi Thomas,
thanks for the reply. I have two plugins in the jarfile in question. I double-checked the problem by setting up on scratch on a new machine. Everything looks fine, one plugin from the same jar file is found and works as it should. The authentication plugin is not found:
- Initializing AuthService... - Failed to initialize AuthService com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin using Reflection, trying default implementations using 'new'. java.lang.ClassNotFoundException: com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin at org .apache .catalina .loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1360) at org .apache .catalina .loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1206) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at com.xpn.xwiki.XWiki.getAuthService(XWiki.java:4630)
I'm a bit confounded now. Any more ideas? Could it be some problem with classpath ordering?
Cheers, J.L.Simon
On 10.12.2008, at 12:38, Thomas Mortagne wrote:
Hi,
All seems ok to me. You don't need more that pointing the right class in xwiki.cfg...
Are you really sure that the jar contains the class and is in the published /lib folder ? I don't see anything else yet.
On Tue, Dec 9, 2008 at 3:36 PM, Juergen Lorenz Simon <[email protected]
wrote: Hi,
i've been writing a custom authentication plugin for xwiki. The implementation was pretty straightforward, however I'm having trouble deploying the plugin. I bundled it with other plugins for the same purpose in a jar file.
The jar file is deployed to my local repository. It's pulled in when I build the xe-debug-web in Eclipse and it's present in the xe-debug-web/WEB- INF/ lib directory of the deployed app (in .metadata/.plugins/ org.eclipse.wst.server.core/ tmp0 ...).
I altered the xwiki.cfg, adding the following line:
xwiki .authentication .authclass =com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin
However, when starting the application, I get the following problem:
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Hi, i found the cause of the error. What is the difference between the following two lines: Line 1: xwiki .authentication .authclass = com .kontrast.vodafone.portal.xwiki.plugins.auth.PortalAuthenticationPlugin Line 2: xwiki .authentication .authclass = com .kontrast.vodafone.portal.xwiki.plugins.auth.PortalAuthenticationPlugin If you can guess it, you'll get a cookie. The difference is a BLANK at the end. When the class name is resolved, there is no trimming. Thus a blank at the end borks up the process. Pretty annoying, huh? Maybe there should be trimming in places like that? I got the plugin up and running now. Thanks for all the assistance! J.L.Simon On 10.12.2008, at 16:42, Juergen Lorenz Simon wrote:
Hi,
On 10.12.2008, at 16:00, Sergiu Dumitriu wrote:
Juergen Lorenz Simon wrote:
Hi,
On 10.12.2008, at 15:13, Sergiu Dumitriu wrote:
How exactly did you write the authentication class? It should not be a plugin (implementing XWikiPlugin), but an authenticator, implementing the XWikiAuthService interface.
I don't think that's the problem. True, the class name suggests plugin and maybe I need to fix that. But the issue is not related to the name of class surely? Just in case i simply paste the declaration here:
public class PortalAuthenticationPlugin extends XWikiAuthServiceImpl {
/** * Authenticates the user * @param context * @return authenticated XWiki user * @throws com.xpn.xwiki.XWikiException */ @SuppressWarnings("unchecked") @Override public XWikiUser checkAuth(XWikiContext context) throws XWikiException { ... stuff ... }
}
Yes, this is OK. Are you sure you put the right package name? A ClassNotFound exception usually doesn't depend on the code inside the class. Please check for extra or missing letters in the configuration file.
Yes, checked and double checked. Spelling A-OK. I'm in the process of trying out the latest release (1.7). I let you know what I find.
To make sure its not a problem with both my plugins in the same jarfile, I created one project per jarfile. Both compile fine, install fine and i can see them in the deploy conduit in WEB-INF/lib. Both jar files contain the classes. One is found by the class loader, the other is not.
Juergen Lorenz Simon wrote:
Hi Thomas,
thanks for the reply. I have two plugins in the jarfile in question. I double-checked the problem by setting up on scratch on a new machine. Everything looks fine, one plugin from the same jar file is found and works as it should. The authentication plugin is not found:
- Initializing AuthService... - Failed to initialize AuthService com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin using Reflection, trying default implementations using 'new'. java.lang.ClassNotFoundException: com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin at org .apache .catalina .loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1360) at org .apache .catalina .loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1206) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at com.xpn.xwiki.XWiki.getAuthService(XWiki.java:4630)
I'm a bit confounded now. Any more ideas? Could it be some problem with classpath ordering?
Cheers, J.L.Simon
On 10.12.2008, at 12:38, Thomas Mortagne wrote:
Hi,
All seems ok to me. You don't need more that pointing the right class in xwiki.cfg...
Are you really sure that the jar contains the class and is in the published /lib folder ? I don't see anything else yet.
On Tue, Dec 9, 2008 at 3:36 PM, Juergen Lorenz Simon <[email protected] > wrote: > Hi, > > i've been writing a custom authentication plugin for xwiki. The > implementation was > pretty straightforward, however I'm having trouble deploying the > plugin. I bundled > it with other plugins for the same purpose in a jar file. > > The jar file is deployed to my local repository. It's pulled in > when I > build the > xe-debug-web in Eclipse and it's present in the xe-debug-web/ > WEB- > INF/ > lib directory > of the deployed app (in .metadata/.plugins/ > org.eclipse.wst.server.core/ > tmp0 ...). > > I altered the xwiki.cfg, adding the following line: > > xwiki > .authentication > .authclass > =com.kontrast.vodafone.portal.xwiki.PortalAuthenticationPlugin > > However, when starting the application, I get the following > problem: >
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Juergen Lorenz Simon wrote:
Hi,
i found the cause of the error. What is the difference between the following two lines:
Line 1: xwiki .authentication .authclass = com .kontrast.vodafone.portal.xwiki.plugins.auth.PortalAuthenticationPlugin
Line 2: xwiki .authentication .authclass = com .kontrast.vodafone.portal.xwiki.plugins.auth.PortalAuthenticationPlugin
If you can guess it, you'll get a cookie. The difference is a BLANK at the end. When the class name is resolved, there is no trimming. Thus a blank at the end borks up the process. Pretty annoying, huh? Maybe there should be trimming in places like that?
FYI, http://jira.xwiki.org/jira/browse/XWIKI-2971 -- Sergiu Dumitriu http://purl.org/net/sergiu/
participants (3)
-
Juergen Lorenz Simon -
Sergiu Dumitriu -
Thomas Mortagne