Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Monitoring Directories Using Spring Integration(Trying to monitor a directory in a Virgo web app. None of the Spring Integration examples seem to work)
Monitoring Directories Using Spring Integration [message #976551] Thu, 08 November 2012 12:13 Go to next message
David Bohlin is currently offline David Bohlin
Messages: 3
Registered: November 2012
Junior Member
I am working on a project that requires a directory to be monitored and files to be processed from that directory. I am very new to the Spring/Virgo environment, but the examples seem reasonably straight forward. The unfortunate part is nothing seems to work.

I have imported the Spring Integration file and core packages as both bundles and packages, and I have created a Handler class and a DirectoryScanner class. I then created an xml file that I placed in the META-INF /spring directory with this format:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="..www.springframework.org/schema/beans"
xmlns:xsi="../www.w3.org/2001/XMLSchema-instance"
xmlns:integration="..www.springframework.org/schema/integration"
xmlns:file="..www.springframework.org/schema/integration/file"
xsi:schemaLocation="../www.springframework.org/schema/beans
../www.springframework.org/schema/beans/spring-beans.xsd
../www.springframework.org/schema/integration
../www.springframework.org/schema/integration/spring-integration.xsd
../www.springframework.org/schema/integration/file
../www.springframework.org/schema/integration/file/spring-integration-file.xsd">


<file:inbound-channel-adapter id="filesIn"
directory="file:/tmp/input">
<integration:poller>
<integration:interval-trigger interval="5000"/>
</integration:poller>
</file:inbound-channel-adapter>

<file:outbound-channel-adapter id="filesOut"
directory="/tmp/output"
delete-source-files="true"/>

<integration:service-activator input-channel="filesIn"
output-channel="filesOut"
ref="handler" method="processFile"/>

<bean id="handler" class="com.company.Handler"/>

</beans>

Our maven environment processes this fine. The plan is deployed to the Virgo server the Virgo server loads without complaint. However, nothing is there. I search for any of the controls in the logs and there is no mention of integration, handler, poller. Nothing.

I have a feeling that I have missed something in my setup, but I have not been able to figure out what.

If anyone can point me in the direction of where I have gone wrong or if there is a better way to monitor a directory in a Virgo environment I would be very interested.

Thank you in advance for any help.
Re: Monitoring Directories Using Spring Integration [message #977144 is a reply to message #976551] Thu, 08 November 2012 23:09 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 268
Registered: January 2010
Senior Member
Hello David,

What version of virgo are you using?

Few questions:
1. can you please post your MANIFEST.MF
2. how do you deploy this component? As a bundle or as part of a web-app
3. what logs do you search and what do you expect to see? Can you please attach virgo log file with a clean deployment of this component?
4. what is the directory structure of your component (i.e. jar -tf your.jar/war)

There could be 100's of reasons. Given above information we could narrow it down to much smaller set Smile

Thanks
Dmitry
Re: Monitoring Directories Using Spring Integration [message #977228 is a reply to message #977144] Fri, 09 November 2012 00:43 Go to previous messageGo to next message
David Bohlin is currently offline David Bohlin
Messages: 3
Registered: November 2012
Junior Member
Thank you Dimitry for responding.

We are using version 3.5 of Virgo and 2.0.6 of spring integration and 3.0.5 of spring framework

We are deploying a web app with a number of bundles attached to it using maven. The .mf file I have for this component is:

Bundle-ManifestVersion: 2
Bundle-Name: Project Filestore Subsystem
Bundle-SymbolicName: company.subsysem.filestore
Bundle-Vendor: Company
Import-Bundle:
org.springframework.integration.file;version="[2.0.0, 2.0.7)",
org.springframework.integration.core;version="[2.0.0, 2.0.7)"
Import-Library:
org.springframework.spring;version="[3.0, 3.5)",
org.aspectj;version="[1.6.0,1.7.0)";resolution:="optional"
Import-Package:
org.aspectj.lang;version="[1.6.0,1.7.0)";resolution:="optional",
org.aspectj.runtime.reflect;version="[1.6.0,1.7.0)";resolution:="optional"
Excluded-Imports:
org.springframework.test.*,
org.junit.*

I believe this is being deployed as a bundle, but I am not sure. I looked at the plan and it is being deployed as an artifact type"bundle" though that was not true when I first posted this.

The log file that I am reading is the one located at virgo/serviceability/logs/log.log and currently I have an error of

[2012-11-08 22:12:38.751] ERROR fs-watcher org.eclipse.virgo.medic.eventlog.default HD0003E Hot re-deploy failed for file 'project.plan'. org.eclipse.virgo.kernel.deployer.core.DeploymentException: Unable to satisfy dependencies of bundle 'company.subsystems.filestore' at version '1.0.0.SNAPSHOT': Import-Bundle with symbolic name 'org.springframework.integration.core' in version range '[2.0.0, 2.0.7)' could not be satisfied
at org.eclipse.virgo.kernel.deployer.core.internal.ImportExpandingTransformer.expandImports(ImportExpandingTransformer.java:116)
at org.eclipse.virgo.kernel.deployer.core.internal.ImportExpandingTransformer$ImportExpandingGraphVisitor.visit(ImportExpandingTransformer.java:80)
at org.eclipse.virgo.util.common.ThreadSafeGraphNode.visitInternal(ThreadSafeGraphNode.java:193)
at org.eclipse.virgo.util.common.ThreadSafeGraphNode.visitInternal(ThreadSafeGraphNode.java:197)
at org.eclipse.virgo.util.common.ThreadSafeGraphNode.visit(ThreadSafeGraphNode.java:184)
at org.eclipse.virgo.kernel.deployer.core.internal.ImportExpandingTransformer.transform(ImportExpandingTransformer.java:58)
at org.eclipse.virgo.kernel.install.pipeline.stage.transform.internal.TransformationStage.doProcessGraph(TransformationStage.java:54)
at org.eclipse.virgo.kernel.install.pipeline.stage.AbstractPipelineStage.process(AbstractPipelineStage.java:41)
at org.eclipse.virgo.kernel.install.pipeline.internal.StandardPipeline.doProcessGraph(StandardPipeline.java:62)
at org.eclipse.virgo.kernel.install.pipeline.internal.CompensatingPipeline.doProcessGraph(CompensatingPipeline.java:73)
at org.eclipse.virgo.kernel.install.pipeline.stage.AbstractPipelineStage.process(AbstractPipelineStage.java:41)
at org.eclipse.virgo.kernel.install.pipeline.internal.StandardPipeline.doProcessGraph(StandardPipeline.java:62)
at org.eclipse.virgo.kernel.install.pipeline.stage.AbstractPipelineStage.process(AbstractPipelineStage.java:41)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.driveInstallPipeline(PipelinedApplicationDeployer.java:360)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.doInstall(PipelinedApplicationDeployer.java:184)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.install(PipelinedApplicationDeployer.java:139)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.deploy(PipelinedApplicationDeployer.java:252)
at org.eclipse.virgo.kernel.deployer.hot.HotDeploymentFileSystemListener.deploy(HotDeployerFileSystemListener.java:163)
at org.eclipse.virgo.kernel.deployer.hot.HotDeploymentFileSystemListener.onChange(HotDeployerFileSystemListener.java:70)
at org.eclipse.virgo.util.io.FileSystemChecker.notifyListeners(FileSystemChecker.java:245)
at org.eclipse.virgo.util.io.FileSystemChecker.check(FileSystemChecker.java:166)
at org.eclipse.virgo.kernel.deployer.hot.WatchTask.run(WatchTask.java:48)
at java.lang.Thread.run(Thread.java:679)
Caused by: org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'company.subsystems.filestore' at version '1.0.0.SNAPSHOT': Import-Bundle with symbolic name 'org.springframework.integration.core' in version range '[2.0.0, 2.0.7)' could not be satisfied
at org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler.getBundlePackageImports(ImportExpansionHandler.java:272)
at org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler.getAdditionalPackageImports(ImportExpansionHandler.java:236)
at org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler.expandImports(ImportExpansionHandler.java:207)
at org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler.expandImportsIfNecessary(ImportExpansionHandler.java:175)
at org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler.expandImports(ImportExpansionHandler.java:113)
at sun.reflect.GeneratedMethodAccessor61.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
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.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
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 $Proxy40.expandImports(Unknown Source)
at org.eclipse.virgo.kernel.deployer.core.internal.ImportExpandingTransformer.expandImports(ImportExpandingTransformer.java:107)
... 22 common frames omitted


Which probably has to do with how I have the manifest setup, but I am not sure. I came across this issue earlier, and found a blog that helped me fix it. However, I cannot find that article now.

jar file structure is like this:

META-INF/
META-INF/MANIFEST.MF
com/
com/company/
com/company/project/
com/company/project/subsystems/
com/company/project/subsystems/filestore/
META-INF/spring/
com/compnay/project/subsystems/filestore/FilestoreSubsystemImpl.class
com/company/project/subsystems/filestore/Handler.class
com/compnay/project/subsystems/filestore/FilestoreValidatorImpl.class
META-INF/spring/module-context.xml
META-INF/spring/osgi-context.xml
META-INF/maven/
META-INF/maven/company.project.subsystems/
META-INF/maven/company.project.subsystems/filestore/
META-INF/maven/company.project.subsystems/filestore/pom.xml
META-INF/maven/company.project.subsystems/filestore/pom.properties

I know this is a rather open question, and there are a lot of different issues going on here, but you know how it is... Become a subject matter expert in 4 weeks and get it all done in 6.

Thanks for any help or suggestions. If there is anything else I can provide I will try to do so.
Re: Monitoring Directories Using Spring Integration [message #978116 is a reply to message #977228] Fri, 09 November 2012 16:20 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 268
Registered: January 2010
Senior Member
I think this should give you a clue.

Caused by: org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'company.subsystems.filestore' at version '1.0.0.SNAPSHOT': Import-Bundle with symbolic name 'org.springframework.integration.core' in version range '[2.0.0, 2.0.7)' could not be satisfied


You are missing a required dependency.

Take a look at the docs for help with deployment

Dmitry

[Updated on: Fri, 09 November 2012 16:22]

Report message to a moderator

icon14.gif  Re: Monitoring Directories Using Spring Integration [message #978137 is a reply to message #978116] Fri, 09 November 2012 16:42 Go to previous message
David Bohlin is currently offline David Bohlin
Messages: 3
Registered: November 2012
Junior Member
Thanks Dimitry,

That got me looking in the right place. I found that I had some issues with the module.xml file and had some legacy that wasn't clean out completely. I had to scrub everything clean and restart, but it is all working now.

Thank you
Previous Topic:Books you should read about OSGi
Next Topic:Blueprint problem after moving from 3.5.0.M03 to 3.5.0.RELEASE or 3.6.0.M03
Goto Forum:
  


Current Time: Thu Apr 17 05:48:54 EDT 2014

Powered by FUDForum. Page generated in 0.01704 seconds