Comments (11)
Until the problem is fixed, it should be possible workaround it by
simply writing & directly in the annotation property.
Unfortunately, I get then this error:
Description Resource Path Location Type
Service-ComponentInvalid Service-Component header: test.TestComponent {}, throws java.lang.IllegalArgumentException: Filter mismatch: expected ) at position 2 : (& amp;(test=A)(test2=B1)) bnd.bnd /test.a.service line 1 Bnd OSGi Problem Marker
It's only working for me, if I adjust the "&" with "& amp;" (without the white space) directly in the generated component.xml.
cu
Boeffi
from bnd.
It looks like many of the escaped string above got substituted for the real thing in the transition to GitHub. To be clear, when bnd sees an [ampersand] in the target property of a @reference annotation, it needs to replace with [ampersand]amp;
The same goes for other XML entities, i.e. quot, apos, lt, gt.
from bnd.
Ok, I have corrected my copy'n'paste because of the substituted characters.
Summarizing:
when I write the [ampersand] directly in the @reference ... target attribute, the syntax checking inside eclipse is ok and the generated component.xml contains the [ampersand]. At runtime I get the (parser) exception.
cu
Boeffi
from bnd.
Sorry that sounds different from what I oriniginally understood.
Are you saying that when the XML contains a properly escaped ampersand, the DS runtime throws an exception? That sounds like a runtime error, you may need to go back and report it against Equinox or Felix.
Could you paste (a) the generated component.xml and (b) the stack trace of the runtime exception?
from bnd.
(a) and (b) see above
My Java Source contains a single ampersand char. Compiling is OK.
The generated component.xml contains then a single(!) ampersand char (not escaped).
In this case I get a runtime exception.
If I do manually correct (in the generated component.xml) the single ampersand to [ampersand] a m p ; (without the white spaces, replace the square brackets with a single ampersand char) I get no runtime exception.
from bnd.
Okay good. That's what I expected, but I got confused.
So bnd just needs to perform the escaping correctly when generating component XMLs. In the meantime you can work around by putting the fully escaped [ampersand]amp; in your source.
Unfortunately your code will then break as soon as the correct escaping is implemented! Bnd would generate: "[ampersand]amp;amp;". Perhaps the fix should include a check to make sure that the string is not already escaped in the source.
from bnd.
As you mentioned above, bnd have to escape the XML entities before storing them into the generated component.xml (that's was I'm doing manually with the [ampersand])
Am I right?
//Sorry, I have written my post parallel to you answer
from bnd.
In the meantime you can work around by putting the
fully escaped [ampersand]amp; in your source.
The "source" is the generated component.xml !
(writing the fully escaped [ampersand]amp; in the java source I get the
"...Filter mismatch: expected ) at position 2...")
Now, you have the workaround confirmed and I'm waiting for the bnd bug fix.
(May be I can help? Is the bug contained in bnd or the bndtools?)
cu
Boeffi
from bnd.
Sorry I'm confused again. When I said "source" I always meant Java source, not component.xml (that file is generated, so it cannot be "source").
Let's try to reconfirm this again. What happens when you put the fully escaped [ampersand]amp; in your JAVA source?
A contributed patch would certainly be welcome. The bug is in bnd, not bndtools, that's why I directed you to this bug tracker. Bndtools is just UI on top of bnd.
from bnd.
You cannot use & because the filter is verified :-( So I made a fix that is in the repo now, version 1.12.0
from bnd.
the & in the previous comment should read "& a m p ;", seems Github changes the entity also
from bnd.
Related Issues (20)
- bndtools should assist with importing projects from known bnd workspaces HOT 14
- Cannot create new Bnd OSGi Project with current master HEAD HOT 5
- Contribute oomph setups for bndtools 7.1+ all-in-one install HOT 1
- Provide bndtools 7.1+ p2 release repositories so that oomph setups can refer to specific bndtools versions HOT 7
- Bnd can cause a .jar to contain the wrong modules’ classes HOT 5
- NPE in Add to -buildpath Quickfix HOT 2
- bnd-maven-plugin: Explicit Service-Component instruction is merged with value generated from `DSAnnotations` plugin HOT 6
- Bndtools / Maven with sources JAR HOT 5
- Unexpected behavior when using Export-Package alongside -includeresources HOT 5
- Add Maven, Eclipse and IntelliJ folders to gitignore HOT 1
- EphemeralPortTest failing intermittently HOT 8
- ProjectResolverTest failing HOT 32
- Compile error on JDK 21: aQute/lib/collections/SortedList doesn't fully implement SortedSet/List interfaces HOT 2
- Running bnd shell command under windows
- Spring Boot 3.3.0 causing StackOverflowError HOT 3
- ANSI Console doesn't work with bndtools HOT 4
- Default 256 for bnd.executor.maximumPoolSize is excessive HOT 22
- 1
- Issues with bndtools Eclipse dev instance on MacOS Sonoma 14.3+ with temurin JDK > 17.0.09+9 HOT 4
- [Maven] When a dependency has multiple artifacts, the non-jar can hide the jar dependency, resulting in resolve issues
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bnd.