I want import docs.actor.japi.FaultHandlingDocSample.WorkerApi.*; But I can't find the docs package which can use in maven central repository. And I don't find the information about docs package in the Akka official website.The akka version I used is 2.4.6.
If you are still seeing this error, remove the declarations for docs.* from the top of the example code. All of the values are present in the file itself. Re-import the declarations referencing the file and the errors should resolve.
Related
I have got a code with following imports:
import com.thoughtworks.selenium.Selenium;
import com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium;
I tried to use Maven to resolve, but I can't found these packages on https://mvnrepository.com. There are packages only under org.seleniumhq.selenium, but these aren't able to resolve method calls in code and there aren't any selenium named packages under com.thoughtworks.
It looks like those packages come from Selenium RC, from the times when it was created by ThoughtWorks.
See deprecated package list here, and migration guide here.
You probably want to migrate by disposing of the old dependency, re-writing the client code according to documentation, and use WebDriver.
In that case, your Maven groupID would be org.seleniumhq.selenium, as documented here.
I am quiet familiar with protobuf 2.5. I was trying to use protobuf3.0. It seems that the jar is to be generated form the source code available online. But when i import the source code into eclipse and try to create a jar, i can see many errors in the following files
/protobuf3/src/com/google/protobuf/Descriptors.java,
/protobuf3/src/com/google/protobuf/DynamicMessage.java
/protobuf3/src/com/google/protobuf/ExtensionRegistry.java
/protobuf3/src/com/google/protobuf/MessageReflection.java
/protobuf3/src/com/google/protobuf/TextFormat.java
/protobuf3/src/com/google/protobuf/UnsafeUtil.java
This is one of the errors "the import com.google.protobuf.DescriptorProtos cannot be resolved".
Is this the right way to generate the jar (or) is it available anywhere (or) is the full source code available anywhere.
Any help would be appreciated.
Thanks.
This is where i downloaded the source code protobuf3.0-source code
You can find a compiled (JAR) version of Protobuf to download here:
http://search.maven.org/remotecontent?filepath=com/google/protobuf/protobuf-java/3.0.0/protobuf-java-3.0.0.jar
I recommend you look at a build manager such as https://maven.apache.org/ to automatically handle fetching dependencies (libraries) for you.
So i am using gradle to get dependencies from maven central which is working fine. I just don't know how to import them to my actual java file.
How do i found out the name to import it?
at the top of my java file i have to write
import <name>
How do i find the name?
Thank You.
According to your comments. You have to import the packages, which are contained within the library, not the library itself. There is no guarantee, this package names are the same as group or artifact id of the library. To get know that package names, usually you may use a javadocs for the library. Or just simply let your IDE to make it for you, them you're trying to use some classes from that lib.
Alternatively, you can use some off-sites, like mvnrepository.com, where you may find your library and take a look at the packages list within it. For example, description for Apache Commons Lang library, where you can see the "Packages" section with all the packages within the lib. You may import them, just like:
import org.apache.commons.lang3.*;
One more solution, is to unzip a jar and take a look into it's content to determine the packages structure.
I am importing a Jar file "com.ibm.mq.jar" into my workspace(Eclipse IDE).
While importing, a screen came where I could see all the classes in the Jar file.
After I imported it into the work space, I was able to import the package and following statement didn't give any error.
import com.ibm.mq.*;
But, in code I am not able to use any of the classes which were there in the package.
Like, "MQC" is a class in the package, but in code it doesn't reflect("MQC cannot be resolved as a type" error comes if I try to use it).
This jar file actually contains Websphere MQ API classes.
Can anyone advise, what am I missing.
If you're using MQ 7, check its documentation here. There was some stuff going on about deprecation of com.ibm.mq.mqc and, depending on the version you use, that class was replaced by com.ibm.mq.constants.MQConstants. Like this one, there are other cases.
In fact com.ibm.mq only contains the exception MQException, so you won't find any classes there. I suggest you check the version you're using and dig a little deeper into the docs, as a first step.
I'm trying to validate something using the GWT BeanValidation but these two lines are giving me some trouble:
Validator validator=Validation.buildDefaultValidatorFactory().getValidator();
Set<ConstraintViolation<Contact>> violations = validator.validate(contact, Default.class);
The thing is, I have imported the corresponding classes:
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.groups.Default;
But still, the Validator, Validation, ConstraingViolation and Default references in the code are underlined in red and the error they show is:
javax.validation.Validator can not be found in source packages. Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly.
I have checked that the necessary lib validation-api-1.0.0.GA.jar is in the classpath and everything seems normal.
Anyone happens to know what could be the problem?
thanks!!
I see only two possibilities
Check the size of jar file , either in your local maven repository which your build path is pointing to or check that in your eclipse by browsing its source code to double check its there :)
Have you inherited this is any awt module using ? Can you check its syntax or if it is really required?
Do you have validator-implementation in your classpath? AFAIK, javax.validation is only the API (interfaces), you'll need an actual validator-implementation to use it. See for example Hibernate Validator.