You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Hubertus.Willuhn" <hu...@dinsoftware.de> on 2016/01/18 12:48:06 UTC

Error Reading Files from four different Routes

Hi Community,

i got an error reading 4 directory (with 1 file per directory) in 4 routes
with file: endpoint.
I use Camel 2.16.1 and Spring 4.1.8 as well as Spring Boot 1.2.7.

After Compiling my code the app starts normal via Spring Boot but after
initializing my routes the
app crashes with error:

# A fatal error has been detected by the Java Runtime Environment:
(process:15444): GLib-GObject-CRITICAL **: g_object_new: assertion
`G_TYPE_IS_OBJECT (object_type)' failed
#
#  SIGSEGV (0xb) at pc=0x00007fd4f12ed5e9, pid=15444, tid=140552575444736
[thread 140552572286720 also had an error]
#
# JRE version: Java(TM) SE Runtime Environment (8.0_45-b14) (build
1.8.0_45-b14)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.45-b02 mixed mode
linux-amd64 compressed oops)
# Problematic frame:
# C  [libglib-2.0.so.0+0x595e9]  g_slice_alloc+0x139
#
# Failed to write core dump. Core dumps have been disabled. To enable core
dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:

The saved error log can you see as an attachment:  error.log
<http://camel.465427.n5.nabble.com/file/n5776391/error.log>  

My routes are 4 classes (one for every directory) which got there routes
from a abstract base class.
Configuration is correct. So all parameters are set.

The main base route looks like:

from(producer())
			// split document on each record
			.split().xtokenize(splitPath(), extractionMode(),
namespaces()).streaming()
				//.tokenizeXML(this.splitPath(), this.root()).streaming()
				// threading
				.parallelProcessing().executorServiceRef(CamelConfig.THREAD_POOL_NAME)
				// TODO filter by parameter
				//.filter(simple("${exchangeProperty.CamelSplitIndex} > 46000"))
				//.setHeader(RECID, this.id())
				.process(processor())
				.to(consumer())
				//.end() // filter
			.end() // split
		.stop();

The next class implementing some of the parameter functions looks like

	protected String baseDir;

	@Override
	protected Processor processor()
	{
		return (exchange -> {
			String body = exchange.getIn().getBody(String.class);

			// remove whitespaces
			body = body.trim();

			RegEx regex = new RegEx(">\\s+<").exec(body);

			body = regex.replaceAll("><");

			// extract record id
			regex = new RegEx(idExpression()).exec(body);

			if(!regex.hits()) {
				throw new IllegalArgumentException("Invalid XML-content detected: no
record id found.");
			}

			exchange.getIn().setBody(body, String.class);
			exchange.getIn().setHeader(RECID, regex.group(1));
		});
	}

	protected String idExpression()
	{
		return "<WI WIID=\"(\\d+)\"";
	}

and the last level did the endpoint declaration for the directory:

@Override
	public Endpoint producer()
	{
		return endpoint("file:" + this.baseDir + "/srv" + "?noop=true");
	}

	@Override
	public Endpoint consumer()
	{
		return endpoint(WI_Aggregator.ENDPOINT);
	}

	@Override
	protected String splitPath()
	{
		return "/CENSRV/WI";
	}

Did somebody got an idea what to do?

Best regards

Hubertus



--
View this message in context: http://camel.465427.n5.nabble.com/Error-Reading-Files-from-four-different-Routes-tp5776391.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Error Reading Files from four different Routes

Posted by "Hubertus.Willuhn" <hu...@dinsoftware.de>.
Hi guys,

thx for ur answer on this.

My files all have valid names (i guess): SRV_NSB.XML, WI_NSB.XML,
WIX_NSB.XML and URL_NSB.XML
with pure XML content and UTF-8 formatting.

This is a cut out showing the file header:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<CENSRV xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="srv_nsb.xsd" FILEDATE="2015-11-06"
VERSION="4">

Maybe this information help u too.

Best regards

Hubertus



--
View this message in context: http://camel.465427.n5.nabble.com/Error-Reading-Files-from-four-different-Routes-tp5776391p5776421.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Error Reading Files from four different Routes

Posted by "Hubertus.Willuhn" <hu...@dinsoftware.de>.
Hi,

after watching the ticket and the release infos on that topic:

it seems that this issue occured due to an error in the jdk. We updated our
machines to the new jdk release (v8 update 66) but still got the same error.

The fix for this in camel don't came out before camel version 2.17.
What should i do till then, some resolution to fix this in the meanwhile?

Best regards



--
View this message in context: http://camel.465427.n5.nabble.com/Error-Reading-Files-from-four-different-Routes-tp5776391p5777463.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Error Reading Files from four different Routes

Posted by Claus Ibsen <cl...@gmail.com>.
I logged a ticket to improve this
https://issues.apache.org/jira/browse/CAMEL-9524

On Tue, Jan 19, 2016 at 8:38 AM, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> I dont think we should probe the file types by default. I doesn't add
> so much value and has these potential issue as shown here.
> I think we should add an option on the file component to turn this off|on.
>
> Its introduced by: https://issues.apache.org/jira/browse/CAMEL-8357
>
> On Tue, Jan 19, 2016 at 2:58 AM, Willem Jiang <wi...@gmail.com> wrote:
>> Hi,
>>
>> It looks like the JVM have some trouble to detect the content type of the file.
>>
>>
>> Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
>> j  sun.nio.fs.GnomeFileTypeDetector.probeUsingGio(J)[B+0
>> j  sun.nio.fs.GnomeFileTypeDetector.implProbeContentType(Ljava/nio/file/Path;)Ljava/lang/String;+53
>> j  sun.nio.fs.UnixFileSystemProvider$2.implProbeContentType(Ljava/nio/file/Path;)Ljava/lang/String;+26
>> j  sun.nio.fs.AbstractFileTypeDetector.probeContentType(Ljava/nio/file/Path;)Ljava/lang/String;+16
>> j  java.nio.file.Files.probeContentType(Ljava/nio/file/Path;)Ljava/lang/String;+47
>> j  org.apache.camel.component.file.GenericFile.populateHeaders(Lorg/apache/camel/component/file/GenericFileMessage;)V+84
>>
>> To Fix this issue, you may need to write your own FileTypeDetector[1].
>>
>>
>> [1]http://stackoverflow.com/questions/22679201/java-probecontenttype
>>
>> --
>> Willem Jiang
>>
>>
>> Blog: http://willemjiang.blogspot.com (English)
>> http://jnn.iteye.com (Chinese)
>> Twitter: willemjiang
>> Weibo: 姜宁willem
>>
>>
>>
>> On January 18, 2016 at 7:48:20 PM, Hubertus.Willuhn (hubertus.willuhn@dinsoftware.de) wrote:
>>> Hi Community,
>>>
>>> i got an error reading 4 directory (with 1 file per directory) in 4 routes
>>> with file: endpoint.
>>> I use Camel 2.16.1 and Spring 4.1.8 as well as Spring Boot 1.2.7.
>>>
>>> After Compiling my code the app starts normal via Spring Boot but after
>>> initializing my routes the
>>> app crashes with error:
>>>
>>> # A fatal error has been detected by the Java Runtime Environment:
>>> (process:15444): GLib-GObject-CRITICAL **: g_object_new: assertion
>>> `G_TYPE_IS_OBJECT (object_type)' failed
>>> #
>>> # SIGSEGV (0xb) at pc=0x00007fd4f12ed5e9, pid=15444, tid=140552575444736
>>> [thread 140552572286720 also had an error]
>>> #
>>> # JRE version: Java(TM) SE Runtime Environment (8.0_45-b14) (build
>>> 1.8.0_45-b14)
>>> # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.45-b02 mixed mode
>>> linux-amd64 compressed oops)
>>> # Problematic frame:
>>> # C [libglib-2.0.so.0+0x595e9] g_slice_alloc+0x139
>>> #
>>> # Failed to write core dump. Core dumps have been disabled. To enable core
>>> dumping, try "ulimit -c unlimited" before starting Java again
>>> #
>>> # An error report file with more information is saved as:
>>>
>>> The saved error log can you see as an attachment: error.log
>>>
>>>
>>> My routes are 4 classes (one for every directory) which got there routes
>>> from a abstract base class.
>>> Configuration is correct. So all parameters are set.
>>>
>>> The main base route looks like:
>>>
>>> from(producer())
>>> // split document on each record
>>> .split().xtokenize(splitPath(), extractionMode(),
>>> namespaces()).streaming()
>>> //.tokenizeXML(this.splitPath(), this.root()).streaming()
>>> // threading
>>> .parallelProcessing().executorServiceRef(CamelConfig.THREAD_POOL_NAME)
>>> // TODO filter by parameter
>>> //.filter(simple("${exchangeProperty.CamelSplitIndex} > 46000"))
>>> //.setHeader(RECID, this.id())
>>> .process(processor())
>>> .to(consumer())
>>> //.end() // filter
>>> .end() // split
>>> .stop();
>>>
>>> The next class implementing some of the parameter functions looks like
>>>
>>> protected String baseDir;
>>>
>>> @Override
>>> protected Processor processor()
>>> {
>>> return (exchange -> {
>>> String body = exchange.getIn().getBody(String.class);
>>>
>>> // remove whitespaces
>>> body = body.trim();
>>>
>>> RegEx regex = new RegEx(">\\s+<").exec(body);
>>>
>>> body = regex.replaceAll("><");
>>>
>>> // extract record id
>>> regex = new RegEx(idExpression()).exec(body);
>>>
>>> if(!regex.hits()) {
>>> throw new IllegalArgumentException("Invalid XML-content detected: no
>>> record id found.");
>>> }
>>>
>>> exchange.getIn().setBody(body, String.class);
>>> exchange.getIn().setHeader(RECID, regex.group(1));
>>> });
>>> }
>>>
>>> protected String idExpression()
>>> {
>>> return "> }
>>>
>>> and the last level did the endpoint declaration for the directory:
>>>
>>> @Override
>>> public Endpoint producer()
>>> {
>>> return endpoint("file:" + this.baseDir + "/srv" + "?noop=true");
>>> }
>>>
>>> @Override
>>> public Endpoint consumer()
>>> {
>>> return endpoint(WI_Aggregator.ENDPOINT);
>>> }
>>>
>>> @Override
>>> protected String splitPath()
>>> {
>>> return "/CENSRV/WI";
>>> }
>>>
>>> Did somebody got an idea what to do?
>>>
>>> Best regards
>>>
>>> Hubertus
>>>
>>>
>>>
>>> --
>>> View this message in context: http://camel.465427.n5.nabble.com/Error-Reading-Files-from-four-different-Routes-tp5776391.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Error Reading Files from four different Routes

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I dont think we should probe the file types by default. I doesn't add
so much value and has these potential issue as shown here.
I think we should add an option on the file component to turn this off|on.

Its introduced by: https://issues.apache.org/jira/browse/CAMEL-8357

On Tue, Jan 19, 2016 at 2:58 AM, Willem Jiang <wi...@gmail.com> wrote:
> Hi,
>
> It looks like the JVM have some trouble to detect the content type of the file.
>
>
> Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
> j  sun.nio.fs.GnomeFileTypeDetector.probeUsingGio(J)[B+0
> j  sun.nio.fs.GnomeFileTypeDetector.implProbeContentType(Ljava/nio/file/Path;)Ljava/lang/String;+53
> j  sun.nio.fs.UnixFileSystemProvider$2.implProbeContentType(Ljava/nio/file/Path;)Ljava/lang/String;+26
> j  sun.nio.fs.AbstractFileTypeDetector.probeContentType(Ljava/nio/file/Path;)Ljava/lang/String;+16
> j  java.nio.file.Files.probeContentType(Ljava/nio/file/Path;)Ljava/lang/String;+47
> j  org.apache.camel.component.file.GenericFile.populateHeaders(Lorg/apache/camel/component/file/GenericFileMessage;)V+84
>
> To Fix this issue, you may need to write your own FileTypeDetector[1].
>
>
> [1]http://stackoverflow.com/questions/22679201/java-probecontenttype
>
> --
> Willem Jiang
>
>
> Blog: http://willemjiang.blogspot.com (English)
> http://jnn.iteye.com (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
>
> On January 18, 2016 at 7:48:20 PM, Hubertus.Willuhn (hubertus.willuhn@dinsoftware.de) wrote:
>> Hi Community,
>>
>> i got an error reading 4 directory (with 1 file per directory) in 4 routes
>> with file: endpoint.
>> I use Camel 2.16.1 and Spring 4.1.8 as well as Spring Boot 1.2.7.
>>
>> After Compiling my code the app starts normal via Spring Boot but after
>> initializing my routes the
>> app crashes with error:
>>
>> # A fatal error has been detected by the Java Runtime Environment:
>> (process:15444): GLib-GObject-CRITICAL **: g_object_new: assertion
>> `G_TYPE_IS_OBJECT (object_type)' failed
>> #
>> # SIGSEGV (0xb) at pc=0x00007fd4f12ed5e9, pid=15444, tid=140552575444736
>> [thread 140552572286720 also had an error]
>> #
>> # JRE version: Java(TM) SE Runtime Environment (8.0_45-b14) (build
>> 1.8.0_45-b14)
>> # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.45-b02 mixed mode
>> linux-amd64 compressed oops)
>> # Problematic frame:
>> # C [libglib-2.0.so.0+0x595e9] g_slice_alloc+0x139
>> #
>> # Failed to write core dump. Core dumps have been disabled. To enable core
>> dumping, try "ulimit -c unlimited" before starting Java again
>> #
>> # An error report file with more information is saved as:
>>
>> The saved error log can you see as an attachment: error.log
>>
>>
>> My routes are 4 classes (one for every directory) which got there routes
>> from a abstract base class.
>> Configuration is correct. So all parameters are set.
>>
>> The main base route looks like:
>>
>> from(producer())
>> // split document on each record
>> .split().xtokenize(splitPath(), extractionMode(),
>> namespaces()).streaming()
>> //.tokenizeXML(this.splitPath(), this.root()).streaming()
>> // threading
>> .parallelProcessing().executorServiceRef(CamelConfig.THREAD_POOL_NAME)
>> // TODO filter by parameter
>> //.filter(simple("${exchangeProperty.CamelSplitIndex} > 46000"))
>> //.setHeader(RECID, this.id())
>> .process(processor())
>> .to(consumer())
>> //.end() // filter
>> .end() // split
>> .stop();
>>
>> The next class implementing some of the parameter functions looks like
>>
>> protected String baseDir;
>>
>> @Override
>> protected Processor processor()
>> {
>> return (exchange -> {
>> String body = exchange.getIn().getBody(String.class);
>>
>> // remove whitespaces
>> body = body.trim();
>>
>> RegEx regex = new RegEx(">\\s+<").exec(body);
>>
>> body = regex.replaceAll("><");
>>
>> // extract record id
>> regex = new RegEx(idExpression()).exec(body);
>>
>> if(!regex.hits()) {
>> throw new IllegalArgumentException("Invalid XML-content detected: no
>> record id found.");
>> }
>>
>> exchange.getIn().setBody(body, String.class);
>> exchange.getIn().setHeader(RECID, regex.group(1));
>> });
>> }
>>
>> protected String idExpression()
>> {
>> return "> }
>>
>> and the last level did the endpoint declaration for the directory:
>>
>> @Override
>> public Endpoint producer()
>> {
>> return endpoint("file:" + this.baseDir + "/srv" + "?noop=true");
>> }
>>
>> @Override
>> public Endpoint consumer()
>> {
>> return endpoint(WI_Aggregator.ENDPOINT);
>> }
>>
>> @Override
>> protected String splitPath()
>> {
>> return "/CENSRV/WI";
>> }
>>
>> Did somebody got an idea what to do?
>>
>> Best regards
>>
>> Hubertus
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/Error-Reading-Files-from-four-different-Routes-tp5776391.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Error Reading Files from four different Routes

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

It looks like the JVM have some trouble to detect the content type of the file.


Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  sun.nio.fs.GnomeFileTypeDetector.probeUsingGio(J)[B+0
j  sun.nio.fs.GnomeFileTypeDetector.implProbeContentType(Ljava/nio/file/Path;)Ljava/lang/String;+53
j  sun.nio.fs.UnixFileSystemProvider$2.implProbeContentType(Ljava/nio/file/Path;)Ljava/lang/String;+26
j  sun.nio.fs.AbstractFileTypeDetector.probeContentType(Ljava/nio/file/Path;)Ljava/lang/String;+16
j  java.nio.file.Files.probeContentType(Ljava/nio/file/Path;)Ljava/lang/String;+47
j  org.apache.camel.component.file.GenericFile.populateHeaders(Lorg/apache/camel/component/file/GenericFileMessage;)V+84

To Fix this issue, you may need to write your own FileTypeDetector[1].


[1]http://stackoverflow.com/questions/22679201/java-probecontenttype

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 18, 2016 at 7:48:20 PM, Hubertus.Willuhn (hubertus.willuhn@dinsoftware.de) wrote:
> Hi Community,
>  
> i got an error reading 4 directory (with 1 file per directory) in 4 routes
> with file: endpoint.
> I use Camel 2.16.1 and Spring 4.1.8 as well as Spring Boot 1.2.7.
>  
> After Compiling my code the app starts normal via Spring Boot but after
> initializing my routes the
> app crashes with error:
>  
> # A fatal error has been detected by the Java Runtime Environment:
> (process:15444): GLib-GObject-CRITICAL **: g_object_new: assertion
> `G_TYPE_IS_OBJECT (object_type)' failed
> #
> # SIGSEGV (0xb) at pc=0x00007fd4f12ed5e9, pid=15444, tid=140552575444736
> [thread 140552572286720 also had an error]
> #
> # JRE version: Java(TM) SE Runtime Environment (8.0_45-b14) (build
> 1.8.0_45-b14)
> # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.45-b02 mixed mode
> linux-amd64 compressed oops)
> # Problematic frame:
> # C [libglib-2.0.so.0+0x595e9] g_slice_alloc+0x139
> #
> # Failed to write core dump. Core dumps have been disabled. To enable core
> dumping, try "ulimit -c unlimited" before starting Java again
> #
> # An error report file with more information is saved as:
>  
> The saved error log can you see as an attachment: error.log
>  
>  
> My routes are 4 classes (one for every directory) which got there routes
> from a abstract base class.
> Configuration is correct. So all parameters are set.
>  
> The main base route looks like:
>  
> from(producer())
> // split document on each record
> .split().xtokenize(splitPath(), extractionMode(),
> namespaces()).streaming()
> //.tokenizeXML(this.splitPath(), this.root()).streaming()
> // threading
> .parallelProcessing().executorServiceRef(CamelConfig.THREAD_POOL_NAME)
> // TODO filter by parameter
> //.filter(simple("${exchangeProperty.CamelSplitIndex} > 46000"))
> //.setHeader(RECID, this.id())
> .process(processor())
> .to(consumer())
> //.end() // filter
> .end() // split
> .stop();
>  
> The next class implementing some of the parameter functions looks like
>  
> protected String baseDir;
>  
> @Override
> protected Processor processor()
> {
> return (exchange -> {
> String body = exchange.getIn().getBody(String.class);
>  
> // remove whitespaces
> body = body.trim();
>  
> RegEx regex = new RegEx(">\\s+<").exec(body);
>  
> body = regex.replaceAll("><");
>  
> // extract record id
> regex = new RegEx(idExpression()).exec(body);
>  
> if(!regex.hits()) {
> throw new IllegalArgumentException("Invalid XML-content detected: no
> record id found.");
> }
>  
> exchange.getIn().setBody(body, String.class);
> exchange.getIn().setHeader(RECID, regex.group(1));
> });
> }
>  
> protected String idExpression()
> {
> return "> }
>  
> and the last level did the endpoint declaration for the directory:
>  
> @Override
> public Endpoint producer()
> {
> return endpoint("file:" + this.baseDir + "/srv" + "?noop=true");
> }
>  
> @Override
> public Endpoint consumer()
> {
> return endpoint(WI_Aggregator.ENDPOINT);
> }
>  
> @Override
> protected String splitPath()
> {
> return "/CENSRV/WI";
> }
>  
> Did somebody got an idea what to do?
>  
> Best regards
>  
> Hubertus
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Error-Reading-Files-from-four-different-Routes-tp5776391.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.
>