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.
Related
`
C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\wallpaper_manager-1.0.10\android\src\main\java\com\mulgundkar\wallpaper_manager\WallpaperManagerPlugin.java:129: error: cannot find symbol
String assetLookupKey = FlutterLoader.getInstance().getLookupKeyForAsset(assetPath);
^
symbol: method getInstance()
location: class FlutterLoader
C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\wallpaper_manager-1.0.10\android\src\main\java\com\mulgundkar\wallpaper_manager\WallpaperManagerPlugin.java:152: error: cannot find symbol
String assetLookupKey = FlutterLoader.getInstance().getLookupKeyForAsset(assetPath);
^
symbol: method getInstance()
location: class FlutterLoader
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':wallpaper_manager:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
`
wallpaper_manager: any
When I add the package, the project gives an error.
There was no problem in the old versions of flutter, but the application does not work anymore, how should I proceed?
If you look at the current javadocs for FlutterLoader, it doesn't declare a getInstance() method anymore. The method was deprecated and then removed.
According to https://stackoverflow.com/a/64456438/139985, since Flutter 1.22 you need to get hold of a FlutterLoader instance using FlutterInjector:
import io.flutter.FlutterInjector;
...
FlutterLoader loader = FlutterInjector.instance().flutterLoader();
See also: What does a "Cannot find symbol" or "Cannot resolve symbol" error mean?
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.
I'm trying to build a ROM for Android and everything is going smooth, but then i added Proximity Wake feature from CM and got this error:
packages/apps/Settings/src/com/android/settings/DisplaySettings.java:148: cannot find symbol symbol :
variable advancedPrefs location: class com.android.settings.DisplaySettings
advancedPrefs.removePreference(findPreference(KEY_PROXIMITY_WAKE)); ^
packages/apps/Settings/src/com/android/settings/DisplaySettings.java:149: cannot find symbol symbol :
variable PROXIMITY_ON_WAKE location: class android.provider.Settings.System
Settings.System.putInt(getContentResolver(), Settings.System.PROXIMITY_ON_WAKE, 1);
^ Note: Some input files use or override a deprecated API. Note: Recompile
with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 2 errors
when i open up the file i find this lines:
advancedPrefs.removePreference(findPreference(KEY_PROXIMITY_WAKE));
Settings.System.putInt(getContentResolver(), Settings.System.PROXIMITY_ON_WAKE, 1);
The error states that it cannot find a symbol, what is wrong?
I am trying to make Sublime work with Java. I know there is a lot of tutorials but all of them for Windows. I was going through this one but it is for processing and it doesn't work wit imports. http://blog.boreal-kiss.net/2012/10/27/processing-with-sublime-text-2/
I am just starting with Java and using ACMStarterProject with acm.jar.
http://www.stanford.edu/class/archive/cs/cs106a/cs106a.1124/assignments.html
What I want:
use sublime to build and run
use imports and package libraries
use java 7
I think I need to write a skript and make some changes to JavaC.sublime-build?
Thanks
Here is what I get in console:
Users/romangorshkov/Documents/Eclipse/workspace/ACMStarterProject/CircleArea.java:8: error: package acm.program does not exist
import acm.program.*;
^
/Users/romangorshkov/Documents/Eclipse/workspace/ACMStarterProject/CircleArea.java:11: error: cannot find symbol
public class CircleArea extends ConsoleProgram {
^
symbol: class ConsoleProgram
/Users/romangorshkov/Documents/Eclipse/workspace/ACMStarterProject/CircleArea.java:16: error: cannot find symbol
println("This program calculates a circle area.");
^
symbol: method println(String)
location: class CircleArea
/Users/romangorshkov/Documents/Eclipse/workspace/ACMStarterProject/CircleArea.java:17: error: cannot find symbol
int r = readInt("Enter circle radius: ");
^
symbol: method readInt(String)
location: class CircleArea
/Users/romangorshkov/Documents/Eclipse/workspace/ACMStarterProject/CircleArea.java:20: error: cannot find symbol
println("Circle area is: " +area);
^
symbol: method println(String)
location: class CircleArea
5 errors
[Finished in 2.2s with exit code 1]
[shell_cmd: javac "/Users/romangorshkov/Documents/Eclipse/workspace/ACMStarterProject/CircleArea.java"]
[dir: /Users/romangorshkov/Documents/Eclipse/workspace/ACMStarterProject]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
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.