I'm trying to use a properties artifact in Plan file like its described in the dm Server roadmap. Using dm Server M2.
Here is the plan file.
I keep getting a null pointer, as if the properties artifact can't be located. I've tried various names (e.g prodmserver.vehicle.db, prodmserver.vehicle.db.properties,etc) and keep getting a null pointer.Code:<?xml version="1.0" encoding="UTF-8"?> <plan name="multi-artifact.plan" version="1.0.0" scoped="true" atomic="true" xmlns="http://www.springsource.org/schema/dm-server/plan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springsource.org/schema/dm-server/plan http://www.springsource.org/schema/dm-server/plan/springsource-dm-server-plan.xsd"> <artifact type="properties" name="prodmserver.vehicle.db" version="[1.0.0,1.0.0]"/> <artifact type="bundle" name="com.apress.prodmserver.vehicle.domain" version="[1.0.0,1.0.0]"/> <artifact type="bundle" name="com.apress.prodmserver.vehicle.infrastructure.derby" version="[1.0.0,1.0.0]"/> <artifact type="bundle" name="com.apress.prodmserver.vehicle.repository" version="[1.0.0,1.0.0]"/> <artifact type="bundle" name="com.apress.prodmserver.vehicle.repository.jpa" version="[1.0.0,1.0.0]"/> <artifact type="bundle" name="com.apress.prodmserver.vehicle.service" version="[1.0.0,1.0.0]"/> <artifact type="bundle" name="com.apress.prodmserver.vehicle.web" version="[1.0.0,1.0.0]"/> </plan>
I should also mention that using the syntax described in the dm Server roadmap I get another type of error. The roadmap doc suggests the following notation:
But leaving the version for expansion generates the following:Code:<artifact type="properties" name="prodmserver.vehicle.db" version="${plan.version}"/>
Also a little fuzzy on how you modify a bundle to read these properties value (I'm guessing a similar syntax like ${jdbc.url} inside bundle descriptors module-context.xml). But at this juncture, I can't even get a properties file to be read in a Plan file.Code:<SPDE0006E> Hot re-deploy failed for resource '/home/daniel/Desktop/springsource-dm-server-2.0.0.M2/pickup/vehicle_wproperties.plan'. java.lang.RuntimeException: Failed to read plan descriptor at com.springsource.kernel.repository.plan.PlanReader.read(PlanReader.java:81) at com.springsource.kernel.deployer.app.PlanApplication.<init>(PlanApplication.java:80) at com.springsource.kernel.deployer.app.PlanApplicationFactory.create(PlanApplicationFactory.java:105) at com.springsource.kernel.deployer.core.internal.StandardApplicationDeployer.createDeployableArtefact(StandardApplicationDeployer.java:540) at com.springsource.kernel.deployer.core.internal.StandardApplicationDeployer.deploy(StandardApplicationDeployer.java:377) 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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58) at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy98.deploy(Unknown Source) at com.springsource.kernel.deployer.hot.HotDeploymentFileSystemListener.deploy(HotDeploymentFileSystemListener.java:191) at com.springsource.kernel.deployer.hot.HotDeploymentFileSystemListener.onChange(HotDeploymentFileSystemListener.java:91) at com.springsource.util.io.FileSystemChecker.notifyListeners(FileSystemChecker.java:182) at com.springsource.util.io.FileSystemChecker.check(FileSystemChecker.java:145) at com.springsource.kernel.io.fs.WatchTask.run(WatchTask.java:67) at java.lang.Thread.run(Thread.java:619) Caused by: org.xml.sax.SAXParseException: cvc-pattern-valid: Value '${plan.version}' is not facet-valid with respect to pattern '[\[\(]{1}( )*(\d(.\d(.\d(.([\w_-])+)?)?)?)( )*,( )*(\d(.\d(.\d(.([\w_-])+)?)?)?)( )*[\]\)]{1}|\d(.\d(.\d(.([\w_-])+)?)?)?' for type '#AnonType_versionartifactType'. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:410) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3165) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(XMLSchemaValidator.java:2748) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2685) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2037) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.emptyElement(XMLSchemaValidator.java:705) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:377) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283) at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124) at com.springsource.kernel.repository.plan.PlanReader.readDocument(PlanReader.java:89) at com.springsource.kernel.repository.plan.PlanReader.read(PlanReader.java:77) ... 28 more


