I am creating a fairly simple Java client that connects to my account and gets all the events. Here I am getting an exception saying :
java.lang.ClassNotFoundException: com.google.common.collect.Maps
Could anyone tell me which JAR am I missing and moreover where to download it from?
Google collections, now known as Guava.
I solved this problem by download the jar file guava-r07.jar.
http://code.google.com/p/guava-libraries/downloads/detail?name=guava-r07.zip
Try it.
For those of us who use Maven, here's the dependency entry for guava:
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
</dependency>
Credit where credit is due: the above is from http://mavenrepository.com/artifact/com.google.guava/guava/19.0
Did you try importing google-collect-1.0-rc1.jar?
It can be found at (in the source tree) :
http://code.google.com/p/gdata-java-client/source/browse/#svn/trunk/java/deps
Thanks,
Renu
I also solved this problem by including guava dependency. Guava is superset of the old Google Collections Library. Here is the link: https://mvnrepository.com/artifact/com.google.guava/guava/21.0
Include this dependency in your build.sbt
Related
I am using Apache Spark for the first time. I run my application and when I access localhost:4040 I get what is shown in the picture.
I found that maybe setting
spark.ui.enabled true
could help but I don't know how to do that.
Thanks in advance.
I have faced the same issue while using Spark on Google Cloud Dataproc.
If you will access Spark Job UI not through 4040 port directly, but through YARN Web UI (8088 port) you will see correctly rendered web pages.
To workaround this issue when accessing Spark UI directly through 4040 port you need to reset spark.ui.proxyBase property inside your Spark job (not in CLI/job submission command), because it gets overridden by Spark UI proxy:
sys.props.update("spark.ui.proxyBase", "")
Here is detailed description of this issue.
I Had the same problem.
Also the calls to http://localhost:4040/api/v1/applications failed returning with no response.
This happened due to a collision between 2 versions of Jersey in my classpath.
Mainly conflict between 1.x and 2.x.
What worked for me was to exclude in my Maven build the Jersey library that came from other dependencies that are not from Spark.
For example:
<dependency>
<groupId>org.apache.parquet</groupId>
<artifactId>parquet-avro</artifactId>
<version>1.9.0</version>
<exclusions>
<exclusion>
<groupId>com.sun.jersey</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
Excluding version Jersey 1.x (My Spark distro used 2.x) solved the problem.
Edit:
Also -> happened when servlet api 2.5 JAR was in classpath instead or together with 3.x
In case you are using WildFly, see if https://issues.apache.org/jira/browse/SPARK-27795 can help (there you find also (a quite ugly) workaround).
I was also facing the same problem and tried with sys.props.update("spark.ui.proxyBase", ""). Spark UI was fixed but it was still triggering errors in logs for wrong CSS related to javax.
I added below dependency and it fixed all errors:
libraryDependencies += "javax.servlet" % "servlet-api" % "2.5" % "provided"
I am trying to migrate an AppEngine project to MVM, custom runtime environment.
I faced an issue with Memcache, which was solved by replacing:
CacheManager.getInstance().getCacheFactory().createCache ...
...
with:
new XMemcachedClient(
System.getenv.get("MEMCACHE_PORT_11211_TCP_ADDR"),
Integer.parseInt(System.getenv.get("MEMCACHE_PORT_11211_TCP_PORT")))
...
(BTW, if anyone is having same issues, then maven for XMemcached is:)
<dependency>
<groupId>com.googlecode.xmemcached</groupId>
<artifactId>xmemcached</artifactId>
<version>2.0.0</version>
</dependency>
I am now facing an issue with DataStore JDO and PersistenceManager (using DataNucleus in the project).
Basically, I am looking to replace this:
JDOHelper.getPersistenceManagerFactory("xxx").getPersistenceManager() ...
...
with ?...
Are there any "magic" environment variables I can use for composing the address (like the MEMCACHE_PORT_11211_TCP_ADDR and MEMCACHE_PORT_11211_TCP_PORT is the case of Memcache)? Any other means I can communicate the datasource with (from a MVM project)?
Thanks in advance,
Ohad
You may want to consider using the gcloud-java project for accessing datastore. The big advantage here is that you can use the same code/client from App Engine, Container Engine, and Compute Engine:
https://github.com/GoogleCloudPlatform/gcloud-java
Hope this helps!
I have encountered a strange situation, the decision which I cant find.
I`m runnig simple demo application using Spring Boot 1.3.0 and Intelij Idea 14.1.3
The problem is that Spring MVC cant resolve the view:
javax.servlet.ServletException: Could not resolve view with name 'home' in servlet with name 'dispatcherServlet'
Oddity is that when I run application by Maven Spring Boot-plugin
mvn clean spring-boot:run
everythig works fine.
Both views ("home.jsp" - returning from Controller and "start.jsp" - described in Configuration class) resolve correctly.
Full source code you can see here
I`ve downloaded another demo project - the same situation.
So, I think that something wrong with my IDE configuration.
But what is going wrong - I don`t know.
In File->Project Structure
I have added Spring and web module in "Modules" tab, the same I`ve made in "Facets" tab.
What is possible to do to make application run correctly using IDE?
Problem was in dependecies configuration in pom.xml
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
I have change <scope>provided</scope> to <scope>compile</scope> and it works well.
Commonly known, that for usage of different jars we need add them to SoapUI/../ext/ directory. for example, for correct work of jdbc requests with IBM/..AS400JDBC Driver we need to add jt400.jar to /ext dir.
But I have problem: my client implements new policy - direct forbidding of using any jars locally, only as dependencies like
<dependency>
<groupId>net.sf.jt400</groupId>
<artifactId>jt400-full</artifactId>
<version>6.0</version>
</dependency>
I successfully uses it in my POM's for CI, but I also need to run my projects in SOAPUI.
So, question is: is there any way to add dependency for external jars, - exists in SoapUI preferences somewhere/somehow? Goal is to remove all jars from soapui/../ext and somehow add dependencies on official.
Sincerely,
Dmitry.
I have thought about this some more: You should be able to roll your own soapui.bat, based on the provided one.
Copy the provided soapui.bat to your desktop.
Modify the variable SOAPUI_HOME to point to your install.
Modify the variable CLASSPATH to include your jars.
Run the modified soapui.bat.
After successfully migrating my RESTful application to JBoss AS7, I would like to re-enable authentication (I used BASIC auth over SSL). It seems that this is now possible without writing XML configuration, just by using annotations.
Unfortunately, I cannot find which maven dependency I need to use to import the #WebService and #SecurityContext annotations.
Or is this completely going the wrong way? Is there a working example somewhere?
Thanks for your help!
#javax.jws.WebService is part of JDK
you might also need:
org.jboss.ws.api.annotation.WebContext;
that has option to configure authMethod #WebContext(authMethod=AuthMethod.BASIC) and is part of
<dependency>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-api</artifactId>
<version>1.0.0.GA</version>
</dependency>