unable to use core module in my own netbeans module - netbeans

i try to get maven path in my modules by MavenSettings.getDefaultExternalMavenRuntime(), so i include "org-netbeans-modules-maven" in pom.xml. But i got :
Failed to execute goal org.apache.netbeans.utilities:nbm-maven-plugin:4.7:manifest (default-manifest) on project netbeans-riscv: Module has friend dependency on org.netbeans.modules.maven but is not listed as a friend. -> [Help 1]
pom.xml:
<dependency>
<groupId>org.netbeans.modules</groupId>
<artifactId>org-netbeans-modules-maven</artifactId>
<version>RELEASE125</version>
<type>jar</type>
</dependency>
thanks

Related

Maven jar dependency not found at runtime by OSGi environment

I'm building an Eclipse product that requires some external dependencies, which are not bundled as Eclipse plugins.
For example javax.json-1.1.4.jar.
I'm usign a target platform file, with Maven dependency added. This is the relevant part of the .target file:
<location includeDependencyScope="compile" includeSource="true" missingManifest="generate" type="Maven">
<dependencies>
......
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.1.4</version>
<type>jar</type>
</dependency>
</dependencies>
</location>
The resulting bundle is included from the plugin that uses this Json implementation: this is the MANIFEST of the plugin
Require-Bundle: org.glassfish.javax.json;bundle-version="1.1.4"
The plugin compiles and run normally. The problem happens at runtime, when the Json implementation is loaded:
2022-03-11 09:44:18,166 ERROR [main]: Provider org.glassfish.json.JsonProviderImpl not found
2022-03-11 09:44:18,168 ERROR [main]:
javax.json.JsonException: Provider org.glassfish.json.JsonProviderImpl not found
at javax.json.spi.JsonProvider.provider(JsonProvider.java:99)
at javax.json.Json.createReader(Json.java:225)
at com.test.mas.rcp.hwconfigurator.sirius.core.utils.MotorDataHandler.parseMotorJsonFile(MotorDataHandler.java:64)
at com.test.mas.rcp.hwconfigurator.sirius.core.utils.DBHandler.initMotorsDB(DBHandler.java:209)
at com.test.mas.rcp.hwconfigurator.sirius.core.utils.DBHandler.getMotors(DBHandler.java:116)
at com.test.mas.rcp.hwconfigurator.sirius.core.impl.FieldBusDevice.getMotors(FieldBusDevice.java:1323)
at com.test.mas.rcp.hwconfigurator.sirius.core.impl.FieldBusDevice.createFromSiriusString(FieldBusDevice.java:1257)
at com.test.mas.rcp.hwconfigurator.sirius.core.impl.HwConfiguratorFactoryImpl.createFieldBusDeviceFromString(HwConfiguratorFactoryImpl.java:252)
at com.test.mas.rcp.hwconfigurator.sirius.core.impl.HwConfiguratorFactoryImpl.createFromString(HwConfiguratorFactoryImpl.java:93)
at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.createFromString(XMLHelperImpl.java:1615)
at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHelperImpl.java:1156)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2710)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setAttribValue(XMLHandler.java:2769)
at org.eclipse.emf.ecore.xmi.impl.SAXXMIHandler.handleObjectAttribs(SAXXMIHandler.java:79)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFactory(XMLHandler.java:2247)
Caused by: java.lang.ClassNotFoundException: org.glassfish.json.JsonProviderImpl cannot be found by javax.json-api_1.1.4
at org.eclipse.osgi.internal.loader.BundleLoader.generateException(BundleLoader.java:516)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:511)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:403)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:168)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at javax.json.spi.JsonProvider.provider(JsonProvider.java:96)
at javax.json.Json.createReader(Json.java:225)
at com.test.mas.rcp.hwconfigurator.sirius.core.utils.MotorDataHandler.parseMotorJsonFile(MotorDataHandler.java:64)
at com.test.mas.rcp.hwconfigurator.sirius.core.utils.DBHandler.initMotorsDB(DBHandler.java:209)
at com.test.mas.rcp.hwconfigurator.sirius.core.utils.DBHandler.getMotors(DBHandler.java:116)
at com.test.mas.rcp.hwconfigurator.sirius.core.impl.FieldBusDevice.getMotors(FieldBusDevice.java:1323)
at com.test.mas.rcp.hwconfigurator.sirius.core.impl.FieldBusDevice.createFromSiriusString(FieldBusDevice.java:1257)
at com.test.mas.rcp.hwconfigurator.sirius.core.impl.HwConfiguratorFactoryImpl.createFieldBusDeviceFromString(HwConfiguratorFactoryImpl.java:252)
The javax.json-1.1.4.jar is not found at runtime by the api jar javax.json-api_1.1.4.
The only way I found to make it work is to add the implementation jar to the runtime classpath settings of the plugin, in the Bundle-Classpath:
Bundle-ClassPath: .,
lib/javax.json-1.1.4.jar,
This requires the jar in the lib folder of the plugin, while it is already included from the tartget platform. It should be enough..
Is there a configuration or something to be done to make the OSGi environment recognise the jar as a Maven dependency at runtime?
I have read about Eclipse-BuddyPolicy and DynamicImport-Package but I don't know how to used them in my case, and if they are usefull.
This https://github.com/eclipse-ee4j/jsonp/issues/96 says that it "Should be fixed with javax.json:1.1.4 and jakarta.json:1.1.5" but I don't
get how...
I managed to fix this problem, thanks to the comments in this thread:
https://github.com/eclipse-ee4j/jax-ws-api/issues/90
in particular the last one:
https://github.com/eclipse-ee4j/jax-ws-api/issues/90#issuecomment-952793454
This is related to a veri similar problem I had with the implementation of the
com.sun.xml.ws.spi.ProviderImpl web service provider.
Including the OSGi Resource Locator in the bundle manifest, and the plugin with the actual implementations, make them discoverable at runtime.
This is the dependency in the target platform file:
<dependency>
<groupId>org.glassfish.hk2</groupId>
<artifactId>osgi-resource-locator</artifactId>
<version>2.5.0-b42</version>
<type>jar</type>
</dependency>
In the end, for the Json problem, I switched to the Eclipse Parsson implementation which works at runtime without problems.
These are the needed dependencies in the target platform:
<dependency>
<groupId>org.eclipse.parsson</groupId>
<artifactId>jakarta.json</artifactId>
<version>1.0.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.eclipse.parsson</groupId>
<artifactId>parsson</artifactId>
<version>1.0.0</version>
<type>jar</type>
</dependency>

Missing artifact bst-player-api:jar:2.0.3

as im trying mvn install on my project i get this :
[WARNING] The POM for com.bramosystems.oss.player:bst-player-api:jar:2.0.3 is missing, no dependency information available.
[ERROR] Failed to execute goal on project myproject-web: Could not resolve dependencies for project com.myproject:myproject-web:war:0.0.1-SNAPSHOT: Failure to find com.bramosystems.oss.player:bst-player-api:jar:2.0.3 in http://repo.geosdi.org was cached in the local repository, resolution will not be reattempted until the update interval of geosdi.org has elapsed or updates are forced ->
my main pom :
<dependency>
<groupId>com.bramosystems.oss.player</groupId>
<artifactId>bst-player-api</artifactId>
<version>2.0.3</version>
</dependency>
myproject-web pom :
<dependency>
<groupId>com.bramosystems.oss.player</groupId>
<artifactId>bst-player-api</artifactId>
<scope>provided</scope>
</dependency>
also in eclipse i have error shown on this dependency which says :
Missing artifact com.bramosystems.oss.player:bst-player-api:jar:2.0.3
i have no clue what to do..
It is up again after my post. I had the same problem.
https://groups.google.com/forum/#!topic/bst-player/onB1PNLc6kk

org.hibernate.cfg.beanvalidation.TypeSafeActivator;141) HHH000274: Unable to apply constraints on DDL

I am using JDK 1.7 with Maven 3.0 for my project.
When I have the following in pom.xml
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>compile</scope>
</dependency>
I am getting the following while deploying to Weblogic 10.3.6 integrated with Eclipse
WARN (org.hibernate.cfg.beanvalidation.TypeSafeActivator;141) HHH000274:
Unable to apply constraints on DDL for test.entity.Employee
java.lang.NullPointerException at
org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL(TypeSafeActivator.java:172)
If I remove javaee-api dependency, then I do have issues when I compile project using mvn compile with errors like
[ERROR] /domain/view/EmployeeNameConverter.java:[29,76] cannot access
javax.el.ELContext
class file for javax.el.ELContext not found
[ERROR] /EmployeeNameConverter.java:[28,55] cannot access javax.el.ELResolver
class file for javax.el.ELResolver not found
More details here
How can I resolve this issue?
Like we've worked out in the comments Weblogic 11g doesn't support Java EE6. So one solution can be using Java EE5 instead.

Upgrading GWT from 1.7 to 2.4 using Maven

In my project we are using GWT 1.7 and now we want to upgrade it to 2.4. We also using maven 1.6 to build project. I've changed all pom.xml files so they look like this:
<properties>
<gwt.version>2.4.0</gwt.version>
</properties>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwt.version}</version>
<scope>runtime</scope>
</dependency>
</dependencies>
Now, when i'm trying to build project, it crushes with error:
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] artifact not found - Unable to download the artifact from any repository
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.google.gwt -DartifactId=gwt-dev -Dversion=2.4.0 -Dclassifier=linux-libs -Dpackaging=zip -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.google.gwt -DartifactId=gwt-dev -Dversion=2.4.0 -Dclassifier=linux-libs -Dpackaging=zip -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
com.google.gwt:gwt-dev:zip:2.4.0
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
smartgwt-maven (http://www.smartclient.com/maven2),
repo.pentaho.org (http://repository.pentaho.org/artifactory/pentaho),
java-net-maven2 (http://download.java.net/maven/2),
thirdparty.pentaho.org (http://repository.pentaho.org/artifactory/thirdparty),
Octo Technology Nexus (http://forge.octo.com/nexus/content/groups/public),
codehaus-maven-repo (http://repository.codehaus.org/org/codehaus/mojo/)
I've downloaded files gwt-2.4.0.zip and gwt-servlet-2.4.0.jar, and tried to mvn install both of them, and now i have in my .m2/repository/com/google/gwt/ 4 directories: gwt, gwt-dev, gwt-servlet and gwt-user, all of them have 2.4.0 category inside (some also have old 1.7.0) directory, but the build error still appears.
UPDATE
Now i've change version to <gwt.version>2.5.0-rc1</gwt.version> , started maven build, i saw when mvn was downloading the required package, but it appears again:
com.google.gwt:gwt-dev:jar:2.5.0-rc1
not found. I've downloaded the gwt-2.5.0.zip from google website, and there are a lot of .jar files inside, which one should i install?

PlayN showcase-html validation issue

I am new to both GWT and PlayN. Followed two installation guides from the PlayN wiki to get PlayN working in Eclipse: BeginnerInstallationGuide and GettingStarted. I can run the showcase-java project but the showcase-html version produces a problem during compiling, saying that it cannot find a validation jar. This is the output of the GWT compiler:
Compiling module playn.showcase.Showcase
Resolving com.google.gwt.validation.client.constraints.AbstractDecimalMaxValidator
Found type 'com.google.gwt.validation.client.constraints.AbstractDecimalMaxValidator'
Found type 'javax.validation.constraints.DecimalMax'
[WARN] Detected warnings related to 'javax.validation.Constraint'. Is validation-< version>.jar on the classpath?
Specify -logLevel DEBUG to see all errors.
[WARN] Ignoring unresolvable annotation type javax.validation.Constraint
Compiling 1 permutation
Compiling permutation 0...
Compile of permutations succeeded
Linking into C:\Users\Jo\playn-samples\showcase\html\target\playn-showcase-html-1.0-SNAPSHOT\showcase
Link succeeded
Compilation succeeded -- 62.900s
Would appreciate any help!
I don't have the answer,
but maybe try to clean and re-built the project "playn-showcase".
Also try to run "mvn package" (in eclipse: Run as... / Maven build... with goal 'package') for the project "playn-showcase" (explicitely not "playn-shocase-html").
This procedute probably creates the missing jar 'playn-showcase-html-1.0-SNAPSHOT.jar'.
Try adding the following dependencies to the showcase-html pom.xml if they don't already exist...
<dependencies>
...
<!-- not really needed, but will suppress errors during GWT compilation -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<classifier>sources</classifier>
<scope>provided</scope>
</dependency>
...
</dependencies>