I've created a Play! Framework 2.4 project using play-hibernate template through activator. When it finished building the project, I went to its root directory and ran the project. When I accessed it through the browser (localhost:9000), it returned an error:
package utils does not exist
In path/projectName/Global.java:3
1import play.Application;
2import play.GlobalSettings;
3import utils.PlayUtils;
That's odd, since there is a folder utils along with Global.java, with a Java class PlayUtils inside it. A bug, maybe?
Has anybody experienced anything like that?
Thank you very much for your time!
edit:
auL5agoi asked for the link to this template, and here it goes: https://github.com/ldaume/play-hibernate#master
Thank you for participating!
Related
I'm a n00b coder. I found an interesting library and trying to start toying with it. Which is not going great. This library is from 99' and uses JUnit (which I'm unfamiliar with) so there is a lot of confusing stuff. But it seems like the source of my failing even more elementary. Namely I have troubles importing packages.
This library has a test called StandardEvalTest.java. I moved to it to main Java directory and now I'm trying and failing to launch it using JUnit.
This package path org.pokersource.game.Deck goes directly from the directory where the test StandardEvalTest.java sits.
I also added the main java directory to the PATH environmental variable. Which as I assumed will allow import to locate the package.
None of those two things help. Also I was suspecting that maybe Deck.java and Deck.class are not enough and I have to do some work to create a package from it. But as far as I can say from Oracle doc the only thing needed is a package name in the header. Which seems to be present.
So I'm out of moves. Please help!
PS: Some additional info inspired by #Dhrubo 's answer:
The test I'm trying to run indeed sits in the main java folder of the library. (I moved it here hoping that when running from here it would be easier to find the package)
If I'm trying to compile the test instead of running it with JUnit he seem to fail to find JUnit classes and other JUnit related stuff.
[Oh OK I'm an idiot! Dont't mind me]
You should include the package while running StandardEvalTest.java as below
javac -cp [classpath] org.pokersource.game.StandardEvalTest.java
and run it from package root directory, I am assuming it is custom java file that you want to compile. You run directory should be parent of your package directory.
** I also see, you are trying to compile StandardEvalTest.java instead of Deck.java ... then check your StandardEvalTest.java file whether it exists in desired location.
Apologies if this is not allowed. I have been going through the mooc.fi learning java course and seem to be stuck on exercise 13.
The course gives you a pre-built package and asks you to do various tasks with the package.
After downloading the package and running in IntelliJ I am getting the error "java: Package nhlstats does not exist".
I have tried re-naming one "NHLTest" class to "nhlstats" however I still seem to be getting the error. Apologies if this seems a simple question but I can't seem to get my head around Java package structure.
https://imgur.com/qDfRVOj (Screenshot to IDE)
Java: Package nhlstats does not exist
Apologies, I had not set the libraries directory under "File | Project Structure | Libraries" in IntelliJ so I don't think it could find the class to import.
In my program, I am trying to import below classes but there comes a compile time error for this. Am I missing any jar there ? If yes, then which jar I am missing. Please help me.
"import net.java.util.TagValue;"
I am writing this in eclipse
A simple search on the net shows that net.java.util.TagValue class belongs to fixparser library. Make sure that this library is in your classpath when working on your project.
I'm trying to run some sample but I cannot find this class:
org.alfresco.web.scripts.*
Could you help me to find JARs for Java-backed web scripts? I downloaded the Alfresco SDK but I can't find it on alfresco-web-client-3.4.b.jar
It's really freaking me out! Thanks for your time!
Andrea
Hi I guess you need the new package since 3.3 : org.springframework.extensions.webscripts.*
Take a look at this Wiki and you will see that the package you're referring to is no longer being used.
The org.alfresco.repo.web.scripts package is in the Remote API jar, eg alfresco-remote-api-4.0.a.jar .
That's not the package you asked about (it's org.alfresco.repo.web.scripts rather than org.alfresco.web.scripts) but I think it's the one you want, as I can't spot the latter in the codebase from a quick check...
I have a class which extends OrmliteSqliteOpenHelper in order to provide a persistence module for an Android application. The problem is, whenever I access this class from the test project in Eclipse, it throws a NoClassDefFound Exception. The source code appears to be fine as the package is imported and Eclipse has no highlighting to indicate anything will go wrong, but it does.
Here's the kicker: not only does everything else in the project work fine when accessed from the test project, but when I move this file into the test project voila it works perfectly! The issue is that it needs to be in the actual project in order for other components to make calls to it. Has anyone ever encountered this error or have any idea where I might be going wrong?
The class path is set correctly as all the other classes work and the test project always has the main project added to its class path. I also tried moving the OrmliteSqliteOpenHelper object to an inner class: this allowed the outer class to be visible and touched but as soon as it tried to instantiate the inner class the same error occurs. Also, if I copy this file into both projects in the same package, an error occurs stating "class ref in pre-verified class resolved to unexpected implementation" whenever something in the main project tries to access this class. Clearly, there is some difference in the way the class is being compiled/handled between the two projects.
I'm quite stumped :/ Thanks a ton for any assistance!
Well friends, I seem to have hacked together a solution for this issue:
I linked the entire 'src' folder from the main project into the one for the test project. Now, when it goes searching for the particular package my file is located in, it finds the file in its own source tree first. Hooray!
Why does this work? I haven't a clue, perhaps someone could enlighten us to that fact.
Does it work? For now...
There is how I fix the problem:
Remove OrmLite from Build Path of the test project.
Export them from the main project.