Re: Jetspeed 2.2.2-SNAPSHOT archetype: maven build error with assembly/override?

Ate Douma <[email protected]>
Newsgroups gmane.comp.jakarta.jetspeed.user
Message-ID <[email protected]>
On 10/10/2011 11:13 AM, Krauß, Ralf wrote:
> Hi,
>
> I started building a custom portal from the archetype.  Basic setup is OK, the portal and the portlet app are correctly deployed to tomcat using target 'all'.
> For subsequent changes, I only used the 'deploy-portal' and 'deploy-pa' targets.
> Now I've tried to configure NTLM authentication for the portal by overriding web.xml and the security valve bean in the *-portal module:
> *-portal directory layout:
> + src
>    -+main
>      -+webapp
>        -+WEB-INF
>          - web.xml (with the NTLM filter)
>         -+ assembly
>           -+ override
>            - security-valve-override.xml
>
> Everything was deployed just fine and working  using the 'deploy-portal' target.
> Then I somehow corrupted the user database and had to start with a clean database using the 'all' target.
>
> But the 'all' target fails with the appended error stacktrace. A workaround is to temporarily rename the 'assembly' directory, run the 'all' target and afterwards do an additional 'deploy-portal'.
> Am I missing something or is this a problem with the db-maven-plugin?

I expect you've not specified the j2:cat meta property for the NtlmSecurityValve 
bean configuration in your security-valve-override.xml.

Please compare with the SecurityValveImpl bean definition you've overridden and 
follow its example. Taking a default (example) NTLMSecurityValve bean definition 
you might need something like:

   <bean id="securityValve"
         class="org.apache.jetspeed.security.impl.ntlm.NtlmSecurityValve"
         init-method="initialize">
     <meta key="j2:cat" value="default"/>
     <constructor-arg>
       <ref bean="org.apache.jetspeed.security.UserManager" />
     </constructor-arg>
     <constructor-arg><value>SOME_DOMAIN</value></constructor-arg>
     <constructor-arg><value>true</value></constructor-arg>
     <constructor-arg><value>false</value></constructor-arg>
</bean>

The j2:cat meta property is used as a Spring filter value to include/exclude 
sets of bean definitions depending on your configuration. The jetspeed 
db-maven-plugin is using this by explicitly using/setting spring filter key 
"serializer" and thereby restrict the set of beans loaded by Spring for this 
commandline operation. If you don't specify a j2:cat meta property for a bean, 
it will be always included. But in this case, that doesn't make sense as the 
JetspeedSerializer doesn't need the NTLMSecuriyValve for its operation, nor does 
it have it available on the classpath. Hence causing Spring to fail loading this 
bean.

For more information, see:
   http://portals.apache.org/jetspeed-2/devguide/spring-config.html

HTH,

Ate

>
> Regards
>    Ralf
>
>
>
> [ERROR] Failed to execute goal org.apache.portals.jetspeed-2:jetspeed-db-maven-plugin:2.2.2-SNAPSHOT:init (seed) on project jetspeed-mvn-portal-pom: Serializer error: Unexpected error during import: Cannot find class [org.apache.jetspeed.security.impl.ntlm.NtlmSecurityValve] for bean with name 'securityValve' defined in file [<...>\WEB-INF\assembly\override\security-valve-override.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.jetspeed.security.impl.ntlm.NtlmSecurityValve ->  [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.portals.jetspeed-2:jetspeed-db-maven-plugin:2.2.2-SNAPSHOT:init (seed) on project jetspeed-mvn-portal-pom: Serializer error:
>          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
>          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
>          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
>          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
>          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
>          at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
>          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
>          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
>          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
>          at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
>          at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
>          at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
>          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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
>          at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
>          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
>          at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
>
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.