I'm creating a Hello World application in STS 3.9 on Windows using the legacy Spring MVC Template. I've created an MVC project, start the server and everything is fine on my home computer. I see this logged from the console:
Aug 02, 2017 9:56:07 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2161 ms
INFO : org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization started
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Wed Aug 02 21:56:10 PDT 2017]; root of context hierarchy
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/root-context.xml]
...
And the home page for the app is there. The problem is on my work computer. I do the same setup, but the Pivotal server is not loading the web app. There is no error. But instead of the above console output I get:
Aug 07, 2017 8:36:11 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 662 ms
Aug 07, 2017 8:36:12 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 389 ms
That's it. No error, and no indication that the ContextLoader is doing anything. The server home page appears fine, but the application home is not there (I get a 404 error when visiting the page). There is nothing in the Error Log. I have done a clean on the server and redeployed this many times with multiple versions of STS. I compared the two environments and everything seems in place - the Hello World app is there under wtpwebapps. Looks like everything was deployed correctly with servlet-context and root-context files in place. But on startup the server is not recognizing that there is an app. I can't see what is different between the two environments. I have deleted and re-installed STS, created many different tc servers, etc.
What would be preventing the server from finding and loading this webapp?
thanks,
andrew
I still don't know why this was happening but I fixed it by deleting my Maven repository: C:\Users[username].m2, then going to to STS, right-clicking on my project and selecting Maven --> Update Project, and checking the "Force Update of Snapshots/Releases" box before clicking OK. Then the ContextLoader started working at server startup.
Related
I am upgrading our b2b website to 6.7 hybris version. We have copied the config and custom folders to new 6.7 setup. We have also copied the data and media. Updated the system.
After server startup the entire WCMS section is not rendering due to which the components on home page do not open. It gives me the below error on console
**WARN [hybrisHTTP37] [DefaultCMSComponentRendererRegistry] Error processing component tag. currentComponent [TKNavigationBarComponentModel (8796148630588#1)] exception: Missing extension info for given extension name
Dec 30, 2019 11:12:31 AM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet [DispatcherServlet] threw exception
java.lang.NullPointerException: Missing extension info for given extension name
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:805)
at com.thyssenkrupp.b2b.global.baseshop.storefront.filters.AcceleratorAddOnFilter$DefaultExtensionAccessor.getInfo(AcceleratorAddOnFilter.java:272)
at com.thyssenkrupp.b2b.global.baseshop.storefront.filters.AcceleratorAddOnFilter$DefaultExtensionAccessor.getExtensionDir(AcceleratorAddOnFilter.java:267)
at com.thyssenkrupp.b2b.global.baseshop.storefront.filters.AcceleratorAddOnFilter$ResourceAddOnResolver.getExtensionPath(AcceleratorAddOnFilter.java:113)
at com.thyssenkrupp.b2b.global.baseshop.storefront.filters.AcceleratorAddOnFilter$ExecutableResourceAddOnResolver.getAddOnFullPathName(AcceleratorAddOnFilter.java:160)
at com.thyssenkrupp.b2b.global.baseshop.storefront.filters.AcceleratorAddOnFilter.doFilter(AcceleratorAddOnFilter.java:61)**
The localextensions.xml is same as 6.4 version. We have also tried querying tables to check if CMSNavigationNodes are present in the DB . In backoffice to the WCMS node is missing.
Can you please suggest what could have gone wrong here ?
There are documentation for upgrading. You need a lot of work for every version. For example check 6.6 to 6.7 guide (This link private, you need account on SAP).
I was able to fix this using
https://answers.sap.com/questions/12766398/missing-extension-info-for-given-extension-name.html
I had to manually change the Resolver file in my custom storefront extension as it was a copy of 6.4 and had the bug mentioned in the above link.
I was developing a website using Java EE in Eclipse and testing it locally using Glassfish, but after updating to OS X 10.10.3, the server started to timeout during launch. When trying to launch from Terminal, Glassfish failed to start, but when used with sudo, it started successfully. After looking around the web for a bit, I found that with 10.10.3 Glassfish required root privileges to run. Is there a way that I can make Eclipse start the server with root privileges or bypass the problem some other way?
EDIT: This is the log after using Siddharth's first option (the second one did not make any difference when running from Eclipse):
2015-05-16T16:30:39.877+1000|Info: Running GlassFish Version: GlassFish Server Open Source Edition 4.1 (build 13)
2015-05-16T16:30:39.879+1000|Info: Server log file is using Formatter class: com.sun.enterprise.server.logging.ODLLogFormatter
2015-05-16T16:30:39.980+1000|Info: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
2015-05-16T16:30:39.981+1000|Info: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
2015-05-16T16:30:39.984+1000|Info: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.
2015-05-16T16:30:40.104+1000|Info: Authorization Service has successfully initialized.
2015-05-16T16:30:40.130+1000|Info: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry
2015-05-16T16:30:40.375+1000|Info: Grizzly Framework 2.3.15 started in: 25ms - bound to [/0.0.0.0:8080]
2015-05-16T16:30:40.391+1000|Info: Grizzly Framework 2.3.15 started in: 1ms - bound to [/0.0.0.0:8181]
2015-05-16T16:30:40.397+1000|Info: Grizzly Framework 2.3.15 started in: 1ms - bound to [/0.0.0.0:4848]
2015-05-16T16:30:40.427+1000|Info: Grizzly Framework 2.3.15 started in: 0ms - bound to [/0.0.0.0:3700]
2015-05-16T16:30:40.428+1000|Info: GlassFish Server Open Source Edition 4.1 (13) startup time : Felix (1,426ms), startup services(619ms), total(2,045ms)
2015-05-16T16:30:40.602+1000|Info: JMXStartupService has started JMXConnector on JMXService URL service:jmx:rmi://olivers-imac.gateway:8686/jndi/rmi://olivers-imac.gateway:8686/jmxrmi
Sometimes it only reaches here.
2015-05-16T16:30:40.602+1000|Info: Grizzly Framework 2.3.15 started in: 0ms - bound to [/0.0.0.0:7676]
2015-05-16T16:30:40.670+1000|Info: Registered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl#ae372b9 as OSGi service registration: org.apache.felix.framework.ServiceRegistrationImpl#67403656.
Sometimes it only reaches here.
2015-05-16T16:30:40.904+1000|Info: visiting unvisited references
2015-05-16T16:30:41.444+1000|Info: Created HTTP listener http-listener-1 on host/port 0.0.0.0:8080
2015-05-16T16:30:41.450+1000|Info: Created HTTP listener http-listener-2 on host/port 0.0.0.0:8181
2015-05-16T16:30:41.453+1000|Info: Created HTTP listener admin-listener on host/port 0.0.0.0:4848
2015-05-16T16:30:41.471+1000|Info: Created virtual server server
2015-05-16T16:30:41.473+1000|Info: Created virtual server __asadmin
2015-05-16T16:30:41.638+1000|Info: Setting JAAS app name glassfish-web
2015-05-16T16:30:41.639+1000|Info: Virtual server server loaded default web module
2015-05-16T16:30:41.927+1000|Info: Java security manager is disabled.
2015-05-16T16:30:41.928+1000|Info: Entering Security Startup Service.
2015-05-16T16:30:41.930+1000|Info: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
2015-05-16T16:30:41.969+1000|Info: Security Service(s) started successfully.
2015-05-16T16:30:42.155+1000|Info: visiting unvisited references
2015-05-16T16:30:42.170+1000|Info: visiting unvisited references
2015-05-16T16:30:42.172+1000|Info: visiting unvisited references
2015-05-16T16:30:43.060+1000|Info: Initializing Mojarra 2.2.7 ( 20140610-1547 https://svn.java.net/svn/mojarra~svn/tags/2.2.7#13362) for context ''
2015-05-16T16:30:43.655+1000|Info: HV000001: Hibernate Validator 5.0.0.Final
2015-05-16T16:30:43.965+1000|Info: Loading application [__admingui] at [/]
2015-05-16T16:30:43.966+1000|Info: Loading application __admingui done in 3,296 ms
EDIT: I have marked Siddharth's answer correct, as it helped me the most, however the problem solved itself completely only after updating to El Capitan.
It is a known issue and has now been fixed (see this). If you want to continue with the current version of Glassfish then may be you can consider a solution published here.
Quoting the same solution below :-
It turns out that the Glassfish team made an assumption that they
could use launchctl bsexec in their
nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncher.java
file.
This sub-command now requires root privileges.
Someone has submitted a patch to Glassfish trunk, but if you want to
continue using Glassfish immediately, you can create this script
somewhere e.g. ~/bin/launchctl.
#!/bin/bash
# A little hack to wrap launchctl in order to
# successfully start Glassfish on Yosemite 10.10.3+
if [[ ${1} == "bsexec" ]]; then
nohup ${#:3}
else
/bin/launchctl ${#}
fi
Remember to ‘chmod 755 ~/bin/launchctl’ so that it is executable.
Also remember that your ~/.profile or ~/.bash_profile must have
something like this:
export PATH="$HOME/bin:$PATH"
The idea here is that this script is a wrapper for launchctl. As a
user in Yosemite 10.10.3, you cannot run bsexec, but you may want to
use launchctl for other things.
I had the same problem with eclipse luna Glassfish tools that I had installed from Eclipse MarketPlace, under OSX 10.9.
I ran across the post below on stack overflow and I guess, after the issue of the root access being resolved in 10.10, I believe that the proposed solution there should work for your case too, as it did for me.
Don't forget to uninstall the Glassfish Tools that you installed previously from the Marketplace!
Installing Glassfish tools in eclipse luna
I am using Eclipse Indigo for developing my JSF 2.0 web application. I have created a dynamic web project with JSF 2.0 and JSTL 1.2 libraries. There are some Facelet files. The welcome file is login.xhtml.
After deploying the project, whenever I run login.xhtml in Tomcat 7.0.11, I get the following error in browser:
HTTP Status 404
type Status report
message
description The requested resource () is not available.
Apache Tomcat/7.0.11
In Eclipse's Tomcat console, I get the following error:
**Feb 14, 2012 1:08:59 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4693 ms
Feb 14, 2012 1:09:14 PM javax.faces.webapp.FacesServlet service
WARNING: Someone is trying to access a secure resource : /WEB-INF/login.xhtml
remote address is 0:0:0:0:0:0:0:1
remote host is 0:0:0:0:0:0:0:1
remote user is null
request URI is /Test/faces/WEB-INF/login.xhtml
web.xml is the default one generated by the Eclipse, however I have changed the welcome file name in that.
How is this error caused and how can I solve it?
Resources in /WEB-INF folder are not publicly accessible. That folder should be used exclusively for configuration files (like web.xml) and template/include files which you don't want the enduser to be able to download and view.
You need to move the login.xhtml file outside /WEB-INF folder and change the request URI to /Text/faces/login.xhtml.
I'm trying to start tomcat server 6.0.32 (NOT MY APP) from eclipse but it fails with error "Server Apache Tomcat v6.0.32 at localhost failed to start". But when I'm starting it with startup.bat it is ok. I checked all ports for tomcat - they are free. Here it is a console log
11.08.2011 15:15:46 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: <MY_PATH_VARIABLE>
11.08.2011 15:15:47 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
11.08.2011 15:15:47 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1068 ms
11.08.2011 15:15:47 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
11.08.2011 15:15:47 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.32
11.08.2011 15:15:47 org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor ProjectName.xml
Maybe someone know how to fix it?((((
I had the same problem i.e. no errors in any of the logs, and the server started fine when launched from the command line using run.sh. However as soon as I used Eclipse (without or without my app) Tomcat wouldn't start at all.
I solved this problem by performing the following steps:
In Eclipse, go to the 'Servers' tab.
Double click the server.
A configuration overview should be displayed in the main Eclipse panel.
Under the sub-section 'Server Locations', select the radio button 'Use Tomcat Installation' (for me this was the middle radio button).
Save the configuration (you should be prompted to do so anyway).
Restart your server, and you should find localhost:8080 works from within the Eclipse browser.
In Eclipse, go to:
Window -> Preferences -> Server -> Runtime Environments
And add Apache Tomcat.
Hope this helps.
The APR is the Apache Portable Runtime. This is a native (non-java) library that can improve the performance of Tomcat in certain situations.
Tomcat Native Library installation in Windows
In my case it was not starting and stucked at
INFO: Starting Servlet Engine: Apache Tomcat/8.5.32
Because the database connection configuration was wrong in context.xml, the
ip:port were wrong, I changed it to currently working port and republish tomcat and its started working
In my case, the problem came from an impossible loopback on localhost.
Tomcat effectively started (I could call "http://localhost:8080/myApp"), but Eclipse didn't get a response of that and it considered Tomcat keep on starting.
A software called ZScaler (set by admin to protect the enterprise) on Windows 10 put loopback restrictions.
Fortunately, an option existed to disable loopback restrictions on ZScaler.
A VPN may cause the same restrictions.
If you don't find which application cause th trouble, you can change "Host name" in Eclipse's Tomcat General Informations, from "localhost" to "yourIP" (ex : 179.25.14.178), BUT this trick won't allow DEBUG MODE.
I am developing a Google App Engine project in Java, using Google Cloud Tools in Eclipse. I added a Maven dependency to my project for using the App Engine Datastore. I run code that both writes to the datastore and reads back from it.
When I browse to the local admin console at localhost:8080/_ah/admin, there is no data to view. And from what I've read, there should be a local datastore file in my project's /WEB-INF/appengine-generated directory. But that directory never gets created, and obviously neither does the file.
Is there somewhere within my project's properties that define where that file is being created? And is there any reason the admin console is not seeing the data wrote to the datastore?
Cloud Tools for Eclipse supports running multiple Development App Servers, including having the same App Engine service running in each. So we can't use the source directory for deployment as the different instances will interfere.
Instead each instance of your service is copied into a deployment area found in <workspace>/.metadata/.plugins/org.eclipse.wst.server.core/tmp<X>/<service-name>. We should do better to expose that location.
When you first interact with the Def App Server's Datastore emulator, you should see some messages to the console identifying the location of the datastore files.
Nov 29, 2018 12:25:38 PM com.google.appengine.api.datastore.dev.LocalDatastoreService init
INFO: Local Datastore initialized:
Type: High Replication
Storage: /Users/bsd/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/test-imageservice-3079/WEB-INF/appengine-generated/local_db.bin
Nov 29, 2018 12:25:38 PM com.google.appengine.api.datastore.dev.LocalDatastoreService load
INFO: The backing store, /Users/bsd/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/test-imageservice-3079/WEB-INF/appengine-generated/local_db.bin, does not exist. It will be created.
Nov 29, 2018 12:26:08 PM com.google.appengine.api.datastore.dev.LocalDatastoreService$11 run
INFO: Time to persist datastore: 8 ms
You can also tell the Development App Server by editing the server launch configuration and adding --generated_dir command-line argument like the following: