Comments (4)
There is a sample application showing war packaging [1]. The intention is that you should be able to change the package type and everything just works.
Are you able to put together a small sample showing the problem?
from spring-boot.
Hi Phil,
Here is a project that does not work cleanly for me - https://github.com/bijukunjummen/spring-boot-mvc-test.git
It starts up cleanly with "mvn spring-boot:run" and there is a endpoint available at http://localhost:8080/hotels/list
However if you start this up with "mvn jetty:run" using the jetty plugin, the endpoint fails with an exception that the autocreate of the tables failed -
Caused by: org.hsqldb.HsqlException: user lacks privilege or object not found: HOTEL
at org.hsqldb.error.Error.error(Unknown Source)
at org.hsqldb.error.Error.error(Unknown Source)
at org.hsqldb.SchemaManager.getTable(Unknown Source)
at org.hsqldb.ParserDQL.readTableName(Unknown Source)
from spring-boot.
You aren't using SpringApplication
to load your context in the non-embedded case so you would have to add some initializers to match that behaviour. In particular you aren't loading and binding to the application.properties
, so it isn't setting the ddl-auto
property, and the SQL script is not being executed as a result. You could fix this in your web.xml
(in the servlet declaration)
<init-param>
<param-name>contextInitializerClasses</param-name>
<param-value>org.springframework.boot.context.initializer.ConfigFileApplicationContextInitializer</param-value>
</init-param>
It's probably better though to add a SpringBootServletInitializer
, since that way you are always going to get all the features of SpringApplication
in your web context (then you would use a Servlet 3.0 container - so no need for web.xml). Your SampleWebApplication
could extend SpringBootServletInitializer
and just return an array containing its own class (that's a pretty common pattern for these "hybrid" builds").
from spring-boot.
Perfect, specifying the ApplicationContextInitializer
works cleanly.
from spring-boot.
Related Issues (20)
- Upgrade to Spring GraphQL 1.3.2
- Upgrade to Commons Codec 1.17.1
- Upgrade to Spring GraphQL 1.3.2
- Feature request: AutoConfiguration-Factories HOT 1
- Upgrade to Spring Pulsar 1.0.8
- Prohibit upgrades to Undertow 2.3.15
- Prohibit upgrades to Undertow 2.3.15
- Prohibit upgrades to Undertow 2.3.15
- Upgrade to Spring Pulsar 1.1.2
- Upgrade to Spring Pulsar 1.1.2
- Upgrade to H2 2.3.230
- little suggestion about ssl util PemContent
- Proposal for Content Revision on Wiki - "Spring Boot 3.0 Migration Guide" HOT 1
- Some @ControllerEndpoint and @RestControllerEndpoint infrastructure remains undeprecated
- Allow ContainerConnectionDetailsFactory to match on one of multiple different connection names
- Spring Authorization Server now defaults multipleIssuersAllowed to false and it cannot be easily re-enabled
- Exceeding 32 @SpringBootTest Configurations Causes Netty RejectedExecutionException with WebFlux HOT 3
- Fix documentation links in the README
- Fix documentation links in the README
- Add support for CNB platform API version 0.14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-boot.