Error in dataView creation


I am new to Apama and trying to create a DataView from my monitor code in the Apama community edition.
I added the “DataView Service” EPL bundle while creating my project, and wrote the following code:

com.apama.dataview.DataViewAddDefinition add := new com.apama.dataview.DataViewAddDefinition;
add.dvDescription := “Test DataView”;
add.dvDisplayName := “TestDView”;
add.dvName := “TestDView”;
add.fieldNames := [“CTY”,“ARA”,“STT”];
add.fieldTypes := [“string”,“string”,“string”];
route add;

Then I added a DataView Item.

Now, when I use the engine_inject tool to load my monitor, it gives me the following error:
dataview not found within namespace com.apama

Got a similar error for the File Adapter while using events like OpenFileForReading etc. Error says:
file not found within namespace com.apama

This should not happen since I already added the DataView service bundle and File Adpater. Please suggest.



The engine_inject errors you’re seeing are because you’ve injected your application .mon files but not the .mon files in the bundle(s) such as the dataview service and file adapter.

If you start your project using Software AG Designer (where you added the bundles) these will be injected automatically.

However if you want to start it outside Designer you need to either do it manually (engine_inject each of the .mon files shown by Designer under EPL bundles) or (more simply) use the engine_deploy tool to inject the whole project - see Either use engine_deploy --inject if you want to just inject the your .mon files associated with your project into a running correlator without copying/moving them, or (as you’d do when moving to UAT testing/production) use --outputDeployDir to generate a new separate directory with a copy of the project assets and yaml files that can be passed to the correlator with --config to inject everything.

Hope that helps!

By the way, our recommended place to ask apama questions like this is now stackoverflow; see