Why is appium complaining about namespaces not being declared? - java

The below code is annoying me. Ive had this work before without hassle in a different IDE
((AndroidDriver)appDriver).startActivity(new Activity("packageName", "packageActivity.itt.gui.ZoneWelcomeActivity"))
Full error org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: io.appium.uiautomator2.common.exceptions.UiAutomator2Exception: java.lang.IllegalArgumentException: Namespace with prefix 'packageName' has not been declared.
I need to switch between 2 apps on the device and from what i know this is the only way to do it?

Related

Reason and fix for "Error: Could not find or load main class Anne" on Scala Getting started tutorial

I'm just starting out with Scala and have been following its Getting Started instructions. The second part of the instruction involves pulling the hello-world template by running the sbt new scala/hello-world.g8 command.
My problem is that it keeps on giving me this error:
Error: Could not find or load main class Anne
Caused by: java.lang.ClassNotFoundException: Anne
I'd like to know the reason for this, as well as any possible fix I might use.
The following is my insight and attempts on fixing this problem.
Insight:
1. I might have a problem with java installation/scala/sbt installation that needs this class Anne since even with other sbt commands like sbt sbtVersion I get the same error
Attempts:
1. Change command to retrieve from full url:
sbt new https://github.com/scala/hello-world.g8
2.(Edit): Previously I thought the repository scala/hello-world.g8 did not exist and tried getting from other repositories with no luck and with the same error as above. However it was pointed out below that the repository actually exists in this url https://github.com/scala/hello-world.g8, thanks Dmytro Mitin.
I was looking into the incorrect account (sbt) instead of (scala)
(Edit): Day 2
3. Uninstall/Reinstall sbt -- still getting the error
4. Checked if java running properly by compiling sample code and running ( successful )
I was actually running the command in Visual Studio Code's bash terminal. I tried running it with cmd and everything's now working fine.

Bundle exception

I am doing some maintenance to a JAVA backend written using bundles. When running the code after doing some software upgrade, I get that error at first:
! java.lang.NoSuchMethodError: org.osgi.framework.BundleContext.registerService (Ljava/lang/Class;Lorg/osgi/framework/ServiceFactory;Ljava/util/Dictionary;) Lorg/osgi/framework/ServiceRegistration;
When running it a second time, it gives me the following error:
! java.lang.NoClassDefFoundError: Could not initialize class com.sap.hilo.orchestration.workspace.HiloWorkspaceFactory
Then, it keeps showing the second error for any extra code runs. Any clues how resolve this issue?
Regarding:
java.lang.NoSuchMethodError: org.osgi.framework.BundleContext.registerService
I found an answer to a similar question here: OSGi: servicereference.getBundle().getVersion() - No such method error
In the Import-Package section of the pom.xml file you'll need to change the org.osgi.framework version to at least 1.6 or give it a range [1.6,2.0)

Java webapp produces StackOverflow exception on Linux

I have a Java-web application running on Tomcat 9. It works fine on a Windowns machine. But after deploying this app on a Debian Linux server I've encountered java.lang.StackOverflow exceptions on some particular pages. Here is the beginning of the stacktrace log:
27-Dec-2017 08:54:43.746 SEVERE [https-jsse-nio-9443-exec-3]
org.apache.catalina.core.ApplicationDispatcher.invoke Servlet.service() for
servlet [jsp] threw exception
java.lang.StackOverflowError
at java.io.UnixFileSystem.canonicalize0(Native Method)
at java.io.UnixFileSystem.canonicalize(UnixFileSystem.java:172)
at java.io.File.getCanonicalPath(File.java:618)
at org.apache.catalina.webresources.AbstractFileResourceSet.file(AbstractFileResourceSet.java:90)
Please, see full stacktrace here:
https://pastebin.com/0AmFDY8F
As far as I understand, the exception occurs while compiling the JSP page source by Jasper and it's somehow related to the resolving of Linux paths / directories. Could anybody please help me to figure out what the exact problem is? I didn't create any symbolic links, if the problem can be related to this.
According to your stack trace, the problem is caused by not being able to find a specific path as resolved by your Spring framework:
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
...
Caused by: java.io.IOException: JSPException including path '/struct/context/tutorials.jsp'.
The Spring framework is likely using the canonical paths to resolve the file, and it fails perhaps because there is some quirk in the framework related to the type of Unix system you are deploying to.
Please reference this in the Spring documentation:
https://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html#deployment-install-supported-operating-systems
The default script supports most Linux distributions and is tested on CentOS and Ubuntu. Other platforms, such as OS X and FreeBSD, will require the use of a custom embeddedLaunchScript.
Notice that Debian was not listed. Hopefully this puts you on the right path.
If I'm chasing a red herring here, I'm sorry - but you haven't given us much to go on.
Finally I've found what caused the StackOverflow exception. I have a recursive JSP tag call to render nested options for a <select> tag. After removing the recursion, the exception disappeared. Sure, it's just a workaround, so I'm still wondering why it works fine on Windows and doesn't on Linux.

java.lang.IllegalStateException: Scanner engine is not started. Unable to execute task

i tried an update of the sonarqube Server.
Now i get an error when i'm trying to scan my project with the ant task.
The error is "java.lang.IllegalStateException: Scanner engine is not started. Unable to execute task."
The Ant Task was succesful on my old Server (6.1), on the new one (6.5) it failed. So i tried to downgrade to 6.4, but the error still remains.
So i downgraded to 6.3 and the error disappears.
My question is, does anyone know about this error? And how can i solve it?
This is a misleading error message. I faced this error when I added Authentication to my server i.e. force authentication for every user.
If you have added authentication recently too, then you need to make sure that you are passing the sonar.login property through your scanner.
You may create a "build" user, generate its token and pass it to the sonar job.
This is how a token can be generated.

Strange Shader Loading Error LWJGL 3

I have recently made a project using LWJGL 3 but have run into a wall. I have looked all over but cannot seem to figure out why calling GL20.glShaderSource(shaderId, shaderCode) and then subsiquently GL20.glCompileShader(shaderId) returns an error. The error that I receive makes it appear as though lwjgl cannot discern the path to the shader files:
LWJGL Version 3.1.2 build 13
java.lang.Exception: ERROR COMPILING SHADER CODE: VERTEX SHADER FAILED TO
COMPILE WITH THE FOLLOWING ERRORS:
ERROR: 0:1: ERROR(#132) SYNTAX ERROR: "/" PARSE ERROR
ERROR: ERROR(#273) 1 COMPILATION ERRORS. NO CODE GENERATED
at com.wilby.model.ShaderProgram.createShader(ShaderProgram.java:47)
at com.wilby.model.ShaderProgram.createVertexShader(ShaderProgram.java:24)
at com.wilby.Renderer.initialise(Renderer.java:62)
at com.wilby.Game.initialise(Game.java:46)
at com.wilby.Game.loop(Game.java:23)
at com.wilby.Main.run(Main.java:27)
at com.wilby.Main.main(Main.java:16)
However it still makes this error even when the files do not need any prefix to reach it. Like I say, I am completely stumped.
The link to my project is here.
I found the solution. You have to read the file and use that as the string in the shader source method. Facepalm.

Categories