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
>
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs