Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
I know topic sounds duplicate but the problem that I am facing is different than other forums.
I am integrating my ember app with spring web app. I copied the index.html from the dist folder of ember to the src/main/webapp folder of spring app.
I am getting following error:
app.js:1 Uncaught ReferenceError: define is not defined(…)(anonymous function) # app.js:1
I followed some instructions I found to integrate the ember app:
You would have already noticed that ember.js runs on its on server and uses a different port to your spring boot application. The good thing is that, you don’t have to start ember server for using ember.js in your application. There is workaround. The below steps would explain how.
Copy your index.html from “src/main/webapp/dist” folder to “src/main/webapp” folder.
Open index.html in your editor and update path all css and js files from “assets/xxx.xx” to “dist/assets/xxx.xx”. This is because all your framework related files are bundled in this folders and these are the only files you need.
Now run you Spring Boot application and access localhost:8080 and you would see your ember home page!
Note: When I run the ember app separately using ember server, the site is loading properly.
Finally, I have created an ember app without running ember server with the spring server running only.
Resources:
http://ygrails.com/spring-boot/spring-boot-emberjs/#comment-102
How to configure emberjs routes in SpringMVC?
My Git repo(It's a hello world app with ember app in spring server):
https://github.com/apurvagupta/spring_app
Hope this will help some people.
Related
This question already has answers here:
'Hot code replace' not working -- Eclipse doesn't change any code on JBoss
(5 answers)
Closed 5 years ago.
This question relates to a question I asked earlier and in order not to include the same code snippets, I would be glad if you would view it here.
I deploy the application on Tomcat 8.5. and now I see the return value of getMessage() from the HelloWorld managed bean displayed in the browser.
Now when I edit the value in the getMessage() function for instance instead of "Hello World!" I use "Hello World!................" and save and redeploy, the old value keeps displaying in the browser. Even if I restart Tomcat, it is the same old value. I just don't understand why.
I don't know if the problem is a cache problem or what. What I don't understand it is even after shutting down the server and restart it, I get the same old value.
I can think of few thing;
clear tomcat cache
(Tomcat - want to clear cache of app being undeployed)
You may be compiling or deploying wrong archive (Verify the .class
file generated is latest one, you can even use a de-compiler to
verify this)
I agree with Asela Senanayake steps but sometimes for me even after the Cleaning up the Tomcat Directory the code was not deployed properly. What you can do is manually delete your project from the tomcat working directory and do the build and publish again for your project. You can find the project deployment location for tomcat below:
your_project_workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
want to download the file using java code from the server which is not SFTP server,how can i do this?
i dont have an SFPT server , i use an apache tomcat server ,and copy files to that server. my another application working on different server want to access the file from the first server. how can i do this using java
(S)FTP downloads are only possible from (S)FTP servers. You cannot perfom a FTP download from a server that does not provide that protocol.
But you can use http(s) to download files from your tomcat.
Here is a good explanation: https://stackoverflow.com/a/7632191/4296831
Usually, if it is Linux/unix server then you will have scp demon up and running. May be you can then try downloading file using scp instead of SFTP. Also, there is very good support from JSch library for doing this. Here is an example:
http://www.jcraft.com/jsch/examples/ScpFrom.java.html
You can't. Either install an SFTP server (easy to set up, free software) or use a different protocol. You can't request data that isn't being served up, unless you're asking how to hack in which this isn't really the place for.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I am a new to Java so this question might seem basic, please bear with me - I have been going through this Oracle tutorial on Java callbacks
It states that you need to write server code called: Server.java then you need to write the MessageServerImpl.java , then you need to also write the client code, called Client.java.
My question is how is all this implemented ? Do we create 3 seperate Java programs in Eclipse and place the server exe on the server, and place the client exe on the workstation pc, and expect them to just talk to each other ? Or do we just cut and paste the Server.java file on the server... then that will talk to Client.java file on the workstation ?
It is two separate programs. The first, the server, comprises 3 classes:
Server
MessageServerImpl
ReadThread
These would live in one project.
The second program is the client and it comprises 2 classes:
Client
ListenerImpl
These would live in a different project.
First you would build and run the server project. Then in the Client class replace the string <MyHost> with the host name of the computer running the server. Then build and run the client project.
The way they communicate is that MessageServerImpl extends a class called MessageServerPOA which the Server class uses to listen for connections.Client has the host name of the server, so it knows where to contact the server. The client contacts the server and registers a listener with it. The server then uses that listener reference to contact the client.
You could have both programs running on the same pc. However, this question (and the tutorial you are following) is much more related with Corba, than with Java and Android. May be you are reading the wrong tutorial?
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have a web application with Tomcat 7.0.42. I have recently found on my server files I havent uploaded. these hacker files allow anybody to create files on my server.
I'd really like to figure out how they have got access to my server. In my web application I have a form to interact with users, but all fields are restricted with regular expression and I use prepared statements to deal with the database.
Moreover I uploaded a version of my web application which ONLY displayed information, I removed all forms and I didnt let any type of interaction with users. I also changed passwords. But files still appearing
I would like to discuss possibles vulnerabilities and solutions to them:
Remove write permissions on tomcat webapps folder once I have uploaded my war?
May my code be corrupted?
Any help would be so much appreciated, thanks in advance!
As Mark pointed out, the easiest way to get into a Tomcat server it's by accessing the Tomcat Manager with a week or default password.
Make sure it's not publicly available, you have a strong password and check your JSP code for web vulnerabilities.
Once you have been hacked, you could already be backdoored, either at code level or by some rootkit in your server. Check your web logs, what commands had been executed recently, and IMHO a "rm -rf /" to make sure everything is wiped out.
Ignacio.
Try reading the Tomcat security docs http://tomcat.apache.org/tomcat-7.0-doc/security-howto.html
First check to see if the Manager application is present and if you have configured a user with a weak password for that app.
Looking at the access log is usually my next port of call.
As #Grimby rightly pointed out, Tomcat might not be the way they are getting in.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I want to add server to Eclipse which is Apache Tomcat 7.0 for running my web application but every time it is giving Error 404. I have tried all the solutions given on stack overflows other posts I will tell you what procedure I have followed:
I have downloaded windows installer for Apache tomcat and installed it.
I Placed a JAVA_HOME environment variable whose path is to the installed JDK.
Then in Eclipse: Window -> Preferences -> Server -> Add, I have added that server by giving the path up-to Apache bin folder.
Then I checked the build path of my project.
Firstly, it's giving the error that port no. is already in use, so I changed the port no. Secondly, it is giving Apache tomcat is already started. So I stopped it manually and started from Eclipse.
The URL is proper, I have checked it. And I have also given the URL manually. I have also created index.jsp
Now when I am running that project it is giving Error 404 . Requested file not found.
Have you look at your "web.xml" file? Look if the page you use as a welcome file exists, is there a index.jsp or index.html in your WebContent folder? ensure all the resources you´re pointing to, exist. As well, I strongly recommend you to use tomcat as a jar and not install it as a service on Windows, it is better. Also check the console of tomcat, there should be some red lines pointing to the issue that could be happening this behavior. Best regards.
error 404 implies that the tomcat server is up and running. your problem is with whatever you are trying to 'serve'
Ensure that your app is deployed properly.
Check if there is any error in any of logs.
Check if you typed in the right URL
Page not found or error 404 tells that there's no page at address url you trying to enter the browser. You need to check that server has configured properly to serve your application.
just double click on -- 1>Tomcat v7.0 Server at localhost.server .....
..
then at --------------- 2> Server Location ......
..
select second option -- 3> Use Tomcat Installation ....
..
and start the server again ... :)