It looks like the classpath has more than one jar which has those org.osgi.framework.* classes. I've no clue about Forge so can't say what needs to be done here. Perhaps try and find which jars have these classes?
To clarify. Craig isn't using Forge, he's using just the JavaParser dependency which is basically a thin pure-Java wrapper around the Eclipse JDT: https://github.com/forge/java-parser, so this has nothing to do with the fact that it's Forge, it just happens to be something from the Forge depchain.
Craig is also not using or requiring any OSGi features from the application server, so this exception/problem is purely a roadblock, not something that he needs to be working with since his application does not require an OSGi environment, does not require that any of its JARs be deployed as OSGi modules, and does not depend on any OSGi modules from AS.
Hopefully this helps clarify the issue.
in that case solution is somewhat simple.
just disable OSGI subsystem(remove it from standalone.xml) and you are good to go.
I asume that you did upgrade from previous version of App Server as with 7.2/EAP6.1 osgi is not enabled by default anymore.
To enable it you need to run standalone-osgi.xml
but upgrade from previous version would upgrade configuration to latest, and would still contain OSGI.
other way of doing it is by using standalone.xml that came with app server, not old one...
Excellent. For the purposes of clarify, could you show Craig which section of configuration needs to be removed or changed in standalone.xml to disable OSGi? Thanks.
I tried going into the standalone.xml file and removed all references to anything related to osgi. However, the issue still exists. Is there something else I need to do for AS7.1.1.Final to actually disable osgi?
Also, I tried this with EAP 6.1.0 Beta which you had suggested would have osgi disabled by default, but the error was there also.
In digging around a little more, this is actually not an AS7/EAP issue. The issue here stemmed from the JBoss Forge Java Parser adding the osgi-3.4.3.R34x jar which had a BundleActivator class, and Arquillian adding the org.osgi.core-4.2.0 jar which also had a different version of a BundleActivator class. Since I was running the Arquillian test as testable=false (aka client), the Parser would work on the Server (where Arquillian wasn't scoped), but not in Test.
Aslak Knutsen from the Arquillian team let me know that Arqillian doesn't actually need osgi and provided me with a solution in simply excluding it from the remote container profile in my pom like so:
<profile> <id>JBOSS_AS_REMOTE_7.X</id> <dependencies> <dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-arquillian-container-remote</artifactId> <version>7.1.1.Final</version> <exclusions> <exclusion> <groupId>org.jboss.arquillian.testenricher</groupId> <artifactId>arquillian-testenricher-osgi</artifactId> </exclusion> </exclusions> <scope>test</scope> </dependency> </dependencies> </profile>
This did the trick and now allows me to use the Forge Java Parser even within an Arquillian test. A big thank you to Aslak and the JBoss team for their help!!!