I am trying scan my projects in gradle using Vulas and always get the same error:
"Application context is required to execute goal APP."
Could you tell me what is missing or what exactly this error means? What exactly Vulas is trying to looking for?
Thanks.
The root cause of this error is that Vulas does not know the application's unique identifier.
How to specify this identifier depends on the programming language and build tool:
Maven (Java): The identifier is automatically taken from pom.xml.
Gradle (Java): The identifier is partly taken from build.gradle and has to be complemented with information from gradle.properties (properties group and version).
Setuptools (Python): The identifier is automatically taken from setup.py.
CLI: The identifier has to be specified using configuration parameters vulas.core.appContext.group, vulas.core.appContext.artifact and vulas.core.appContext.version.
Cheers, Henrik
Related
I am unable to build a maven AEM project because of failure to resolve cndNames.
Failed to execute goal net.adamcin.oakpal:oakpal-maven-plugin:1.5.1:scan (default) on project *******: Failed to execute package scan. Failed to resolve cndNames.: Failed to find node type definition on classpath for cndName exportnodetype.jsp
Can someone please help me out here?
The plugin you're referring to is responsible for validating the content of your package against a predefined set of node types.
Node type definitions can be used to restrict the structure of nodes in the Java Content Repository and they can be managed per instance. Some node types come out-of-the-box, such as nt:unstructured, nt:file, nt:folder and some may be specific to your project or a 3rd party tool you've installed.
In general, the content packages you're installing should only contain serialised content matching known node types. This is what the plugin validates as the project is built. In order to do that, the plugin requires a file with node type definitions, telling it what your AEM instance can recognise.
The error suggests that the plugin is failing to load this file. The documentation describes the steps required to export node types and configure the plugin by adding the definitions as a classpath resource, e.g. under src/test/resources
If the documentation doesn't help, consider having a look at the sources of the plugin to understand what it does when it's throwing the exception.
I am trying to set up sonar for my Hybris project to scan my code and I am using java 8 and sonarqube 7.0. I use ant commands.
When I run ant sonar, I get the following error
....resources/ant/sonar.xml:89: Two modules have the same id: ''. Each module must have a unique id.
I see that this is called from sonar-scanner jar file but I am not sure what is causing this
Each project and module must have a unique id within SonarQube. You don't specify whether your project is multi-module or not, but since you're using Ant, I know you've manually defined your analysis properties. Comb through them to make sure each sonar.projectKey value in this project is unique - both within the project and across your SonarQube instance.
I am trying to create a Karaf assembly using Maven (and NetBeans). I create my bundles using declarative services, but I am having problems creating feature files. Part of my problem is the error messages that OSGi generates. But I have a more general questions.
I have discovered that I can call karaf-maven-plugin in the project that creates my bundles and it generates what appears to be a comprehensively populated feature file based on the dependencies of the bundle. (Method 1)
However, I have read somewhere that creating a feature file with karaf-maven-plugin should normally only be done in a project with feature packaging. If I do this, it seems to me that I have to create the feature file by hand, which is not a lot of fun. (Method 2)
No matter which method I use, I have been unable to successfully generate a Karaf assembly that contains anything other than simple bundles without any dependencies. I am currently stuck trying to install a single bundle that needs to wrap some non-OSGi dependencies. Method 1 above generates the wrap stuff (<feature> and wrap: protocol). All I get is the following error:
Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.1.0:assembly (default-assembly) on project EnoceanBridgeAdmin: Unable to build assembly: [wrap/0.0.0]
EnoceanBridgeAdmin is the karaf-assembly packaging that I'm trying to build. It has a dependency on the bundle that contains the generated feature file (where wrap is referenced):
<dependency>
<groupId>net.winnall.enocean.service.impl</groupId>
<artifactId>EnoceanBridgeSASS.Impl</artifactId>
<version>0.99.99</version>
<type>xml</type>
<classifier>features</classifier>
</dependency>
So my questions:
Is method 1 above a correct usage?
Can I automatically generate a feature file to use method 2?
Will the error message disappear after I've got method 1 or 2 sorted?
Steve
I have resolved this myself.
Method 1 does not work because karaf-maven-plugin generates <feature> definitions for wrap. These cause the error mentioned above. Apparently – at least with Karaf 4.1.0 – the wrap: protocol is used in a feature file without a prior <feature> definition.
Method 2 (writing the feature file yourself) is thus the only viable option because of the behaviour of karaf-maven-plugin.
Yes, the error message disappeared :-)
Summary: I'm trying to access project properties (such as the version) in Java, and everywhere I've read says I need to expand properties in my build.gradle file. That's all fine and dandy, but I'm using LDAP and am configuring it in my properties file. Whenever I try to expand properties, I get the LDAP error 49 52e (Invalid Credentials), so it seems that whatever Gradle does to process the properties warps the LDAP properties so they are no longer usable.
Project Info:
I've outlined what I've thought to be the applicable project info below. If there are further details needed to determine the issue, comment and I'll add them.
Language:
Groovy 2.4
Java 8
Framework:
Spring Boot version: 1.3.1.RELEASE with starter POM
spring-boot-starter-security included
spring-security-ldap included
Build Tool: Gradle
Version 2.3
Spring Boot Gradle Plugin 1.3.1.RELEASE
Applied Plugins:
groovy
spring-boot
Build Info: I've tried a few different configurations in my build.gradle file to acess the version, but the moment I add the 'processResources' block, I can no longer access LDAP when running the application. The application runs and authenticates just fine without a 'processResources' block, but as soon as I add it, it will run, but I can't access anything due to LDAP complaining about invalid credentials. I tried 3 different expand configurations and all behaved this way.
Build Config Attempt 1:
processResources {
expand(project.properties)
}
Build Config Attempt 2:
processResources {
filesMatching('**/*.properties') { expand(project.properties) }
}
At this point it occurred to me that I'm configuring my LDAP login in a properties file, so maybe the solution was to avoid properties files altogether. I found out that you can supposedly just expand the properties you need, so I tried the following.
Build Config Attempt 3:
processResources {
expand projectVersion: project.version
}
As stated before, all of the above attempts failed and I still got LDAP authentication errors for each of them. A build.gradle file without a 'procesResources' block seems to be the only way to keep LDAP happy.
Properties Info: As stated before, I configured LDAP information in my properties files. Below are the relevant properties.
application.properties
spring.profiles.active=localdev
ldap.securitygroup=DEV
logout.path=
host.securePort=
As you can see, I'm using a localdev profile, so I've included the applicable properties from it below. Since it included sensitive information, I've only specified the property names and not their values. I've used a star (*) to indicate that there was a non-empty value provided. (in the above application.properties file the values were indeed empty for a couple of the properties listed):
application-localdev.properties
host.securePort=*
ldap.username=*
ldap.password=*
ldap.base=DC=*,DC=*,DC=*
ldap.roleSearchBase=OU=*,DC=*,DC=*,DC=*
ldap.defaultUrl=ldap://*
ldap.urls=ldap://* ldap://*
The properties didn't change at all, it just all worked without the processResources block in the build.gradle file, and then didn't when I added any of those 3 versions of it.
Any assistance to help figure this help would be greatly appreciated, and if any further information is needed, let me know and I'll update this.
So a co-worker gave me a great tip and said I could check the properties in the JAR file to see if there were different from what was originally specified.
Long story short, when I don't have a processResources block in the build.gradle file, the properties don't change and everything's happy. However, when processResources is added, ESCAPE CHARACTERS ARE REMOVED, causing the username to change, since I had an escape character in it.
The workaround I'm now using is to double up on the escape characters, which seems like a hack to me, so if there's a better way to configure this, please reply!
I am trying to deploy EAR file on Websphere Application Server but while deploying it's showing an error.
ERROR CODE:
SEVERER: Exception org.exolab.castor.xml.ValidationException was not added to the list of sorted types.
The project was not built since its build path is incomplete. Cannot find the class file for org.exolab.castor.xml.ValidationException. Fix the build path then try building this project.
I am using Castor in my project but it's there in classpath which i am setting through Shellscript.
Thanks for help in advance.
Your dependencies need to be expressed to the application server runtime, not added to some shell variable or standalone java invocation. Either package them in your application or create an isolated shared library and associate it with your dependent application.