Heyy Can Anyone Help I am Not Getting the run on server option in Spring Tool Suite .. and My Server

No description
180 Replies
JavaBot
JavaBot8mo ago
This post has been reserved for your question.
Hey @Danix! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st8mo ago
What server are you using? Also I think Spring Tools doesn't have a run on server option you need to install that first I think you'd need Eclipse Java EE Developer Tools for that you should be able to find that in the Eclipse Marketplace
Danix
DanixOP8mo ago
i am using Tomcat Server @dan1st | Daniel i used the ecplise as well but whenever i put on my command in web i got 404 error
Danix
DanixOP8mo ago
This is My Web.xml in ecplise
No description
Danix
DanixOP8mo ago
This is Dispatcher servlet on ecplise
No description
Danix
DanixOP8mo ago
this is my fist controller in ecplise
No description
Danix
DanixOP8mo ago
this is hi.jsp in ecplise
No description
Danix
DanixOP8mo ago
the error when hit any command
No description
Danix
DanixOP8mo ago
@dan1st | Daniel Please help if u can
dan1st
dan1st8mo ago
?
Danix
DanixOP8mo ago
i mean i also used the ecplise ide for the same project but got error instead of result thats why shifted from ecplise to spring tool
dan1st
dan1st8mo ago
Can you show the deployment? I think you are using the wrong URL
Danix
DanixOP8mo ago
wdym
dan1st
dan1st8mo ago
.
Danix
DanixOP8mo ago
of what
dan1st
dan1st8mo ago
I think there's a Servers view Window > Show view > Servers
Danix
DanixOP8mo ago
No description
dan1st
dan1st8mo ago
Can you expand LoginPage there?
Danix
DanixOP8mo ago
No description
dan1st
dan1st8mo ago
Danix
DanixOP8mo ago
No description
Danix
DanixOP8mo ago
getting the same result
dan1st
dan1st8mo ago
ph wait you are using Spring 5 and Tomcat 9
dan1st
dan1st8mo ago
Stack Overflow
How to avoid compatibility issues between Java EE and Jakarta EE?
After Oracle donated Java EE to the Eclipse Foundation, it was renamed to Jakarta EE. With that, the javax namespace was changed to jakarta. What does one need to take care about in order to avoid
dan1st
dan1st8mo ago
Stack Overflow
Servlet returns "HTTP Status 404 The requested resource (/servlet) ...
I have an HTML form in a JSP file in my WebContent/jsps folder. I have a servlet class servlet.java in my default package in src folder. In my web.xml it is mapped as /servlet. I have tried several...
Danix
DanixOP8mo ago
<dependencies>
<!-- Spring MVC -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.3.18</version>
</dependency>

<!-- Spring Core -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.3.18</version>
</dependency>

<!-- Spring Context -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.3.18</version>
</dependency>

<!-- Spring ORM -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>5.3.18</version>
</dependency>

<!-- Spring JDBC -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>5.3.18</version>
</dependency>

<!-- Servlet API -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.0</version>
<scope>provided</scope>
</dependency>
<dependencies>
<!-- Spring MVC -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.3.18</version>
</dependency>

<!-- Spring Core -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.3.18</version>
</dependency>

<!-- Spring Context -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.3.18</version>
</dependency>

<!-- Spring ORM -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>5.3.18</version>
</dependency>

<!-- Spring JDBC -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>5.3.18</version>
</dependency>

<!-- Servlet API -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.0</version>
<scope>provided</scope>
</dependency>
yess @dan1st | Daniel
dan1st
dan1st8mo ago
actually Tomcat 9 is fine nvm
Danix
DanixOP8mo ago
wdym the server is not even going to the url bcz the print statement is not printing as well
dan1st
dan1st8mo ago
can you change the return "Hi"; to return "redirect:https://example.com"; for testing?
Danix
DanixOP8mo ago
yeh sure
dan1st
dan1st8mo ago
ah ik yeah that's what I wanted to know
Danix
DanixOP8mo ago
redirect:https://example.com
redirect:https://example.com
is thing right ?
dan1st
dan1st8mo ago
if a print is not printed, that isn't necessary
Danix
DanixOP8mo ago
still getting same
Danix
DanixOP8mo ago
No description
Danix
DanixOP8mo ago
No description
dan1st
dan1st8mo ago
copying src/main/webapp/WEB-INF to src/main/resources/WEB-INF doesn't help either, right?
Danix
DanixOP8mo ago
i didnot done it yet
dan1st
dan1st8mo ago
You could try http://localhost:8080/manager but that would probably ask for a password
Danix
DanixOP8mo ago
10 days before every things were working fine but when i created a new project it giving the error
dan1st
dan1st8mo ago
Can you show the pom.xml of the working project?
Danix
DanixOP8mo ago
Yehh sure
Danix
DanixOP8mo ago
Danix
DanixOP8mo ago
@dan1st | Daniel
dan1st
dan1st8mo ago
oh wait both projects are called LoginPage?
Danix
DanixOP8mo ago
nope i even closed the last projects to check that the error was coming from that or not
dan1st
dan1st8mo ago
but both have the same name?
Danix
DanixOP8mo ago
no
dan1st
dan1st8mo ago
but?
Danix
DanixOP8mo ago
what?
dan1st
dan1st8mo ago
So what's the name of the working project?
Danix
DanixOP8mo ago
LoginPage
dan1st
dan1st8mo ago
Since that pom sais LoginPage and the new project is also named LoginPage?
Danix
DanixOP8mo ago
this pom.xml is of LoginPage Project
dan1st
dan1st8mo ago
yeah but the project that doesn't work is also called LoginPage, right?
Danix
DanixOP8mo ago
yeh What are u actually asking ?
Danix
DanixOP8mo ago
Check my Project Explorer i have 1 project named LoginPage and I even deleted the last project
No description
dan1st
dan1st8mo ago
Can you try removing the deployment from the servers tab and add it again? preferably using the run on server thing
Danix
DanixOP8mo ago
U mean I have to remove the server then add it again to the project ?
JavaBot
JavaBot8mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Danix
DanixOP8mo ago
Bro u didn't answer my question I am still stuck on it please help if u can @dan1st | Daniel
dan1st
dan1st8mo ago
I meant the deployment, not the server but yeah doing that with the server probably also works
Danix
DanixOP8mo ago
No i did it with server many times but it didn't work Wdym by deployment I am not getting it
dan1st
dan1st8mo ago
essentially you can have multiple applications in a server an application "deployed" to a server is a "deployment"
Danix
DanixOP8mo ago
So how to remove the deployment?
dan1st
dan1st8mo ago
probably by right-clicking there
No description
Danix
DanixOP8mo ago
No bro I am still stuck at the sma problem @dan1st | Daniel 🥲 is there any another way to do it ?
Danix
DanixOP8mo ago
is this dueto my servlet xml name dispatcher-servlet.xml
No description
Danix
DanixOP8mo ago
@dan1st | Daniel
dan1st
dan1st8mo ago
Stack Overflow
Spring MVC - Getting 404 error and not able to configure Dispatcher...
I am new to Spring MVC and trying to create my first project in Spring MVC. Please help me to resolve the following error: - Getting following error in console: - Allocate exception for servlet [
dan1st
dan1st8mo ago
Maybe that? Did you do that?
Danix
DanixOP8mo ago
This is how it looks like now is that ok ?
No description
dan1st
dan1st8mo ago
Also please try pressing Alt+F5 in Eclipse then select your project and click ok After you did these things I just said, right click on the deployment in Eclipse (that thing) and show me which options there are Also do you have a web.xml somewhere? If yes, can you show it? And does your pom.xml contain anythign saying web xml?
Danix
DanixOP8mo ago
No description
dan1st
dan1st8mo ago
When you click add and remove, what's there?
Danix
DanixOP8mo ago
No description
dan1st
dan1st8mo ago
ah right, that was that thing
Danix
DanixOP8mo ago
No description
dan1st
dan1st8mo ago
Can you add the following to your controller, just for testing?
@ResponseEntity
@GetMapping
public String test(){
return "This is a test. If this appears in the browser, something works.";
}
@ResponseEntity
@GetMapping
public String test(){
return "This is a test. If this appears in the browser, something works.";
}
In that menu, add LoginPage and I guess SecondLoginPage is the old project?
Danix
DanixOP8mo ago
without any command @dan1st | Daniel yeh
dan1st
dan1st8mo ago
without any path Then yeah, just add the new one in the add and remove thing Can yoou show that dialog after adding that?
Danix
DanixOP8mo ago
Yehh I added the new one and removed all the old ones Which dialog ? The deployment one ? @dan1st | Daniel . @dan1st | Daniel are u there
dan1st
dan1st8mo ago
I was doing moderation stuff
Danix
DanixOP8mo ago
Ohh
Phloof_boll
Phloof_boll8mo ago
No description
dan1st
dan1st8mo ago
yep
Danix
DanixOP8mo ago
No description
Danix
DanixOP8mo ago
in the console i found this is that weird
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
dan1st
dan1st8mo ago
Can you show the whole thing?
Danix
DanixOP8mo ago
Danix
DanixOP8mo ago
here it is
dan1st
dan1st8mo ago
ok yeah ig it's ok
Danix
DanixOP8mo ago
oh now then bcz the problem is still there does that due to the IDE ?
dan1st
dan1st8mo ago
Did you do that?
Danix
DanixOP8mo ago
yehh like that right ?
Danix
DanixOP8mo ago
No description
dan1st
dan1st8mo ago
Which page are you accessing in the browser?
Danix
DanixOP8mo ago
/hi
/hi
i mean the Hi.jsp
dan1st
dan1st8mo ago
So localhost:8080/hi? Are there any other consoles?
Danix
DanixOP8mo ago
http://localhost:8080/LoginPage/hi
http://localhost:8080/LoginPage/hi
i after opening the web page i found
http://localhost:8080/LoginPage/
http://localhost:8080/LoginPage/
this
dan1st
dan1st8mo ago
Does that do anything?
Danix
DanixOP8mo ago
nope the 404 error
dan1st
dan1st8mo ago
Stack Overflow
Where is the deployment directory in Eclipse?
I'm developing a web app in Eclipse. where is the deployment directory tree situated? In the Apache directory structure or some sub-directory tree structure in my Java workspace tree? I ask because I
dan1st
dan1st8mo ago
essentially going to the Servers view and double-clicking on the deployment
Danix
DanixOP8mo ago
the structure is like that
No description
dan1st
dan1st8mo ago
ok that isn't what I expected to see What did you double-click on?
Danix
DanixOP8mo ago
No description
dan1st
dan1st8mo ago
yeah that's what I wanted to see Now in the servers tab, if you double-click the deployment instead of the server, are you getting something different?
Danix
DanixOP8mo ago
can u ellanborate ? like the server tab ?
dan1st
dan1st8mo ago
yes like you double-clicked the thing above the arrow, right?
Danix
DanixOP8mo ago
yehh
dan1st
dan1st8mo ago
What happens when double-clicking the thing where the arrow points to?
Danix
DanixOP8mo ago
To the General Overview of tomcat 9
dan1st
dan1st8mo ago
? Like double-clicking the LoginPage thing in the servers tab
Danix
DanixOP8mo ago
The Login Page is Not Directing to anywhere instead the Tomcat 9 Server localHost is Directing To the General Overvirew
dan1st
dan1st8mo ago
What happens when right-clicking the login page thing?
Danix
DanixOP8mo ago
No description
Danix
DanixOP8mo ago
@dan1st | Daniel
dan1st
dan1st8mo ago
ok that's kinda weird what if you right click on the spring thing there?
Danix
DanixOP8mo ago
No description
Danix
DanixOP8mo ago
@dan1st | Daniel Should I delete the IDE and then download
dan1st
dan1st8mo ago
wouldn't help I think I just installed Tomcat by myself Can you try localhost:8080/LoginPage-0.0.1-SNAPSHOT/ and localhost:8080/LoginPage-0.0.1-SNAPSHOT/hi oh I found what I wanted to see in that thing, select the modules thing
dan1st
dan1st8mo ago
No description
Danix
DanixOP8mo ago
Ok i did it @dan1st | Daniel
No description
dan1st
dan1st8mo ago
ok then it should be /LoginPage interesting Can you please share the code you have (especially XML files) with codeblocks? So I can try it on my computer
Danix
DanixOP8mo ago
yehh sure 1min https://sourceb.in/4zrPXzhn7h' here it is @dan1st | Daniel
dan1st
dan1st8mo ago
Wait in your pom.xml you have version 6.2.0.Final of Hibernate validator This should be 5.something I think 5.5.4.Final Also you might need jasper if you want to use JSP
Danix
DanixOP8mo ago
jasper
dan1st
dan1st8mo ago
well we'll see about that
Danix
DanixOP8mo ago
there is no dependency like this everything is more than 6.0.0 @dan1st | Daniel did u find any error
dan1st
dan1st8mo ago
I think so
dan1st
dan1st8mo ago
you have these files in the lib directory
No description
dan1st
dan1st8mo ago
can you try moving them directly into WEB-INF?
No description
dan1st
dan1st8mo ago
With that, I get this error in the console which means it loaded something
No description
Danix
DanixOP8mo ago
wait i will move them to the web-inf wait i got the same error when i moved them into the WEB-INF Folder Directly
dan1st
dan1st8mo ago
and then in the web.xml, I have to change <param-value>/WEB-INF/Login-servlet.xml</param-value> to <param-value>/WEB-INF/dispatcherservlet.xml</param-value>
Danix
DanixOP8mo ago
Still get the File not found Exception after doing
dan1st
dan1st8mo ago
Can you show it? because I got a different 404
Danix
DanixOP8mo ago
like the error?
dan1st
dan1st8mo ago
this is what I got - the description is different
No description
dan1st
dan1st8mo ago
whatever you got
dan1st
dan1st8mo ago
and I also got that
No description
dan1st
dan1st8mo ago
both are ones that should be fixable
Danix
DanixOP8mo ago
No description
No description
No description
dan1st
dan1st8mo ago
Can you show your dispatcherservlet.xml?
Danix
DanixOP8mo ago
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"><!-- bean definitions here -->


<context:component-scan base-package="com.controllers"></context:component-scan>

<bean id = "viewresolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">

<property name="prefix" value="/WEB-INF/view/"></property>
<property name="suffix" value=".jsp"></property>

</bean>
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"><!-- bean definitions here -->


<context:component-scan base-package="com.controllers"></context:component-scan>

<bean id = "viewresolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">

<property name="prefix" value="/WEB-INF/view/"></property>
<property name="suffix" value=".jsp"></property>

</bean>
</beans>
dan1st
dan1st8mo ago
I got it working on my computer I had to change <property name="prefix" value="/WEB-INF/view/"></property> to <property name="prefix" value="/WEB-INF/lib/view/"></property> but I did not get your exception So you will likely have to do that as well Can you copy the whole stack trace in a code block?
Danix
DanixOP8mo ago
https://sourceb.in/sHrPFGuXaB here it is @dan1st | Daniel
dan1st
dan1st8mo ago
it sais
FileNotFoundException: Could not open ServletContext resource [/WEB-INF/dispatcherservlet.xml]
Can you show what's in your webapp directory?
Danix
DanixOP8mo ago
No description
Danix
DanixOP8mo ago
Opened The Lib Folder
No description
dan1st
dan1st8mo ago
you didn't spell dispatcherservlet correctly in the file name and after fixing it, watch
Danix
DanixOP8mo ago
well thanks a lot broo i got it
JavaBot
JavaBot8mo ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
dan1st
dan1st8mo ago
Now there's still something left
Danix
DanixOP8mo ago
?
dan1st
dan1st8mo ago
so you don't run into a specifc issue in the future in the pom.xml You have hibernate-core and hibernate-validator, right?
Danix
DanixOP8mo ago
yeh
dan1st
dan1st8mo ago
What are the versions of these?
Danix
DanixOP8mo ago
Hibernate Validator : - 6.2.0.Final Hibernate Core : - 5.5.4.Final
dan1st
dan1st8mo ago
yeah Your project is not compatible with Hibernate 6 it should be Hibernate 5
Danix
DanixOP8mo ago
the validator ?
dan1st
dan1st8mo ago
change the version of Hibernate validator to 5.5.4.Final Does it still work?
Danix
DanixOP8mo ago
yehh
dan1st
dan1st8mo ago
ok
Danix
DanixOP8mo ago
but the 5.5.4 final is giving error
dan1st
dan1st8mo ago
oh? nvm forget the thing about Hibernate validator my fault
Danix
DanixOP8mo ago
Can u summarize me like what was the actual mistakes i have done bcz i have changed and done a alot of things so just tell me the actual mistakes i have done bcz it will defintely help me in future
dan1st
dan1st8mo ago
ok first of all, Jakarta EE expects the web.xml inside WEB-INF not WEB-INF/lib
Danix
DanixOP8mo ago
ok
dan1st
dan1st8mo ago
in the web.xml, there is a <param-value>. That should point to the dispatcher servlet XML, not something nonexisting
Danix
DanixOP8mo ago
ok
dan1st
dan1st8mo ago
Then the dispatcherservlet.xml had a typo
Danix
DanixOP8mo ago
hm ok
dan1st
dan1st8mo ago
and finally, the prefix <property> in the dispatcherservlet XML had the wrong value
Danix
DanixOP8mo ago
can u tell me how to add dependencies in maven so our program will not crack anyhow ? like how to confirm that this version is good for our project
dan1st
dan1st8mo ago
you add them to the pom.xml essentially if you want to add a dependency, you add another dependency section for that, you need to know the group id, artifact id and version
Danix
DanixOP8mo ago
oh well thanks alot again u helped me alot
JavaBot
JavaBot8mo ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts. 💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Want results from more Discord servers?
Add your server