Unable to import com.vaadin.data.util.PropertysetItem - java

Just tried importing PropertysetItem after adding vaadin dependency which I have mentioned below but was unable to import. Can anyone help me for finding the right dependency
dependency added
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-compatibility-server</artifactId>
<version>8.4.0</version>
</dependency>

PropertysetItem as well as other related classes have been moved to the com.vaadin.v7.data.util package. You thus need to update your import statements to take the new package name into account.

Related

Cannot use #NotBlank

I just started working with spring and I'm trying to use #NotBlank. Problem is it is not working. In pom.xml I have this dependency:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<version>2.7.1</version>
</dependency>
The error I'm getting is this:
This is my import:
import javax.validation.constraints.NotBlank;
and I'm also getting this error:
I have searched similar questions and the answer is that by adding this dependency and restarting IDE will work. In my case it's still not working. Any suggestions?
Add a dependency on javax.validation:validation-api:2.0.1.Final. That defines the validation API (i.e. the interface) but does not implement it. spring-boot-starter-validation has a dependency on hibernate-validator which is the reference implementation of Java's validation API.
You imported the implementation but not the interface which is why your IDE was complaining. By importing both the interface and the implementation that code should compile.

Package org.springframework.cloud.netflix.sidecar does not exist

I want to use sidecar to call flask with spring cloud, but when I import org.springframework.cloud.netflix.sidecar, hint does not exist.
I guess it's because there's no jar package for sidecar.But I don't know which jar package to use.
Who can help me?
thanks!
Need to include :
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-sidecar</artifactId>
<version>2.1.0.RELEASE</version>
</dependency>
https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-netflix-sidecar/2.1.0.RELEASE

Maven dependency doesn't exist after pom.xml dependency addition in Java?

After I added this dependency to my pom.xml file:
<dependency>
<groupId>com.miglayout</groupId>
<artifactId>miglayout-swing</artifactId>
<version>5.0</version>
</dependency>
I tried to import com.miglayout.*; but I got the error:
package com.miglayout does not exist
How come nothing is wrong with other libraries I have imported using Maven in the same project, but I get issues with com.miglayout?
I believe the correct package is net.miginfocom.*
The maven groupId does not always correlate with the package name.
See MigLayout Javadocs
The classes inside the MiG layout library are under the packages:
net.miginfocom.swing for the miglayout-swing artefact
net.miginfocom.layout for the miglayout-core artefact (transitive dependency of miglayout-swing).
If you are using an IDE, you should not write the imports yourself and let the IDE handle it. This way, you will avoid mistakes relating to wrong package imports. Also, you should not use import on-demand and prefer single type import.

Where is the maven dependency for ConfigurableEmbeddedServletContainerFactory?

I am trying to follow this example for setting up SSL with Tomcat in Spring Boot. The example is unfortunately missing the import statements, so I tried to infer the correct import statement for ConfigurableEmbeddedServletContainerFactory.
However, I still encounter the following error:
The import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainerFactory cannot be resolved
I think this means I am missing the maven dependency for this particular class. Can anyone point me to what this is?
from code for file package is org.springframework.boot.context.embedded
maven dependency
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>x.x.x</version>
</dependency>

Importing Java OrientDB Packages

I am not new to Java per se... or looking up answers for myself. But for some reason I cannot import the OrientDB packages. I have looked at the following simple examples:
https://github.com/orientechnologies/orientdb/wiki/Java-Tutorial:-Introduction
Trying to work with OrientDB
example:
import com.tinkerpop.blueprints.TransactionalGraph;
import com.tinkerpop.blueprints.impls.orient.OrientGraph;
but I keep getting "package * does not exist" for any import combination I use.
I was under the impression that all I needed to get started was 'orientdb-community-1./lib/orientdb-core-1..jar'. Where is 'com', 'tinkerpoop' and 'blueprints' coming from?
Tinkerpop Blueprints is a standard for Graph Database API.
It is a separate project, you can find all the details here:
http://www.tinkerpop.com/
OrientDB supports Tinkerpop Blueprints, so it is part of the dependencies.
If you download latest OrientDB version, you will find a jar file named blueprints-core-**.jar under the /lib directory. This jar contains the com.tinkerpop.blueprints package.
To get started with OrientDB in your java application, you will need at least orientdb-commons.jar, orientdb-client.jar and orientdb-core.jar, but I suggest you to import into your classpath all the orient-*.jar files
try to import this libraries into your project
<properties>
<orientdb.version>2.1-rc4</orientdb.version>
</properties>
<dependencies>
<dependency>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-core</artifactId>
<version>${orientdb.version}</version>
</dependency>
<dependency>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-client</artifactId>
<version>${orientdb.version}</version>
</dependency>
<dependency>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-object</artifactId>
<version>${orientdb.version}</version>
</dependency>
<dependency>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-graphdb</artifactId>
<version>${orientdb.version}</version>
</dependency>
</dependencies>
Nevertheless, I'm currently working on a java based orientdb wrapper, designed to be the most user friendly and easy to use as possible. We are using this on a large scale project in my company, you can take a look at it if you want.. it might help!
https://github.com/alonsod86/orientdb-graph-wrapper
Once you download it execute mvn clean install and import it in your project, just like this
<dependency>
<groupId>es.alonso</groupId>
<artifactId>orientdb-graph-wrapper</artifactId>
<version>2.0.2-SNAPSHOT</version>
</dependency>
Hope it helps!

Categories

Resources