i'm new in primefaces word , and i need to use primefaces extensions (inputNumber)
in the XHTML file I add the taglib :
xmlns:pe="http://primefaces.org/ui/extensions"
when adding the jar :
primefaces-extensions-0.6.3;
I have an error : La ressource demandée n'est pas disponible.
When removing it, the application works but the inputNember doesn't show and I get this
error:
Warning: This page calls for XML namespace http://primefaces.org/ui/extensions declared with prefix pe but no taglibrary exists for that namespace.
To work with primefaces extensions i should add to the XHTML file the taglib:
xmlns:pe="http://primefaces.org/ui/extensions"
and to the lib folder two jars:
primefaces-extensions-0.6.3.jar
common-lang3.jar.
that is all.
If you are using maven for your dependencies, the required entry is
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>primefaces-extensions</artifactId>
<version>0.6.3</version>
</dependency>
This will add the required dependencies for primefaces extensions.
If you are not using maven, then you should follow the Getting Started guide for "other users" and add all the necessary jars
For me, one maven dependencies is missing !
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
Attention: currently "commons" is with S at end
At 2016.12.24, the version of extension can now be 6.0.0
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>primefaces-extensions</artifactId>
<version>6.0.0</version>
</dependency>
Thanks to Rong Nguyen and Ghizlane La
Last remark
I have encouter some problems (error message in Chrome indicating that some ressources are missing) because the versions used for Primefaces and PrimefacesExtension end Commons-lang3 are not compatible !
But I have found that the following combination work correclty for me.
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.5</version>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>6.0</version>
</dependency>
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>primefaces-extensions</artifactId>
<version>6.0.0</version>
</dependency>
I hope that will be useful for others :-)
Related
I only added this dependency and i am not able to start my application.
Can you explain why it is happening?
Without this dependency the spring-boot application is working. I tried to use 2.5.4 and 2.4.2 versions of spring-boot.
It is causing the following error:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-feign</artifactId>
<version>1.4.7.RELEASE</version>
</dependency>
Caused by: java.io.FileNotFoundException: class path resource [org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.class] cannot be opened because it does not exist
I was facing same issue and I resolved it . in your pom , remove version from all spring-cloud dependency and then add below thing in your pom :
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>2021.0.1</spring-cloud.version>
</properties>
and
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Note : please pick version as per your requirements. thanks.
Created an application using micronaut bom 1.2.10 version, along with software.amazon.awssdk:lambda:2.10.56 & software.amazon.awssdk:s3:2.10.56 dependencies which had functionality to retrieve data from s3 storage and used graal 19.2.1 to create a native image.
The native image is successfully created but when i try to access the endpoint it fails for below exception:
failed: org.apache.commons.logging.LogFactoryjava.lang.NoClassDefFoundError: org.apache.commons.logging.LogFactory
and series of exceptions with specifically while creating S3 client.
The exception also had failure at below point:
failed: Could not initialize class software.amazon.awssdk.http.apache.internal.conn.SdkTlsSocketFactoryjava.lang.NoClassDefFoundError: Could not initialize class software.amazon.awssdk.http.apache.internal.conn.SdkTlsSocketFactory
Code for S3Client :
S3Client s3Client = S3Client.builder().region(getRegion()).build();
build-native-image.sh
${GRAALVM_HOME}/bin/native-image --no-server -cp example-function-*-all.jar
-H:IncludeResources="git.properties"
-H:IncludeResources="logback.xml"
-H:IncludeResources="application.properties" \
So this issue was resolved by adding below configuration in build.gradle:
allprojects {
configurations {
all {
exclude(group = "commons-logging")
}
}
}
and in the dependencies added:
compile group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.30'
I hope this helps.
I faced the same issue, when running tests, with the exact same NoClassDefFoundError but when using AWS sts and secretsmanager libraries. I could actually get it to work by just including the jcl-over-slf4j dependency, while the error happened when using the slf4j-api dependency. I did not need to exclude commons-logging. Snippet of dependency in maven pom.xml that worked:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.17.89</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>secretsmanager</artifactId>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>sts</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
</dependencies>
I am migrating my codebase from junit4 to junit5.I have used mockito in my testcase.Below are the different version that i am using for the dependency.
<junit.jupiter.version>5.2.0</junit.jupiter.version>
<junit.platform.version>1.2.0</junit.platform.version>
<org.mockito.version>1.10.19</org.mockito.version>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>2.19.0</version>
<scope>test</scope>
</dependency>
I have used the annotation #RunWith(MockitoJUnitRunner.class) to run my mockito code.Replaced the same with #ExtendWith(MockitoExtension.class)
But when i run the test case i get the below error. Any suggestion to solve this issue. I suspect is there any dependency version issue which is causing this problem.
java.lang.NoClassDefFoundError: org/mockito/quality/Strictness
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getConstructor0(Class.java:3075)
at java.lang.Class.getDeclaredConstructor(Class.java:2178)
at..
Thanks
-Sam
The JUnit5 MockitoExtension uses org.mockito.quality.Strictness so in order to use MockitoExtension you'll need to use a version of mockito-core which contains org.mockito.quality.Strictness. mockito-core:1.10.19 does not contain that class because that class was added in Mockito 2.x. So, in order to use MockitoExtension you'll need to use at least version 2.x of mockito-core.
The Mockito docs don't make this explicit but I suspect the expectation is that you'll use the same Mockito version for mockito-core and for mockito-junit-jupiter.
The following dependencies will allow you to use the JUnit5 MockitoExtension successfully:
<org.mockito.version>2.19.0</org.mockito.version>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${org.mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${org.mockito.version}</version>
<scope>test</scope>
</dependency>
I tried to use same version for mockito-junit-jupiter and mockito-core, but fails.
At last I init the mocks myself in #BeforeEach block.
#BeforeEach
private void setup() {
MockitoAnnotations.initMocks(this);
}
as a workaround.
Thanks for the response #glytching .With your input i was able to find the correct version dependency for me and it resolved my issue. Below is the version that i used to resolve the same.
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>1.3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>2.22.0</version>
<scope>test</scope>
</dependency>
Also i needed mockito-core => version 2.22.0. But above mentioned mockito-junit-jupiter comes with mockito core dependency internally.So no need to add that dependency.
I have a Spring REST project configured with hsqldb.
I would like to change it to MySQL.
I have MySQL server installed and running, but I don't know how to modify this pom:
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>runtime</scope>
</dependency>
PS.: Project im talking about comes as a source code for 'Spring REST' book:
http://www.apress.com/9781484208243
source code download link:
http://www.apress.com/downloadable/download/sample/sample_id/1704/
As far I see you are using Spring Boot on this, so you can easy change the databases changing the drivers dependencies from:
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>runtime</scope>
</dependency>
To
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
The driver version will be version on parent pom.
Then specify the parameters on properties
spring.datasource.url=jdbc:mysql://localhost:port/yourdb
spring.datasource.username=dbuser
spring.datasource.password=dbpass
spring.datasource.driver-class-name=com.mysql.jdbc.Driver # we can ommit this if we want, Spring Boot will deduce based on the classpath
For more configuration on databases you can see the properties available on appendix here
Found this example, exactly what I want: MOXy's #XmlVariableNode - Using a Map's Key as the Node Name, but tough luck using it in my Jersey 2.2 application.
#XmlVariableNode("key") on MapAdapter.AdapterdMap.entry is giving a compile error:
XmlVariableNode cannot be resolved to a type
Reason being org.eclipse.persistence.oxm.annotations.XmlVariableNode is only available in org.eclipse.persistence.moxy (EclipseLink Moxy) 2.5.1 and 2.6.0, which are only available in a nightly build at the moment.
To make it work with Jersey 2.2 which is using 2.5.0 of EclipseLink Moxy, use the following pom.xml dependencies:
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-moxy</artifactId>
<version>2.2</version>
<exclusions>
<!-- To get early access to org.eclipse.persistence.oxm.annotations.XmlVariableNode -->
<!-- TODO get rid of exclusion and use jersey.version=2.3 when it's released -->
<exclusion>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.moxy</artifactId>
<!--<version>2.5.0</version>-->
</exclusion>
</exclusions>
</dependency>
<dependency>
<!-- To get early access to org.eclipse.persistence.oxm.annotations.XmlVariableNode -->
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.moxy</artifactId>
<version>2.5.1-RC1</version>
</dependency>
and you'll need the SNAPSHOT repository as well:
<repositories>
<repository>
<id>oss.sonatype.org</id>
<name>OSS Sonatype Staging</name>
<url>https://oss.sonatype.org/content/groups/staging</url>
</repository>
</repositories>
Please note that 2.5.1-RC1 is a [more] stable build, alternatively you can use 2.5.1-SNAPSHOT or 2.6.0-SNAPSHOT. For more info dependencies see
http://wiki.eclipse.org/EclipseLink/Maven
https://oss.sonatype.org/index.html#nexus-search;quick~org.eclipse.persistence.moxy
Whenever they release the next version, you can remove the snapshot/RC tag, to watch the news: http://wiki.eclipse.org/EclipseLink; the proposed 2.5.1 date is 27th September 2013
According to Jersey's Road Map 2.3 is coming out 23th September 2013, so it is impossible to include 2.5.1..., so maybe 2.4, until then ... wait for it ... dependency exclusion.