I want to run a REST service besides Play from the same application.
So far I've configured Play to run within a basepath:
play.http.context="/play"
Can I disable routing outside of this path? Right now it's giving the error message "Handling not found", but I want to disable any handling including 404's.
Related
To give you some context, we have various microservices and a config server where we store store all the application.yml files.
The problem is when some issue happens, we have to temporarily enable logs for every application so that we can trace the activities done by the user. But this creates a hassle as we have to change the log configs.
So we want to enable logging for only certain users (say, when some issue happens and we want to debug) via changing the yml files so we don't have to touch the code or redeploy the application. Basically we are thinking of creating a application-logging.yml file for all the microservices and in this when we mention
logging:
users:
id: 123
level: warn
all the microservices will pick it up and start generating logs only for this user.
How can I implement this in Spring Boot, if its possible?
Put user ID into the thread context then use a MutableThreadContextMapFilter.
You can specify values via a JSON file, which log4j polls periodically to pick up changes.
I'm trying to debug a Spring Boot microservice using Intellij's remote debugging feature. I have followed the correct steps to connect to the Cloud Service (like enabling ssh) where the service is deployed, and have set up the correct Intellij configuration under "Remote JVM Debug".
The method I'm trying to debug is a Spring Boot RequestMapping (GET) controller method. I added in my breakpoints in this method, but as soon as I hit the debug button and visit the associated path (same as the RequestMapping's path value) in the UI in the browser, the breakpoints don't seem to work as the method execution never steps. Instead, the red breakpoint dots are somehow replaced with green checkmarks, like below -
What does this indicate? Any idea as to why the debugging doesn't work? Even print statements in the method aren't displayed in the console.
do not judge this question) I want to implement WEB installer for my Spring Boot application, and very interesting moment is that my application plays 2 role: Installer and Backend(Application). When i first run my app i need to tell Spring to not initialize particular beans(Hibernate(while startup application must not to be failed to start because database may not exist), ActiveMq and others beans that will be added in installation process) and show some html pages with installation guide. Also i need to prevent access to endpoints where some logic with database occurs. When installation finished i will create new application.properties or some other file with settings and i tell Spring to initialize all required beans with Hibernate, ActiveMQ and others. Maybe i will make restart of application and new behaviour that based on installation will occur. And in next starts my application will not show installation guide. To simplify the question: I need to change startup behaviour of Spring Boot Application. For fun i can give an example with human: I need to make human live with no organs, and this human will live very good, and if i want i can add organs to human and he will be live very well))
You can use #Profile annotation. Check this link: https://www.mkyong.com/spring/spring-profiles-example/
I have created an application using IBM worklight and i am using customAuthenticator for login process
I am getting following validation error while deploying application
Security test DummyAdapter-securityTest must include user and device
realms for AuthDemo:iphone:1.0:api. [project
module_23_1_CustomLoginModule]
You need to re-read the entire Getting Started section about Authentication and Security. There is more reading material here and here.
From the error I am thinking you have added a securityTest="DummyAdapter-securityTest" attribute to your iphone element in application-descriptor.xml.
As noted by the name of the securityTest, it is not meant for the application but for the adapter. This securityTest is already defined for the adapter procedure in the adapter XML file. Remove the securityTest you've added and it will work.
The sample you are trying to run (module_23_1_CustomLoginModule) is ready-made; no need for editing. You need only to build & deploy and run it.
What is the purpose of Web Service Deployment Descriptor (wsdd) configuration file.
If I didn't configure this file explicitly it doesn't create any issue in my application (as I am using a .jws file to do some web service related processes). But, for the first time the application runs, an error is logged in the error log file. The error is as follows:
"Unable to find config file. Creating new servlet engine config file: /WEB-INF/server-config.wsdd". And when the page refreshes or even the application is re-logged in (still the server is running), there won't be any such error log further times. When I use a sample wsdd file in my application, the error is not at all logged in the error log file. I want to know the purpose of this wsdd file and how to configure it based on our application.
Any suggestions would be appriciated.
Marshal.
Just do a google on "server-config.wsdd".
e.g. http://axis.apache.org/axis/java/integration-guide.html
It looks like your container or framework is generating a default file if you don't specify one, which is useful, but if you wish to add additional customisations such as handlers, security and logging (etc) then you can specify your own file.
It might be best to use a "bare minimum" file so you can customise it later.