Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "SMILA/FAQ"

(I implemented/deployed a Processing Service in a new bundle but SMILA log says that it couldn't be found)
 
(69 intermediate revisions by 11 users not shown)
Line 2: Line 2:
  
 
'''General Hint:''' When you have problems during a SMILA launch / run, please have a look at the '''SMILA log''' file first. (<tt><SMILA>/SMILA.log</tt>)
 
'''General Hint:''' When you have problems during a SMILA launch / run, please have a look at the '''SMILA log''' file first. (<tt><SMILA>/SMILA.log</tt>)
 +
 +
== General ==
 +
 +
=== Where do I find the log file? ===
 +
 +
The SMILA log file's name is <tt>SMILA.log</tt> and is to be found at the applications working folder:
 +
 +
If you extracted SMILA from a zip, you can find the log file in the folder, where you extracted the SMILA.
 +
<pre>
 +
/<SMILA>
 +
  ...
 +
  SMILA.log
 +
  ...
 +
</pre>
 +
 +
If you started SMILA from within the Eclipse IDE using the launcher, you can find the log file at the project <tt>SMILA.application</tt> in your workspace.
 +
 +
=== How can I see that SMILA started correctly? ===
 +
 +
1. Open your browser at <code>http://localhost:8080/smila</code>, you should see a system state overview and links to different APIs.
 +
 +
2. You should see no stacktraces in the log ;) and it should end with an entry like the following if SMILA has just started:
 +
 +
<pre>
 +
... INFO  ... internal.HttpServiceImpl    - HTTP server started successfully on port 8080.
 +
</pre>
  
 
== Building SMILA ==
 
== Building SMILA ==
Line 9: Line 35:
 
While building with <tt>SMILA.builder</tt> I receive the following errror message:  
 
While building with <tt>SMILA.builder</tt> I receive the following errror message:  
  
<code>Build Failed - Out of Memory - Java heap space</code>
+
<pre>
 +
Build Failed - Out of Memory - Java heap space
 +
</pre>
  
 
The reason for this is that Ant hasn´t enough heap space to build the project. You will have to expand the heap space by setting the VM arguments accordingly. In eclipse try the following:
 
The reason for this is that Ant hasn´t enough heap space to build the project. You will have to expand the heap space by setting the VM arguments accordingly. In eclipse try the following:
Line 17: Line 45:
 
# Save and build again.
 
# Save and build again.
  
 +
=== Build fails with 'java.net.MalformedURLException: no protocol: ${eclipseBaseURL}' message ===
 +
 +
The complete error looks like this:
 +
 +
<pre>
 +
...
 +
build.core:
 +
    ...
 +
    [java] BUILD FAILED
 +
    [java] /home/scum36/Eclipse/helios-sr2-build/plugins/org.eclipse.pde.build_3.6.2.R36x_20110203/scripts/productBuild/productBuild.xml:33: The following error occurred while executing this line:
 +
    [java] /home/scum36/Eclipse/helios-sr2-build/plugins/org.eclipse.pde.build_3.6.2.R36x_20110203/scripts/build.xml:53: The following error occurred while executing this line:
 +
    [java] /home/scum36/workspace/SMILA/SMILA.builder/customTargets.xml:80: The following error occurred while executing this line:
 +
    [java] /home/scum36/workspace/SMILA/SMILA.builder/customTargets.xml:25: java.net.MalformedURLException: no protocol: ${eclipseBaseURL}
 +
    [java]
 +
    [java] Total time: 0 seconds
 +
    [java] An error has occurred. See the log file
 +
    [java] /home/scum36/workspace/.metadata/.log.
 +
</pre>
 +
 +
 +
Probably you did forget to copy <code>build.properties.template</code> to <code>build.properties</code> in <code>SMILA.builder</code> and adapt it. See
 +
[http://wiki.eclipse.org/SMILA/Development_Guidelines/Howto_build_a_SMILA-Distribution How to build SMILA].
  
 
== Launching SMILA ==
 
== Launching SMILA ==
  
=== Bundles ===
+
=== Linux ===
  
==== Launching crawler bundles - How do I overcome the ''Could not find crawler id'' error message? ====
+
==== How to start/stop and manage SMILA as a background process on a Linux machine? ====
 +
Since the default configuration (stored in SMILA.ini) of the OSGi runtime (in our case Equinox) launcher expects that you execute it in foreground and therefore have an OSGi console running in your shell and listening to the standard input, the first thing we have to do is to advise the launcher (and thereby Equinox) to listen on some TCP port instead. This is done by adding a new line with the port number just after the "-console" line.
  
While launching SMILA I receive the following error message:
+
For example, to set console to listen at TCP port 9999, SMILA.ini would look like this:
 +
<pre>
 +
-console
 +
9999
 +
...
 +
</pre>
 +
Now, after SMILA has been started with “<tt>$ nohup ./SMILA &</tt>”, the console can be accessed from any computer simply by opening a telnet session:
  
<code>Could not find crawler id</code>
+
<pre>
 +
$ telnet <smila_host_name> <console_port>
 +
</pre>
  
If you started '''<tt>SMILA.launch</tt>''' to launch SMILA: The launcher didn't start your new crawler bundle. Try this:
 
  
# Add your bundle by selecting "Open Run dialog" in eclipse and choose your SMILA profile.
+
{| style="border:1px solid #AAA; background:#f9f9f9; width:100%; margin:0 auto 1em auto; padding:.2em; text-align:justify;{{{extra|}}}"
 +
|style="width:{{{l-width|50px;}}}"| {{{image|[[Image:Symbol comment vote.png|50px]]}}}
 +
|style="padding-left:.2em;"| {{{text|{{{1|If you are logged in via telnet and just want to close this connection and not to stop Equinox running SMILA, than just type “<tt>disconnect</tt>”. Otherwise, if you want to stop SMILA and close the connection, use “<tt>close</tt>” - as you normally would do on a console running in your shell.
 +
}}}}}}
 +
|}
 +
 
 +
=== Bundles ===
 +
 
 +
==== new bundle was not started  ====
 +
 
 +
After launching SMILA my new bundle doesn't seem to be started.
 +
 
 +
If you started '''<tt>SMILA.launch</tt>''' in eclipse to launch SMILA: The launcher didn't start your new bundle. Try this:
 +
 
 +
# Add your bundle by selecting "Run Configurations" in eclipse and choose your SMILA profile.
 
# Select your bundle in the list and set the checkmark.
 
# Select your bundle in the list and set the checkmark.
 
# Set the start level to "4" and the autostart to "true".
 
# Set the start level to "4" and the autostart to "true".
Line 37: Line 109:
  
 
<ol>
 
<ol>
<li>Open the file <tt>config.ini</tt> and add your bundle as show below:<br>
+
<li>Open the file <tt>configuration/config.ini</tt> and add your bundle as shown below:<br>
<code>org.eclipse.smila.connectivity.framework.crawler.owncrawler@5:start, \</code></li>
+
<pre>org.eclipse.smila.connectivity.framework.crawler.owncrawler@5:start, \
 +
</pre></li>
 
<li>Open the <tt>build.properties</tt> file of your bundle and include the folders <tt>schemas/</tt>, <tt>OSGI-INF/</tt>, and the file <tt>plugin.xml</tt>.</li>
 
<li>Open the <tt>build.properties</tt> file of your bundle and include the folders <tt>schemas/</tt>, <tt>OSGI-INF/</tt>, and the file <tt>plugin.xml</tt>.</li>
 
</ol>
 
</ol>
 
==== I changed the implementation of a bundle, deployed it and restarted SMILA, but SMILA still seems to use the old bundle ====
 
 
Close SMILA, delete the following directories in your configuration folder and restart SMILA again:
 
* <tt>org.eclipse.core.runtime/</tt>
 
* <tt>org.eclipse.equinox.app/</tt>
 
* <tt>org.eclipse.osgi/</tt>
 
* <tt>org.eclipse.update/</tt>
 
  
 
==== I changed bundle settings in my <tt>config.ini</tt>, but after SMILA restart nothing changed ====
 
==== I changed bundle settings in my <tt>config.ini</tt>, but after SMILA restart nothing changed ====
  
Check your <tt>config.ini</tt> for unusual whitespaces (e.g. a tab) between the (edited) bundle entries - and remove them.  
+
Check your <tt>config.ini</tt> for unusual whitespaces (e.g. a tab) between the (edited) bundle entries or after the backslashes on line ends - and remove them.  
  
 
If that doesn't help, see question (resp. answer) before.
 
If that doesn't help, see question (resp. answer) before.
  
 +
== Configuring/Running SMILA ==
  
=== JConsole ===
+
=== Basics ===
  
==== Why is the ''SMILA'' package not in the JConsole tree? ====
+
==== How do I change the HTTP port of SMILA? ====
  
I've started <tt>SMILA.exe</tt> but the SMILA package isn't in the tree of JConsole.
+
The HTTP port is configured in fie <tt>configuration/org.eclipse.smila.clusterconfig.simple/clusterconfig.json</tt>. Change it there and restart SMILA.
  
To solve this try the following:
+
See [[SMILA/Documentation/JettyHttpServer#Setting_the_HTTP_port]] for details.
  
# Create a new connection.
+
=== Crawler ===
# Change your connection by setting the port "9004" on the ''Remote'' tab.
+
# Click the ''Connect'' button, switch to the ''MBeans'' tab, and check the tree again.
+
  
==== Why is the ''SMILA/CrawlerController'' MBean not in the JConsole tree? ====
+
==== I started a crawl job, the job was started successfully, but nothing seems to happen ====
  
Check if all needed bundles are active. Open the equinox console and type:
+
Check the SMILA log file for errors.
* <tt>ss crawler</tt>
+
* <tt>ss deltaindexing.impl</tt>
+
  
If one of these is not active:
+
Check the state of the crawl job in [http://localhost:8080/smila/jobmanager/jobs jobmanager state API]
* check the <tt>configuration/config.ini</tt>
+
* if the state in your crawl job is "RUNNING", check the mode it has been started
* check the log file for errors
+
** if it says {{code|"mode": "STANDARD"}}, stop the job run ({{code|POST http://localhost:8080/smila/jobmanager/jobs/<job name>/<job run id>/finish}}) and start it again with mode "runOnce", e.g. {{code|POST http://localhost:8080/smila/jobmanager/jobs/<job name> {"mode": "runOnce"}}}
 +
* if the state is FINISHING
 +
** check the job into which the crawl job pushes its records for processed records or errors.
 +
* if everything up to now is OK
 +
** just wait some time, the autocommit handler maybe hasn't yet committed the data to the Solr index
 +
** check {{code|autoCommit}} settings in the <tt>solrconfig.xml</tt> file of your Solr core.
  
 +
=== Pipeline ===
  
 +
==== Why do I get a timeout exception during a (long running) pipeline execution? ====
  
== Configuring/Running SMILA ==
+
In SMILA there's a timeout configured for a pipeline execution:
 +
: <tt>configuration/org.eclipse.smila.processing.bpel/processor.properties</tt>
 +
See entry: <code>pipeline.timeout</code>
  
=== Crawler ===
+
==== My xpath expression doesnt work ====
 +
# Check that the expression is correct with a XPath tool
 +
# ensure that the attributes are not filtered out, see [[SMILA/Documentation/HowTo/How_to_filter_and_access_record_data_in_BPEL]]
  
==== I tried to crawl/index a data source, JConsole says "Crawl ... sucessfully started" but nothing seem to happen ====
+
'''Helpful log points'''
 +
{{CTable}}
 +
| Area || id || level || Comment
 +
|-
 +
| BPEL || org.eclipse.smila.processing.bpel.activities.PipeletManager  || debug || Log BPEL request XML before and after pipelet invocation. Note: this contains the XML for the records but only their filtered version.
 +
|-
 +
| BPEL || org.eclipse.smila.processing.bpel.activities.PipeletManager  || trace|| Log full XML of records after pipelet invocation. Note: this is the real thing unfiltered.
 +
|-
 +
| BPEL || org.eclipse.smila.processing.bpel.BpelWorkflowProcessor  || trace|| Log full XML of records going into and out of a pipeline.
 +
|}
  
Check if your queue is receiving records:
+
== Implementing Pipelets / OSGi Services / Bundles ==
# Open the JConsole's MBeans tab and go to: <code>org.apache.activemq/localhost/Queue/<queue>/Attributes</code>
+
# if <code>EnqueueCount</code> is increased your queue is receiving records, so it's not a crawler issue.
+
  
If your queue didn't receive any records from the crawler:
+
=== Pipelets ===
# Did you crawl the data source before? If so, try a <code>clearAll</code> on the DeltaIndexing-MBean in your JConsole
+
# Check your crawler configuration file (see <tt>configuration/org.eclipse.smila.connectivity.framework/</tt>)
+
# Check the queue routing configuration: <tt>org.eclipse.smila.connectivity.queue.worker/QueueWorkerRouterConfig.xml</tt>
+
# Check the queue connection: <tt>org.eclipse.smila.connectivity.queue.worker/QueueWorkerConnectionConfig.xml</tt>
+
# If queue is running in a separate SMILA instance (e.g. on another PC), make sure that "Queue-SMILA" is started before "Crawler-SMILA"
+
  
 +
==== I want to use the <code>ConfigUtils</code> class in my Pipelet to read the configuration, where do I have to put my configuration files? ====
  
=== Pipeline ===
+
Configuration files are searched for in the following order:
 +
# <tt><SMILA>/configuration/<bundle-name>/<config-file></tt>
 +
# <tt><config-file></tt> in the root path of the bundle jar-file
  
==== Why do I get a timeout exception during a (long running) pipeline execution? ====
+
See [[SMILA/Project_Concepts/Simple_configuration_handler|Configuration Handler]] for more information.
  
In SMILA there's a timeout configured for a pipeline execution:
+
==== I get classloading errors in invocations of my own Pipelet when running SMILA outside the IDE. In the IDE it works ====
: <tt>configuration/org.eclipse.smila.processing.bpel/processor.properties</tt>
+
See entry: <code>pipeline.timeout</code>
+
  
 +
The error could look like this:
  
=== Lucene Indexing / Search ===
+
<pre>
 +
2010-11-19 11:28:36,101 ERROR [ODEServerImpl-1
 +
]  vpu.JacobVPU                                  - Method "run" in class "org.apache.ode.bpel.rtrep.v2.EXTENSIONACTIVITY" threw an unexpected exception.
 +
java.lang.LinkageError: loader constraint violation: loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) previously initiated loading for a different type with name "org/w3c/dom/Document"
 +
</pre>
  
==== How can I browse/search an existing Lucene index without SMILA (for debug purposes)? ====
+
We are not completely sure, why this happens, but a solution is to set this system property in the SMILA.ini file:
  
Try [http://www.getopt.org/luke/ LUKE]
+
<pre>-Dosgi.java.profile.bootdelegation=override</pre>
  
==== Why are attributes in my Lucene index missing / permuted? ====
+
Thanks to Bogdan Sacaleanu for the solution. See this [http://smila.markmail.org/thread/sj4vhcikq2wndtdp thread in the smila-dev mailing list] for additional details.
  
Open your configuration files:
+
=== OSGI-Services / Workers ===
* <tt>configuration/org.eclipse.smila.lucene/Mappings.xml</tt>
+
* <tt>configuration/org.eclipse.smila.search.datadictionary/DataDictionary.xml</tt>
+
  
Check:
+
==== I implemented/deployed an OSGi Service but it seems that it isn't activated  ====
* if all index fields are specified in these two files
+
* if the field numbers are compatible to each other
+
  
Still the same problem?
+
Check your bundle, it should contain a file like that:  
* Close SMILA, remove file (if exists): <tt>workspace/org.eclipse.smila.search.datadictionary/DataDictionary.xml</tt> and restart SMILA
+
  
==== SMILA doesn't return search results, although I see appropriate entries for my query in the Lucene index ====
+
<pre>OSGI-INF/&lt;myService&gt;.xml</pre>
  
Open the file: <tt>configuration/org.eclipse.smila.search.datadictionary/DataDictionary.xml</tt>
+
In this file your service has to be referenced.  
* Check the <code>Constraint</code> entries for all fields: All fields that are set <code>required</code> must contain the query string!
+
* the component name in the root element must be unique
 +
* the implementing class must not be abstract and must not be an interface
  
Still problems? Try removing the workspace version of that file if it exists:
+
The file has to be referenced in the META-INF / MANIFEST.MF file of your bundle as a service component:  
* Close SMILA, remove <tt>workspace/org.eclipse.smila.search.datadictionary/DataDictionary.xml</tt>, and restart SMILA.
+
  
 +
<pre>Service-Component: OSGI-INF/&lt;myService&gt;.xml</pre>
  
== Implementing Pipelets / Processing Services / Bundles ==
+
On the "Build" page of the manifest editor, you must add the OSGI-INF directory to the binary build.
  
=== Configuration ===
+
And finally, your bundle has to be started at SMILA launch, by adding it to the <tt>configuration/config.ini
 +
<pre>
 +
...
 +
&lt;bundle-id&gt;@4:start,
 +
...
 +
</pre>
  
==== I want to use the <code>ConfigUtils</code> class in my Processing Service to read the configuration, where do I have to put my configuration files? ====
+
If you are using '''<tt>SMILA.launch</tt>''' to launch SMILA in eclipse IDE, you have to open the run/debug configuration of SMILA, check the new bundle and set Auto-Start to "true".
  
Configuration files are searched for in the following order:
+
If you checked all the things above and it still doesn't work:  
# <tt><SMILA>/configuration/<bundle-name>/<config-file></tt>
+
 
# <tt><config-file></tt> in the root path of the bundle jar-file
+
*Implement an <tt>activate()</tt> method in your service - if not already there, and check if it's called at startup.
 +
*If your service depends on other services, check if those are activated
 +
*If your service uses other services, check the naming of the set/unset methods in the Java code vs. those specified in the <tt>&lt;myService&gt;.xml</tt>
 +
*If your services uses 3rd-party-jars, make sure that they are specified in the <tt>Bundle-ClassPath</tt> section of your MANIFEST.MF (Do not reference the lib folder here, instead reference all jars, e.g. <tt>Bundle-ClassPath: ., &lt;lib1.jar&gt;, &lt;lib2.jar&gt;</tt>). Make also sure, that they are added to the binary build ("Build" page of the manifest editor).
 +
*If your service has super-classes you may need to include <tt>Import-Package:</tt> declarations of the super-classes in your service implementation class even if there are no compile errors.
 +
*Use the OSGi console, e.g. via: <tt>telnet &lt;host&gt; 9005</tt>  
 +
**<tt>ss &lt;bundle-ID&gt;</tt> - check if your bundle is in the list and ACTIVE (the bundle-ID is the "Bundle-SymbolicName" from the MANIFEST.MF)
 +
***if it isn't in the list, the bundle is not correctly deployed
 +
***if it isn't ACTIVE but only RESOLVED it's not started (-&gt; see hints above)
 +
**<tt>bundle &lt;id&gt;</tt> - check if your service is listed here in the "Registered Services" section (the "id" can be taken from the "ss" output)
 +
***if it isn't there, your service is not correctly deployed (-&gt; check all points above)
 +
 
 +
==== My activate() / deactivate() method isn't called ====
 +
 
 +
Check that your activate/deactivate method is <tt>protected</tt> or <tt>public</tt>.
 +
 
 +
If you use activate()/deactivate() methods without (ComponentContext) parameter, make sure that your service description xml file contains scr namespace:
 +
 
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" ...
 +
</pre>
 +
 
 +
==== I implemented a worker, everything seems fine, but the worker processes no tasks during the job run ====
 +
 
 +
Make sure that your worker is actually running.
 +
 
 +
In the REST API, the worker description must be found via:  <tt>http://localhost:8080/smila/jobmanager/workers</tt>
 +
 
 +
Check also if your worker is really started via debug API:  <tt>http://localhost:8080/smila/debug</tt>
 +
 
 +
A warning is shown here, if your worker coudn't be found, e.g.:
 +
<pre>
 +
  ...
 +
  name: "myWorker",
 +
  WARNING: "Worker is not registered in WorkerManager. Maybe worker OSGI service isn't started or worker's name setting is inconsistent."
 +
  ...
 +
</pre>
 +
 
 +
If you get something like this, try to check FAQ for implementing an OSGI service above.
 +
 
 +
=== General ===
 +
 
 +
==== I get classloading errors when I try to access an external Web Service using JAX-WS ====
  
 +
Class loading problems often occur when using third party libraries that use the "thread context classloader" in OSGi, and standard implementations of Java specifications by Sun/Oracle (or other non-OSGi-aware parties...) do this very often.
  
=== Deploy / Launch ===
+
The only solution we currently know of is to wrap the critical section (in this case it's the construction of the webservice client class) in a piece of code like this:
  
==== I implemented/deployed a Processing Service in a new bundle but SMILA log says that it couldn't be found ====
+
<pre>
 +
ClassLoader tccl = Thread.currentThread().getContextClassLoader();
 +
try {
 +
    Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
 +
    /*
 +
    * initialize the client
 +
    */
 +
} finally {
 +
    Thread.currentThread().setContextClassLoader(tccl);
 +
}
 +
</pre>
  
Check your new bundle, it should contain a file like that:
+
See also [http://www.eclipse.org/forums/index.php/t/266362/ this forum thread].
  
* <tt>OSGI-INF/<myService>.xml</tt>
 
  
In this file your new processing service has to be referenced. Also the file has to be referenced from the MANIFEST.MF file of your bundle as a service component.
+
==== More classloader errors ====
  
* <tt>Service-Component: OSGI-INF/<myService>.xml</tt>
+
If you get an error like this:
  
And finally, your bundle has to started at SMILA launch, e.g. by adding it to the config.ini.
+
<pre>
 +
Caused by: java.lang.LinkageError: loader constraint violation: when resolving field "DATETIME" the class loader (instance of
 +
org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) of the referring class, javax/xml/datatype/DatatypeConstants, and the class loader (instance of <bootloader>) for the field's resolved type, javax/xml/namespace/QName, have different Class objects for that type
 +
</pre>
  
 +
the reason is most likely that you have classes in the bundle classpath of your bundle that contains classes which are also part of the JDK runtime library (java.*, javax.*). Remove these classes from the bundle and it should work.
  
 +
See also [http://www.eclipse.org/forums/index.php/t/266362/ this forum thread].
  
 
[[Category:SMILA]]
 
[[Category:SMILA]]

Latest revision as of 12:22, 25 February 2016

This pages contains the frequently asked questions of the SMILA project.

General Hint: When you have problems during a SMILA launch / run, please have a look at the SMILA log file first. (<SMILA>/SMILA.log)

Contents

General

Where do I find the log file?

The SMILA log file's name is SMILA.log and is to be found at the applications working folder:

If you extracted SMILA from a zip, you can find the log file in the folder, where you extracted the SMILA.

/<SMILA>
  ...
  SMILA.log
  ...

If you started SMILA from within the Eclipse IDE using the launcher, you can find the log file at the project SMILA.application in your workspace.

How can I see that SMILA started correctly?

1. Open your browser at http://localhost:8080/smila, you should see a system state overview and links to different APIs.

2. You should see no stacktraces in the log ;) and it should end with an entry like the following if SMILA has just started:

... INFO  ... internal.HttpServiceImpl    - HTTP server started successfully on port 8080.

Building SMILA

I receive an Out of Memory error? What can I do?

While building with SMILA.builder I receive the following errror message:

Build Failed - Out of Memory - Java heap space

The reason for this is that Ant hasn´t enough heap space to build the project. You will have to expand the heap space by setting the VM arguments accordingly. In eclipse try the following:

  1. Click Open external tools dialog and select your Ant build profile.
  2. Switch to the JRE tab and add the following VM arguments: -Xms40m -Xmx512m.
  3. Save and build again.

Build fails with 'java.net.MalformedURLException: no protocol: ${eclipseBaseURL}' message

The complete error looks like this:

...
build.core:
     ...
     [java] BUILD FAILED
     [java] /home/scum36/Eclipse/helios-sr2-build/plugins/org.eclipse.pde.build_3.6.2.R36x_20110203/scripts/productBuild/productBuild.xml:33: The following error occurred while executing this line:
     [java] /home/scum36/Eclipse/helios-sr2-build/plugins/org.eclipse.pde.build_3.6.2.R36x_20110203/scripts/build.xml:53: The following error occurred while executing this line:
     [java] /home/scum36/workspace/SMILA/SMILA.builder/customTargets.xml:80: The following error occurred while executing this line:
     [java] /home/scum36/workspace/SMILA/SMILA.builder/customTargets.xml:25: java.net.MalformedURLException: no protocol: ${eclipseBaseURL}
     [java] 
     [java] Total time: 0 seconds
     [java] An error has occurred. See the log file
     [java] /home/scum36/workspace/.metadata/.log.


Probably you did forget to copy build.properties.template to build.properties in SMILA.builder and adapt it. See How to build SMILA.

Launching SMILA

Linux

How to start/stop and manage SMILA as a background process on a Linux machine?

Since the default configuration (stored in SMILA.ini) of the OSGi runtime (in our case Equinox) launcher expects that you execute it in foreground and therefore have an OSGi console running in your shell and listening to the standard input, the first thing we have to do is to advise the launcher (and thereby Equinox) to listen on some TCP port instead. This is done by adding a new line with the port number just after the "-console" line.

For example, to set console to listen at TCP port 9999, SMILA.ini would look like this:

 -console
 9999
 ...

Now, after SMILA has been started with “$ nohup ./SMILA &”, the console can be accessed from any computer simply by opening a telnet session:

$ telnet <smila_host_name> <console_port>


Symbol comment vote.png If you are logged in via telnet and just want to close this connection and not to stop Equinox running SMILA, than just type “disconnect”. Otherwise, if you want to stop SMILA and close the connection, use “close” - as you normally would do on a console running in your shell.

Bundles

new bundle was not started

After launching SMILA my new bundle doesn't seem to be started.

If you started SMILA.launch in eclipse to launch SMILA: The launcher didn't start your new bundle. Try this:

  1. Add your bundle by selecting "Run Configurations" in eclipse and choose your SMILA profile.
  2. Select your bundle in the list and set the checkmark.
  3. Set the start level to "4" and the autostart to "true".

If you started SMILA.EXE to launch SMILA: Your bundle isn`t defined in config.ini or the start level isn´t correct. Try this:

  1. Open the file configuration/config.ini and add your bundle as shown below:
    org.eclipse.smila.connectivity.framework.crawler.owncrawler@5:start, \
    
  2. Open the build.properties file of your bundle and include the folders schemas/, OSGI-INF/, and the file plugin.xml.

I changed bundle settings in my config.ini, but after SMILA restart nothing changed

Check your config.ini for unusual whitespaces (e.g. a tab) between the (edited) bundle entries or after the backslashes on line ends - and remove them.

If that doesn't help, see question (resp. answer) before.

Configuring/Running SMILA

Basics

How do I change the HTTP port of SMILA?

The HTTP port is configured in fie configuration/org.eclipse.smila.clusterconfig.simple/clusterconfig.json. Change it there and restart SMILA.

See SMILA/Documentation/JettyHttpServer#Setting_the_HTTP_port for details.

Crawler

I started a crawl job, the job was started successfully, but nothing seems to happen

Check the SMILA log file for errors.

Check the state of the crawl job in jobmanager state API

  • if the state in your crawl job is "RUNNING", check the mode it has been started
  • if the state is FINISHING
    • check the job into which the crawl job pushes its records for processed records or errors.
  • if everything up to now is OK
    • just wait some time, the autocommit handler maybe hasn't yet committed the data to the Solr index
    • check autoCommit settings in the solrconfig.xml file of your Solr core.

Pipeline

Why do I get a timeout exception during a (long running) pipeline execution?

In SMILA there's a timeout configured for a pipeline execution:

configuration/org.eclipse.smila.processing.bpel/processor.properties

See entry: pipeline.timeout

My xpath expression doesnt work

  1. Check that the expression is correct with a XPath tool
  2. ensure that the attributes are not filtered out, see SMILA/Documentation/HowTo/How_to_filter_and_access_record_data_in_BPEL

Helpful log points

Area id level Comment
BPEL org.eclipse.smila.processing.bpel.activities.PipeletManager debug Log BPEL request XML before and after pipelet invocation. Note: this contains the XML for the records but only their filtered version.
BPEL org.eclipse.smila.processing.bpel.activities.PipeletManager trace Log full XML of records after pipelet invocation. Note: this is the real thing unfiltered.
BPEL org.eclipse.smila.processing.bpel.BpelWorkflowProcessor trace Log full XML of records going into and out of a pipeline.

Implementing Pipelets / OSGi Services / Bundles

Pipelets

I want to use the ConfigUtils class in my Pipelet to read the configuration, where do I have to put my configuration files?

Configuration files are searched for in the following order:

  1. <SMILA>/configuration/<bundle-name>/<config-file>
  2. <config-file> in the root path of the bundle jar-file

See Configuration Handler for more information.

I get classloading errors in invocations of my own Pipelet when running SMILA outside the IDE. In the IDE it works

The error could look like this:

2010-11-19 11:28:36,101 ERROR [ODEServerImpl-1
]  vpu.JacobVPU                                  - Method "run" in class "org.apache.ode.bpel.rtrep.v2.EXTENSIONACTIVITY" threw an unexpected exception.
java.lang.LinkageError: loader constraint violation: loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) previously initiated loading for a different type with name "org/w3c/dom/Document"

We are not completely sure, why this happens, but a solution is to set this system property in the SMILA.ini file:

-Dosgi.java.profile.bootdelegation=override

Thanks to Bogdan Sacaleanu for the solution. See this thread in the smila-dev mailing list for additional details.

OSGI-Services / Workers

I implemented/deployed an OSGi Service but it seems that it isn't activated

Check your bundle, it should contain a file like that:

OSGI-INF/<myService>.xml

In this file your service has to be referenced.

  • the component name in the root element must be unique
  • the implementing class must not be abstract and must not be an interface

The file has to be referenced in the META-INF / MANIFEST.MF file of your bundle as a service component:

Service-Component: OSGI-INF/<myService>.xml

On the "Build" page of the manifest editor, you must add the OSGI-INF directory to the binary build.

And finally, your bundle has to be started at SMILA launch, by adding it to the configuration/config.ini

...
<bundle-id>@4:start,
... 

If you are using <tt>SMILA.launch to launch SMILA in eclipse IDE, you have to open the run/debug configuration of SMILA, check the new bundle and set Auto-Start to "true".

If you checked all the things above and it still doesn't work:

  • Implement an activate() method in your service - if not already there, and check if it's called at startup.
  • If your service depends on other services, check if those are activated
  • If your service uses other services, check the naming of the set/unset methods in the Java code vs. those specified in the <myService>.xml
  • If your services uses 3rd-party-jars, make sure that they are specified in the Bundle-ClassPath section of your MANIFEST.MF (Do not reference the lib folder here, instead reference all jars, e.g. Bundle-ClassPath: ., <lib1.jar>, <lib2.jar>). Make also sure, that they are added to the binary build ("Build" page of the manifest editor).
  • If your service has super-classes you may need to include Import-Package: declarations of the super-classes in your service implementation class even if there are no compile errors.
  • Use the OSGi console, e.g. via: telnet <host> 9005
    • ss <bundle-ID> - check if your bundle is in the list and ACTIVE (the bundle-ID is the "Bundle-SymbolicName" from the MANIFEST.MF)
      • if it isn't in the list, the bundle is not correctly deployed
      • if it isn't ACTIVE but only RESOLVED it's not started (-> see hints above)
    • bundle <id> - check if your service is listed here in the "Registered Services" section (the "id" can be taken from the "ss" output)
      • if it isn't there, your service is not correctly deployed (-> check all points above)

My activate() / deactivate() method isn't called

Check that your activate/deactivate method is protected or public.

If you use activate()/deactivate() methods without (ComponentContext) parameter, make sure that your service description xml file contains scr namespace:

<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" ...

I implemented a worker, everything seems fine, but the worker processes no tasks during the job run

Make sure that your worker is actually running.

In the REST API, the worker description must be found via: http://localhost:8080/smila/jobmanager/workers

Check also if your worker is really started via debug API: http://localhost:8080/smila/debug

A warning is shown here, if your worker coudn't be found, e.g.:

  ...
  name: "myWorker",
  WARNING: "Worker is not registered in WorkerManager. Maybe worker OSGI service isn't started or worker's name setting is inconsistent."
  ...

If you get something like this, try to check FAQ for implementing an OSGI service above.

General

I get classloading errors when I try to access an external Web Service using JAX-WS

Class loading problems often occur when using third party libraries that use the "thread context classloader" in OSGi, and standard implementations of Java specifications by Sun/Oracle (or other non-OSGi-aware parties...) do this very often.

The only solution we currently know of is to wrap the critical section (in this case it's the construction of the webservice client class) in a piece of code like this:

ClassLoader tccl = Thread.currentThread().getContextClassLoader();
try {
    Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
    /*
     * initialize the client
     */
} finally {
    Thread.currentThread().setContextClassLoader(tccl);
}

See also this forum thread.


More classloader errors

If you get an error like this:

Caused by: java.lang.LinkageError: loader constraint violation: when resolving field "DATETIME" the class loader (instance of 
 org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) of the referring class, javax/xml/datatype/DatatypeConstants, and the class loader (instance of <bootloader>) for the field's resolved type, javax/xml/namespace/QName, have different Class objects for that type

the reason is most likely that you have classes in the bundle classpath of your bundle that contains classes which are also part of the JDK runtime library (java.*, javax.*). Remove these classes from the bundle and it should work.

See also this forum thread.

Back to the top