Akka - Deprecation Compile Errors - java

I've decided to tackle Akka... which was going great until compile time :-/ Running Ubuntu by the way.
What I've Done So Far:
Installed JRE and JDK 7
Downloaded/Extracted Akka
Downloaded and Setup Maven
Set up PATH variables etc
All following this tutorial Tutorial
When compiling, I'm getting the following errors
javac -cp lib/scala-library.jar:lib/akka/akka-actor_2.10-2.2.1.jar akka-tutorial-first-java/src/main/java/akka/tutorial/first/java/Pi.java -Xlint:deprecation
akka-tutorial-first-java/src/main/java/akka/tutorial/first/java/Pi.java:8: warning: [deprecation] UntypedActorFactory in akka.actor has been deprecated
import akka.actor.UntypedActorFactory;
^
akka-tutorial-first-java/src/main/java/akka/tutorial/first/java/Pi.java:10: error: cannot find symbol
import akka.util.Duration;
^
symbol: class Duration
location: package akka.util
akka-tutorial-first-java/src/main/java/akka/tutorial/first/java/Pi.java:56: error: cannot find symbol
private final Duration duration;
^
symbol: class Duration
location: class PiApproximation
akka-tutorial-first-java/src/main/java/akka/tutorial/first/java/Pi.java:58: error: cannot find symbol
public PiApproximation(double pi, Duration duration) {
^
symbol: class Duration
location: class PiApproximation
akka-tutorial-first-java/src/main/java/akka/tutorial/first/java/Pi.java:67: error: cannot find symbol
public Duration getDuration() {
^
symbol: class Duration
location: class PiApproximation
akka-tutorial-first-java/src/main/java/akka/tutorial/first/java/Pi.java:112: warning: [deprecation] Props(Class<? extends Actor>) in Props has been deprecated
workerRouter = this.getContext().actorOf(new Props(Worker.class).withRouter(new RoundRobinRouter(nrOfWorkers)),
^
akka-tutorial-first-java/src/main/java/akka/tutorial/first/java/Pi.java:127: error: cannot find symbol
Duration duration = Duration.create(System.currentTimeMillis() - start, TimeUnit.MILLISECONDS);
^
symbol: class Duration
location: class Master
akka-tutorial-first-java/src/main/java/akka/tutorial/first/java/Pi.java:127: error: cannot find symbol
Duration duration = Duration.create(System.currentTimeMillis() - start, TimeUnit.MILLISECONDS);
^
symbol: variable Duration
location: class Master
akka-tutorial-first-java/src/main/java/akka/tutorial/first/java/Pi.java:158: warning: [deprecation] Props(Class<? extends Actor>) in Props has been deprecated
final ActorRef listener = system.actorOf(new Props(Listener.class), "listener");
^
akka-tutorial-first-java/src/main/java/akka/tutorial/first/java/Pi.java:161: warning: [deprecation] UntypedActorFactory in akka.actor has been deprecated
ActorRef master = system.actorOf(new Props(new UntypedActorFactory() {
^
akka-tutorial-first-java/src/main/java/akka/tutorial/first/java/Pi.java:161: warning: [deprecation] Props(UntypedActorFactory) in Props has been deprecated
ActorRef master = system.actorOf(new Props(new UntypedActorFactory() {
^
akka-tutorial-first-java/src/main/java/akka/tutorial/first/java/Pi.java:168: error: method tell in class ActorRef cannot be applied to given types;
master.tell(new Calculate());
^
required: Object,ActorRef<br/>
found: Calculate<br/>
reason: actual and formal argument lists differ in length<br/>
7 errors<br/>
5 warnings
I've literally copied ans pasted their final Pi.java file and tried to compile and i'm completely at a loss as how to proceed? :-(
Any ideas would be great.

The best way to get started with Akka is by using Typesafe’s Activator: there are several tutorials in there which show you how to do different things, starting from “Hello Akka” to using advanced Cluster features, you can see the full list here.
That said, your problems come from trying to run a tutorial from the 2.0.2 docs on Akka 2.2.1, which will not work.

Related

Gauge Failed to start gauge API: Error occurred while waiting for runner process to finish

I'm quite new to gauge and have problems running a set of gauge tests. When I try to gauge run I get the following console output:
src\main\java\de\...\qa\Common.java:3: error: package com.github.....gauge.graphql does not exist
import com.github.....gauge.graphql.GraphqlSetup;
^
symbol: class VariableStorage
location: class Pricing
src\main\java\de\...\qa\testcraft\GaugeTestCraft.java:3: error: package com.github.....gauge.random.data does not exist
import com.github.....gauge.random.data.VariableStorage;
^
src\main\java\de\...\qa\testcraft\TestCraftExecutor.java:4: error: package org.tinylog does not exist
import org.tinylog.Logger;
^
src\test\java\de\...\qa\PricingTest.java:8: error: package org.junit.jupiter.api does not exist
import org.junit.jupiter.api.Test;
^
src\test\java\de\...\qa\PricingTest.java:9: error: package org.yaml.snakeyaml does not exist
import org.yaml.snakeyaml.Yaml;
^
src\test\java\de\...\qa\TestVariableStorage.java:3: error: package com.github.....gauge.random.data does not exist
import com.github.....gauge.random.data.VariableStorage;
^
src\test\java\de\...\qa\TestVariableStorage.java:9: error: cannot find symbol
public class TestVariableStorage implements VariableStorage {
^
symbol: class VariableStorage
src\test\java\de\...\qa\PricingTest.java:26: error: cannot find symbol
#Test
^
symbol: class Test
location: class PricingTest
src\test\java\de\...\qa\PricingTest.java:33: error: cannot find symbol
#Test
^
symbol: variable Logger
location: class TestCraftExecutor
src\test\java\de\...\qa\TestVariableStorage.java:12: error: method does not override or implement a method from a supertype
#Override
^
src\test\java\de\...\qa\TestVariableStorage.java:17: error: method does not override or implement a method from a supertype
#Override
^
src\test\java\de\...\qa\TestVariableStorage.java:22: error: method does not override or implement a method from a supertype
#Override
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
55 errors
Error occurred while waiting for runner process to finish.
Error : exit status 1
Error ----------------------------------
[Gauge]
Failed to start gauge API: Error occurred while waiting for runner process to finish.
Error : exit status 1
Get Support ----------------------------
Docs: https://docs.gauge.org
Bugs: https://github.com/getgauge/gauge/issues
Chat: https://spectrum.chat/gauge
Your Environment Information -----------
windows, 1.1.1, 6e0d83f
html-report (4.0.12), java (0.7.9), python (0.3.11), screenshot (0.0.1), xml-report (0.2.3)
Does someone know how this happens and how to solve it? Here are some additional informations:
Java version:14.0.2
Gauge version: 1.1.1
Maven version: 3.6.3
I just resolve the problem.
You should check your project's gauge.log. The Traceback is in the file, that will help you.
Don`t see the output, it will not work.

openJdk8 build in Windows: Build jdk error

Am trying to build openJDK8 in windows 64-bit. Following https://stas-blogspot.blogspot.com/2012/09/building-openjdk-on-windows.html for building.
OS: Windows 7-64-bit
Installed Cygwin, Visual studio 2013, Microsoft SDK, Ant and set all the paths in environment variable.
Built make and freetype 64-bit. Using jdk7 from Oracle as boot-jdk. configure was success. Then when i given
make clean images
Getting build error in jdk:
d:\Preethi\openjdk8\jdk\src\share\classes\java\io\PrintStream.java:31: error: cannot access IllegalCharsetNameException
import java.nio.charset.IllegalCharsetNameException;
^
bad source file: d:\Preethi\openjdk8\build\windows-x86_64-normal-server-release\jdk\gensrc\java\nio\charset\IllegalCharsetNameException.java
file does not contain class java.nio.charset.IllegalCharsetNameException
Please remove or make sure it appears in the correct subdirectory of the sourcepath.
d:\Preethi\openjdk8\jdk\src\share\classes\java\io\ObjectOutputStream.java:37: error: cannot find symbol
import static java.io.ObjectStreamClass.processQueue;
^
symbol: static processQueue
location: class
d:\Preethi\openjdk8\jdk\src\share\classes\java\io\ObjectInputStream.java:44: error: cannot find symbol
import static java.io.ObjectStreamClass.processQueue;
^
symbol: static processQueue
location: class
d:\Preethi\openjdk8\jdk\src\share\classes\java\lang\annotation\Retention.java:44: error: cannot find symbol
#Retention(RetentionPolicy.RUNTIME)
^
symbol: method value()
location: #interface Retention
d:\Preethi\openjdk8\jdk\src\share\classes\java\lang\SuppressWarnings.java:52: error: cannot find symbol
#Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})
^
symbol: variable TYPE
d:\Preethi\openjdk8\jdk\src\share\classes\java\lang\SuppressWarnings.java:52: error: cannot find symbol
#Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})
^
symbol: variable FIELD
d:\Preethi\openjdk8\jdk\src\share\classes\java\lang\SuppressWarnings.java:52: error: cannot find symbol
#Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})
^
symbol: variable METHOD
d:\Preethi\openjdk8\jdk\src\share\classes\java\lang\SuppressWarnings.java:52: error: cannot find symbol
#Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})
^
symbol: variable PARAMETER
d:\Preethi\openjdk8\jdk\src\share\classes\java\lang\SuppressWarnings.java:52: error: cannot find symbol
#Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})
^
symbol: variable CONSTRUCTOR
d:\Preethi\openjdk8\jdk\src\share\classes\java\lang\SuppressWarnings.java:52: error: cannot find symbol
#Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})
^
symbol: variable LOCAL_VARIABLE
java.lang.AssertionError: annotationType(): unrecognized Attribute kind <error> (class com.sun.tools.javac.code.Attribute$Error)
at com.sun.tools.javac.util.Assert.error(Assert.java:133)
at com.sun.tools.javac.code.TypeAnnotations.annotationType(TypeAnnotations.java:180)
at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.separateAnnotationsKinds(TypeAnnotations.java:294)
at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.visitMethodDef(TypeAnnotations.java:1066)
at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:778)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.scan(TypeAnnotations.java:275)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.visitClassDef(TypeAnnotations.java:1042)
at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:693)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.scan(TypeAnnotations.java:275)
at com.sun.tools.javac.code.TypeAnnotations$1.run(TypeAnnotations.java:127)
at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:152)
at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:129)
at com.sun.tools.javac.comp.Enter.complete(Enter.java:512)
at com.sun.tools.javac.comp.Enter.main(Enter.java:471)
at com.sun.tools.javadoc.JavadocEnter.main(JavadocEnter.java:78)
at com.sun.tools.javadoc.JavadocTool.getRootDocImpl(JavadocTool.java:186)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:346)
at com.sun.tools.javadoc.Start.begin(Start.java:219)
at com.sun.tools.javadoc.Start.begin(Start.java:205)
at com.sun.tools.javadoc.Main.execute(Main.java:64)
at com.sun.tools.javadoc.Main.main(Main.java:54)
javadoc: error - fatal error
makegensrc/GensrcSwing.gmk:77: recipe for target `/cygdrive/d/Preethi/openjdk8/build/windows-x86_64-normal-server-release/jdk/gensrc_no_srczip/_the.generated_be
aninfo' failed[2]: *** [/cygdrive/d/Preethi/openjdk8/build/windows-x86_64-normal-server-release/jdk/gensrc_no_srczip/_the.generated_beaninfo] Error 1
make[2]: *** Waiting for unfinished jobs....
BuildJdk.gmk:55: recipe for target `gensrc-only' failedmake[1]: *** [gensrc-only] Error 2
/cygdrive/d/Preethi/openjdk8//make/Main.gmk:116: recipe for target `jdk-only' failed
make: *** [jdk-only] Error 2
can somebody point-out the issue?
boot-jdk : java version "1.7.0_80" downloaded from Oracle. That blog is meant for openjdk 7 only. But i tried the same steps for building openjdk8 2 years back and it got success.

JOGL errors on compilation

I am working with JOGL and it stopped working completely.
These are the errors i get:
Texture01.java:27: error: cannot access WriteCloneable
canvas = new GLCanvas(glcapabilities);
^
class file for com.jogamp.common.type.WriteCloneable not found
.\Texture01_GLEventListener.java:2: error: package com.jogamp.common.nio does not exist
import com.jogamp.common.nio.*;
^
.\Texture01_GLEventListener.java:136: error: cannot find symbol
FloatBuffer fb = Buffers.newDirectFloatBuffer(vertices);
^
symbol: variable Buffers
location: class Texture01_GLEventListener
.\Texture01_GLEventListener.java:163: error: cannot find symbol
IntBuffer ib = Buffers.newDirectIntBuffer(indices);
^
symbol: variable Buffers
location: class Texture01_GLEventListener
4 errors
The Path and Classpath variables are correct, I reinstalled JDK and JOGL2 but still get an error with WriteClonable and com.jogamp.common.nio.*
Any help is appreciated!

cannot find the symbol #Before in play2.2.1 java [duplicate]

This question already has an answer here:
Play 2.2.1 Java: Whats the equivalent of #before filters from play 1.X?
(1 answer)
Closed 8 years ago.
I am trying to use #Before interceptor in my controller
#Before(only = {"save" })
static void parseParams() {
String[] jobcategories = params.getAll("jobcategories");
for (int i = 0; i < jobcategories.length; i++) {
params.put("jobcategories[" + i + "].id", jobcategories[i]);
}
System.out.print(jobcategories);
}
but it gives me compile time error
C:\myapp\app\controllers\JobAdController.java:57: error: cannot find symbol
#Before(only={"save"})
^
symbol: class Before
location: class JobAdController
C:\myapp\app\controllers\JobAdController.java:59: error: cannot find symbol
String[] jobcategories = params.getAll("jobcategories");
^
symbol: variable params
location: class JobAdController
C:\myapp\app\controllers\JobAdController.java:61: error: cannot find symbol
params.put("jobcategories["+i+"].id",jobcategories[i]);
^
symbol: variable params
location: class JobAdController
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors
(compile:compile) javac returned nonzero exit code
Total time: 30 s, completed Nov 20, 2014 1:05:18 PM
What am I missing?
You CAN'T find it as it's from Play 1.x API #Before and other interceptors are NOT available in Play 2.x - they are replaced by Action Composition
#See similar topic
Note: Do not use documentation of Play 1.x for Play 2.x at all. In most areas they are totally different.

"error: package org.apache.commons.math3.random does not exist"?

I'm trying to compile a java code as in the following line :
javac -classpath /Users/tim/kws/code/library:/Users/moab/kws/code/commons-cli-1.2/commons-cli-1.2.jar:/Users/tim/kws/code/commons-math-2.2/commons-math-2.2.jar:/Users/tim/kws/code/common-math3-3.1.1/commons-math3-3.1.1.jar RATSWriteLandmarksFromPfile.java
/Users/tim/kws/code/library/ppm/types/LabelPfile.java:17: error: package org.apache.commons.math3.random does not exist
import org.apache.commons.math3.random.RandomDataImpl;
^
/Users/tim/kws/code/library/ppm/types/LabelPfile.java:50: error: cannot find symbol
private RandomDataImpl randomData_;
^
symbol: class RandomDataImpl
location: class LabelPfile
/Users/tim/kws/code/library/ppm/types/LabelPfile.java:321: error: cannot find symbol
randomData_ = new RandomDataImpl();
^
symbol: class RandomDataImpl
location: class LabelPfile
3 errors
does anybody know why am I getting these errors ?
Seems like you are missing the commons-math3 library.

Categories

Resources