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 Pulsar 1.2.0-M1
- Upgrade to Spring Session 3.4.0-M2
- I'm going back to bed now
- Feature request to support refreshAfterWrite caffeine cache natively HOT 1
- Getting Config Server 401 error during Spring 3.X update HOT 1
- Upgrade to ActiveMQ 5.18.5
- Upgrade to Hazelcast 5.3.8
- Upgrade to Hibernate 6.4.10.Final
- Upgrade to Infinispan 14.0.30.Final
- Upgrade to Jersey 3.1.8
- Upgrade to Jetty Reactive HTTPClient 4.0.6
- Upgrade to Jetty 12.0.12 HOT 2
- Upgrade to Kotlin 1.9.25
- Upgrade to MongoDB 4.11.3
- Upgrade to Netty 4.1.112.Final
- Upgrade to SLF4J 2.0.16
- Upgrade to Tomcat 10.1.28
- Upgrade to Yasson 3.0.4
- Support for --project-name Parameter in Spring Boot Docker Compose HOT 1
- Can some please help me in connecting with Redis Cloud? HOT 1
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.