geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwengr <rwdonap...@bellsouth.net>
Subject Packaging a CAR file with car-mave-plugin cannot find Reference beans
Date Tue, 11 Mar 2014 16:25:45 GMT
Below are the highlights of using the car-maven-plugin to create a CAR file
for a plugin.  While executing the 'package' goal, it fails because it
cannot find a <gbean> I reference, the ubiquitous ServerInfo.

1) The listing clearly shows "j2ee-system" being loaded and started while
the kernel is booted
2) If you look at the deployment plan for this CAR, you will clearly see a
<gbean> named "ServerInfo"
  <gbean name="ServerInfo"
class="org.apache.geronimo.system.serverinfo.BasicServerInfo">
    <attribute name="useSystemProperties">true</attribute>
  </gbean>

*If the kernel boots OK and starts a plugin OK that contains a <gbean> I
reference, why can't the maven plugin find it while it is doing its
deployment check? *

*If I remove the reference from the <gbean> definition, it works perfect. 
Only hangup is it can't find ServerInfo.*

Results of running car-maven-plugin. Note I added some print statements to
verify all the static code works OK.  All of the goals prior to "package"
run OK.

[CAR-MAVEN-PLUGIN OUTPUT]
...
...
[INFO] [car:package {execution: default-package}]
[INFO] Packaging module configuration:
/home/QEuser/PROJECTS/JAVA/Geronimo/ApacheDS/directory/target/work/plan.xml
[org.apache.geronimo.kernel.basic.BasicKernel] : Starting boot
[org.apache.geronimo.gbean.runtime.AbstractGBeanReference] : GBean
references are not using proxies
...
...
[org.apache.geronimo.system.configuration.DependencyManager] : Starting
artifact: DependencyType
[org.apache.geronimo.framework/j2ee-system/3.0.1/car:null]
...
...
[org.apache.geronimo.kernel.config.Configuration] : Started configuration
org.apache.geronimo.plugins/directory/9.0.2/car
DirectoryGBean static initialization
Created GConstructorInfo
Created GBEAN_INFO
Creating infoFactory object 190
[org.apache.geronimo.kernel.config.Configuration] : Stopping configuration
org.apache.geronimo.plugins/directory/9.0.2/car
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] could not package plugin

Embedded error: No reference named ServerInfo in gbean
org.apache.geronimo.plugins/directory/9.0.2/car?ServiceModule=org.apache.geronimo.plugins/directory/9.0.2/car,j2eeType=GBean,name=DirectoryService
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: could not package
plugin
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
	at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
	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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
	at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
	at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
	at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: could not package
plugin
	at
org.apache.geronimo.mavenplugins.car.PackageMojo.execute(PackageMojo.java:232)
	at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
	... 17 more
Caused by: org.apache.geronimo.common.DeploymentException: No reference
named ServerInfo in gbean
org.apache.geronimo.plugins/directory/9.0.2/car?ServiceModule=org.apache.geronimo.plugins/directory/9.0.2/car,j2eeType=GBean,name=DirectoryService
	at
org.apache.geronimo.deployment.service.SingleGBeanBuilder.buildAbstractNameQuery(SingleGBeanBuilder.java:154)
	at
org.apache.geronimo.deployment.service.SingleGBeanBuilder.setReference(SingleGBeanBuilder.java:129)
	at
org.apache.geronimo.deployment.service.SingleGBeanBuilder.setReference(SingleGBeanBuilder.java:123)
	at
org.apache.geronimo.deployment.service.GBeanBuilder.addGBeanData(GBeanBuilder.java:144)
	at
org.apache.geronimo.deployment.service.GBeanBuilder.build(GBeanBuilder.java:108)
	at
org.apache.geronimo.deployment.NamespaceDrivenBuilderCollection.build(NamespaceDrivenBuilderCollection.java:43)
	at
org.apache.geronimo.deployment.service.ServiceConfigBuilder.buildConfiguration(ServiceConfigBuilder.java:252)
	at
org.apache.geronimo.deployment.service.ServiceConfigBuilder.buildConfiguration(ServiceConfigBuilder.java:211)
	at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:281)
	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.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
	at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:131)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:883)
	at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:245)
	at
org.apache.geronimo.mavenplugins.car.PackageMojo.invokeDeployer(PackageMojo.java:525)
	at
org.apache.geronimo.mavenplugins.car.PackageMojo.buildPackage(PackageMojo.java:338)
	at
org.apache.geronimo.mavenplugins.car.PackageMojo.execute(PackageMojo.java:229)
	... 19 more

Original idea was to get ApacheDS working as a plugin so I could learn
Geronimo.  Here is the deployment plan submiitted to car-maven-plugin.  I
tried it with and without <version> on j2ee-system.

<module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
  <environment>
    <dependencies>
      <dependency>
        <groupId>org.apache.geronimo.framework</groupId>
        <artifactId>j2ee-system</artifactId>
        <version>3.0.1</version>
        <type>car</type>
      </dependency>
    </dependencies>
  </environment>
  <gbean name="DirectoryService"
class="org.apache.geronimo.directory.DirectoryGBean">
    <attribute name="configFile">var/directory/server.xml</attribute>
    <attribute name="workingDir">var/directory</attribute>
    <reference name="ServerInfo">
      <name>ServerInfo</name>
    </reference>
  </gbean>
</module>

Here's the bean static code

   public static final GBeanInfo GBEAN_INFO;

    static {
        System.out.println("DirectoryGBean static initialization");
        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic("Apache
Directory LDAP", DirectoryGBean.class);


        infoFactory.addAttribute("workingDir", String.class, true);
        infoFactory.addAttribute("configFile", String.class, true);
        infoFactory.addReference("ServerInfo", BasicServerInfo.class,
"GBean");
        String[] attributeNames = new String[]{"workingDir", "configFile",
"ServerInfo"};
        infoFactory.setConstructor(attributeNames);
        System.out.println("Created GConstructorInfo");
        GBEAN_INFO = infoFactory.getBeanInfo();
        System.out.println("Created GBEAN_INFO");
    }

    public static GBeanInfo getGBeanInfo() {
      System.out.println("Creating infoFactory object 190");
      return GBEAN_INFO;





--
View this message in context: http://apache-geronimo.328035.n3.nabble.com/Packaging-a-CAR-file-with-car-mave-plugin-cannot-find-Reference-beans-tp3987698.html
Sent from the Users mailing list archive at Nabble.com.

Mime
View raw message