Re: Is it possible to switch Filter impl from SaxNGFilter to SmooksDOMFilter filter from config ?

17 views
Skip to first unread message

Claude Mamo

unread,
Feb 20, 2025, 10:52:32 AMFeb 20
to smook...@googlegroups.com, smook...@googlegroups.com
Please continue the conversation in the user mailing list (CCed). This mailing list is reserved for development topics like new features, etc... 

About SmooksDOMFilter, though not deprecated, the filter is there for legacy reasons and I'd recommend against using it since it's not a streaming filter like SaxNgFilter. Besides, I doubt that it would solve the problem. Have you tried the workaround suggested in this thread: https://groups.google.com/g/smooks-user/c/5pjysu9SO6Q/m/NOk51ETeAAAJ ?

Claude

On Thu, Feb 20, 2025 at 4:39 PM Stefano Falconetti <stefano.f...@gmail.com> wrote:
Hi, ok it gets configured, any idea what Smooks means by this error due to filter change ?

Caused by: org.smooks.api.SmooksConfigException: The configured filter [DOM] cannot be used: [SAX NG] filters can be used for the given set of visitors. Turn on debug logging for more information 


Thanks for helping on this and on my root question :)
On Thursday, February 20, 2025 at 3:44:50 PM UTC+1 Stefano Falconetti wrote:
Maybe something like this:

               /**
 * Better to go with DefaultApplicationContextBuilder as this is deprecated code
 */
FilterSettings filterSettings = new FilterSettings();
filterSettings.setFilterType(StreamFilterType.DOM);
smooks.setFilterSettings(filterSettings);

On Thursday, February 20, 2025 at 3:07:01 PM UTC+1 Stefano Falconetti wrote:
HI Group,

I'm trying to avoid falling into issue I opened:


By switching filter impl from SaxNGFilter to other available impl I see that is SmooksDOMFilter

Is this possible via Smooks configurations ?

I',m trying this since I see the mvel2 exception thrown comes in the stack trace from SaxNGFilter impl:

 org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.smooks.engine.delivery.sax.ng.SaxNgParser.parse(SaxNgParser.java:87)
at org.smooks.engine.delivery.sax.ng.SaxNgFilter.doFilter(SaxNgFilter.java:111)
... 56 more
Caused by: java.lang.NoClassDefFoundError: org/mvel2/compiler/Accessor
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:874)
at org.mvel2.optimizers.impl.asm.ASMAccessorOptimizer$ContextClassLoader.defineClass(ASMAccessorOptimizer.java:2321)
at org.mvel2.optimizers.impl.asm.ASMAccessorOptimizer.loadClass(ASMAccessorOptimizer.java:233

These are the filters I see available:
SmooksFilterImpl.png

Thanks,

Stefano Falconetti.

--
You received this message because you are subscribed to the Google Groups "Smooks Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/smooks-dev/720895c2-73e4-45ec-b37f-40a9a633648an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages