Warum bekomme ich den Fehler "Unbekannte Option: -spring.profiles.active = Entwicklung", wenn ich versuche, die Websphere mit jvm.options Datei zu starten? Ich befolge die Schritte, die in http://www-01.ibm.com/support/docview.wss?uid=swg21596474 zur Verfügung gestellt werden.wie man spring.profiles.active in websphere liberty 8.5
In der Praxis möchte ich mit Websphere Liberty-Profil zu Eclipse-Server hinzugefügt Sehen Sie die gleiche, die ich mit Tomcat getan habe. In Tomcat 8 habe ich einfach "spring.profiles.active = development" in catalina.properties hinzugefügt und es hat den gleichen Effekt wie ich mit "mvn ... -Despring.profiles.active = development" starte.
Ich sehe meine Frage als Entwicklerthema, da ich wissen möchte, wie man das Websphere Liberty Profil unter Verwendung von @profile startet.
Bitte vergewissern Sie sich, dass ich Websphere Liberty verwende, was bedeutet, dass ich keine Websphere-Admin-Konsole habe. Wenn also jemand die Schritte in den Websphere Admin Console-Bildschirmen ausführt, ist das wertlos.
Ich habe ein Bild hinzugefügt, um zu zeigen, wie meine Eclipse Server-Ansicht ist und wo ich die Datei jvm.options hinzugefügt habe, die nur -spring.profiles.active = Entwicklung enthält.
Der Fehler tritt nur auf, wenn ich versuche, den Server mit solchen jvm.otions dort zu starten. Wenn ich die Datei herausgenommen habe, startet der Server aber offensichtlich, wenn ich meine Anwendung hinzufüge, wird @profile nicht berücksichtigt.
Entire Fehler:
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Unrecognized option: -spring.profiles.active=development
P. S. Ich glaube nicht, es auf meine Frage relevant ist, btw, kann die gesamte Anwendung in https://github.com/jhades/spring-mvc-angularjs-sample-app
*** Edited 1
finden Nachdem ich den Vorschlag gefolgt hinzufügen "D" Nach "-" konnte ich den Server starten (in Tomcat ist das anders, da man in Tomcat "D" vermeiden muss). Übrigens, ich sehe das @profile nicht, wenn ich die Anwendung in WAS Liberty implementiert habe. Ich habe unten die gesamten Websphere-Protokolle hinzugefügt und sehe nicht die gleichen langen Protokollbeschreibungen, die ich normalerweise in Tomcat sehe. Da ich mit einem zusätzlichen Fehler im Zusammenhang mit dem Kontextpfad konfrontiert bin (siehe das neue Bild im Anhang), konnte ich die Anwendung nicht über die Willkommensseite hinaus testen, aber ich bin mir fast sicher, dass @profile irgendwie ignoriert wurde, weil die Protokolle nicht so aussahen berücksichtigt.
********************************************************************************
product = WebSphere Application Server 8.5.5.9 (wlp-1.0.12.cl50920160227-1523)
wlp.install.dir = C:/Users/my_user/WasWebDownloadedFromEclipse/
java.home = C:\Program Files\Java\jdk1.8.0_65\jre
java.version = 1.8.0_65
java.runtime = Java(TM) SE Runtime Environment (1.8.0_65-b17)
os = Windows 7 (6.1; amd64) (en_US)
process = [email protected]
********************************************************************************
[7/7/16 16:13:04:151 CDT] 00000001 com.ibm.ws.kernel.launch.internal.FrameworkManager A CWWKE0001I: The server srvFromDefaultLink has been launched.
[7/7/16 16:13:04:175 CDT] 00000001 com.ibm.ws.kernel.launch.internal.FrameworkManager A CWWKE0100I: This product is licensed for development, and limited production use. The full license terms can be viewed here: https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/base_ilan/ilan/8.5.5.9/lafiles/en.html
[7/7/16 16:13:07:531 CDT] 00000001 com.ibm.ws.kernel.launch.internal.FrameworkManager I CWWKE0002I: The kernel started after 3.998 seconds
[7/7/16 16:13:07:727 CDT] 00000017 com.ibm.ws.kernel.feature.internal.FeatureManager I CWWKF0007I: Feature update started.
[7/7/16 16:13:09:941 CDT] 00000010 com.ibm.ws.security.ready.internal.SecurityReadyServiceImpl I CWWKS0007I: The security service is starting...
[7/7/16 16:13:11:591 CDT] 00000018 com.ibm.ws.security.token.ltpa.internal.LTPAKeyCreator I CWWKS4105I: LTPA configuration is ready after 0.406 seconds.
[7/7/16 16:13:12:599 CDT] 00000010 com.ibm.ws.app.manager.internal.monitor.DropinMonitor A CWWKZ0058I: Monitoring dropins for applications.
[7/7/16 16:13:13:904 CDT] 0000001d com.ibm.ws.tcpchannel.internal.TCPChannel I CWWKO0219I: TCP Channel defaultHttpEndpoint has been started and is now listening for requests on host 127.0.0.1 (IPv4: 127.0.0.1) port 8080.
[7/7/16 16:13:17:499 CDT] 00000010 com.ibm.ws.cache.ServerCache I DYNA1001I: WebSphere Dynamic Cache instance named baseCache initialized successfully.
[7/7/16 16:13:17:502 CDT] 00000010 com.ibm.ws.cache.ServerCache I DYNA1071I: The cache provider default is being used.
[7/7/16 16:13:17:503 CDT] 00000010 com.ibm.ws.cache.CacheServiceImpl I DYNA1056I: Dynamic Cache (object cache) initialized successfully.
[7/7/16 16:13:19:346 CDT] 00000017 com.ibm.ws.kernel.feature.internal.FeatureManager A CWWKF0012I: The server installed the following features: [jsp-2.3, ejbLite-3.2, managedBeans-1.0, jsf-2.2, beanValidation-1.1, servlet-3.1, ssl-1.0, jndi-1.0, localConnector-1.0, jsonp-1.0, appSecurity-2.0, jdbc-4.1, jaxrs-2.0, jaxrsClient-2.0, el-3.0, json-1.0, cdi-1.2, distributedMap-1.0, webProfile-7.0, websocket-1.1, jpa-2.1].
[7/7/16 16:13:19:347 CDT] 00000017 com.ibm.ws.kernel.feature.internal.FeatureManager I CWWKF0008I: Feature update completed in 11.807 seconds.
[7/7/16 16:13:19:348 CDT] 00000017 com.ibm.ws.kernel.feature.internal.FeatureManager A CWWKF0011I: The server srvFromDefaultLink is ready to run a smarter planet.
[7/7/16 16:13:44:452 CDT] 00000017 com.ibm.ws.config.xml.internal.ConfigRefresher A CWWKG0016I: Starting server configuration update.
[7/7/16 16:13:44:605 CDT] 00000018 com.ibm.ws.app.manager.AppMessageHelper W CWWKZ0014W: The application spring-mvc-angularjs-sample-app-master could not be started as it could not be found at location spring-mvc-angularjs-sample-app-master.war.
[7/7/16 16:13:44:606 CDT] 00000017 com.ibm.ws.config.xml.internal.ConfigRefresher A CWWKG0017I: The server configuration was successfully updated in 0.311 seconds.
[7/7/16 16:13:45:227 CDT] 00000017 com.ibm.ws.app.manager.AppMessageHelper I CWWKZ0018I: Starting application spring-mvc-angularjs-sample-app-master.
[7/7/16 16:13:53:746 CDT] 00000017 org.jboss.weld.Version I WELD-000900: SNAPSHOT
[7/7/16 16:14:15:269 CDT] 00000018 com.ibm.ws.app.manager.AppMessageHelper A CWWKZ0022W: Application spring-mvc-angularjs-sample-app-master has not started in 30.042 seconds.
[7/7/16 16:14:25:297 CDT] 00000017 com.ibm.ws.webcontainer.osgi.webapp.WebGroup I SRVE0169I: Loading Web Module: Archetype Created Web Application.
[7/7/16 16:14:25:302 CDT] 00000017 com.ibm.ws.webcontainer I SRVE0250I: Web Module Archetype Created Web Application has been bound to default_host.
[7/7/16 16:14:25:304 CDT] 00000017 com.ibm.ws.http.internal.VirtualHostImpl A CWWKT0016I: Web application available (default_host): http://localhost:8080/calories-tracker/
[7/7/16 16:14:25:309 CDT] 00000017 com.ibm.ws.app.manager.AppMessageHelper A CWWKZ0001I: Application spring-mvc-angularjs-sample-app-master started in 40.082 seconds.
[7/7/16 16:16:53:905 CDT] 0000002b com.ibm.ws.session.WASSessionCore I SESN8501I: The session manager did not find a persistent storage location; HttpSession objects will be stored in the local application server's memory.
[7/7/16 16:16:53:912 CDT] 0000002b com.ibm.ws.session.WASSessionCore I SESN0176I: A new session context will be created for application key default_host/calories-tracker
[7/7/16 16:16:54:017 CDT] 0000002b com.ibm.ws.util I SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.
[7/7/16 16:16:54:089 CDT] 0000002b com.ibm.ws.jsp I JSPG8502I: The value of the JSP attribute jdkSourceLevel is "15".
[7/7/16 16:16:54:483 CDT] 0000002b com.ibm.ws.cache.CacheServiceImpl I DYNA1056I: Dynamic Cache (object cache) initialized successfully.
[7/7/16 16:16:55:462 CDT] 0000002b com.ibm.ws.webcontainer.webapp I SRVE0292I: Servlet Message - [spring-mvc-angularjs-sample-app-master]:.Spring WebApplicationInitializers detected on classpath: [[email protected]57, [email protected]]
[7/7/16 16:16:55:606 CDT] 0000002b com.ibm.ws.webcontainer.webapp I SRVE0292I: Servlet Message - [spring-mvc-angularjs-sample-app-master]:.Initializing Spring root WebApplicationContext
[7/7/16 16:16:55:607 CDT] 0000002b org.springframework.web.context.ContextLoader I Root WebApplicationContext: initialization started
[7/7/16 16:16:55:678 CDT] 0000002b rk.web.context.support.AnnotationConfigWebApplicationContext I Refreshing Root WebApplicationContext: startup date [Thu Jul 07 16:16:55 CDT 2016]; root of context hierarchy
[7/7/16 16:16:55:708 CDT] 0000002b rk.web.context.support.AnnotationConfigWebApplicationContext I Registering annotated classes: [class calories.tracker.config.root.RootContextConfig,class calories.tracker.config.root.DevelopmentConfiguration,class calories.tracker.config.root.TestConfiguration,class calories.tracker.config.root.AppSecurityConfig]
[7/7/16 16:16:56:578 CDT] 0000002b eans.factory.annotation.AutowiredAnnotationBeanPostProcessor I JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
[7/7/16 16:16:56:838 CDT] 0000002b org.springframework.jdbc.datasource.DriverManagerDataSource I Loaded JDBC driver: org.postgresql.Driver
[7/7/16 16:16:56:958 CDT] 0000002b ringframework.orm.jpa.LocalContainerEntityManagerFactoryBean I Building JPA container EntityManagerFactory for persistence unit 'default'
[7/7/16 16:17:02:203 CDT] 0000002b org.springframework.security.web.DefaultSecurityFilterChain I Creating filter chain: [email protected]1, [org.springframework.secu[email protected]297728f1, org.spring[email protected]724560fb, [email protected]67, [email protected], com.allanditzel.springf[email protected]10fd6c23, org.[email protected]5ed9a45a, org.springframework.s[email protected]625bbf32, org.springfram[email protected]266bef7, org.sp[email protected]343dbd9e, org.springframework.[email protected]6a796e81, org.springfram[email protected]198ef120, o[email protected]79951250, org[email protected]558e68b7, org.springfr[email protected]639c2328]
[7/7/16 16:17:02:250 CDT] 0000002b org.springframework.web.context.ContextLoader I Root WebApplicationContext: initialization completed in 6629 ms
[7/7/16 16:17:02:294 CDT] 0000002b com.ibm.ws.webcontainer.webapp I SRVE0292I: Servlet Message - [spring-mvc-angularjs-sample-app-master]:.Initializing Spring FrameworkServlet 'dispatcher'
[7/7/16 16:17:02:294 CDT] 0000002b org.springframework.web.servlet.DispatcherServlet I FrameworkServlet 'dispatcher': initialization started
[7/7/16 16:17:02:321 CDT] 0000002b rk.web.context.support.AnnotationConfigWebApplicationContext I Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Thu Jul 07 16:17:02 CDT 2016]; parent: Root WebApplicationContext
[7/7/16 16:17:02:329 CDT] 0000002b rk.web.context.support.AnnotationConfigWebApplicationContext I Registering annotated classes: [class calories.tracker.config.servlet.ServletContextConfig]
[7/7/16 16:17:02:541 CDT] 0000002b eans.factory.annotation.AutowiredAnnotationBeanPostProcessor I JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
[7/7/16 16:17:03:584 CDT] 0000002b b.servlet.mvc.method.annotation.RequestMappingHandlerMapping I Mapped "{[/lifecycle],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public void calories.tracker.app.controllers.LifeCycleController.createLifeCycle(calories.tracker.app.dto.LifeCycleDTO)
[7/7/16 16:17:03:586 CDT] 0000002b b.servlet.mvc.method.annotation.RequestMappingHandlerMapping I Mapped "{[/meal],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public calories.tracker.app.dto.MealsDTO calories.tracker.app.controllers.MealController.searchMealsByDate(java.security.Principal,java.util.Date,java.util.Date,java.util.Date,java.util.Date,java.lang.Integer)
[7/7/16 16:17:03:587 CDT] 0000002b b.servlet.mvc.method.annotation.RequestMappingHandlerMapping I Mapped "{[/meal],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.util.List<calories.tracker.app.dto.MealDTO> calories.tracker.app.controllers.MealController.saveMeals(java.security.Principal,java.util.List<calories.tracker.app.dto.MealDTO>)
[7/7/16 16:17:03:588 CDT] 0000002b b.servlet.mvc.method.annotation.RequestMappingHandlerMapping I Mapped "{[/meal],methods=[DELETE],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public void calories.tracker.app.controllers.MealController.deleteMeals(java.util.List<java.lang.Long>)
[7/7/16 16:17:03:592 CDT] 0000002b b.servlet.mvc.method.annotation.RequestMappingHandlerMapping I Mapped "{[/user],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public calories.tracker.app.dto.UserInfoDTO calories.tracker.app.controllers.UserController.getUserInfo(java.security.Principal)
[7/7/16 16:17:03:593 CDT] 0000002b b.servlet.mvc.method.annotation.RequestMappingHandlerMapping I Mapped "{[/user],methods=[PUT],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public void calories.tracker.app.controllers.UserController.updateUserMaxCaloriesPerDay(java.security.Principal,java.lang.Long)
[7/7/16 16:17:03:597 CDT] 0000002b b.servlet.mvc.method.annotation.RequestMappingHandlerMapping I Mapped "{[/user],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public void calories.tracker.app.controllers.UserController.createUser(calories.tracker.app.dto.NewUserDTO)
[7/7/16 16:17:03:656 CDT] 0000002b .springframework.web.servlet.handler.SimpleUrlHandlerMapping I Mapped URL path [/resources/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
[7/7/16 16:17:03:953 CDT] 0000002b b.servlet.mvc.method.annotation.RequestMappingHandlerAdapter I Looking for @ControllerAdvice: WebApplicationContext for namespace 'dispatcher-servlet': startup date [Thu Jul 07 16:17:02 CDT 2016]; parent: Root WebApplicationContext
[7/7/16 16:17:04:235 CDT] 0000002b org.springframework.web.servlet.DispatcherServlet I FrameworkServlet 'dispatcher': initialization completed in 1940 ms
[7/7/16 16:17:04:235 CDT] 0000002b com.ibm.ws.webcontainer.servlet I SRVE0242I: [spring-mvc-angularjs-sample-app-master] [/calories-tracker] [dispatcher]: Initialization successful.
Profil ("Entwicklung") wahrscheinlich
@Configuration
@Profile("development")
@EnableTransactionManagement
public class DevelopmentConfiguration {
@Bean(name = "datasource")
public DriverManagerDataSource dataSource() {
...
@Bean(name = "entityManagerFactory")
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DriverManagerDataSource dataSource)
...
jvm.options, wie Sie sie in der Befehlszeile setzen würde sein sollte. Es sollte "-Despring.profiles.active = development" sein. War das nur ein Tippfehler? – ebullient
Nein, es war kein Tippfehler. Ich habe versucht, die gleiche Idee von Tomcat hinzuzufügen. In catalina.properties verwenden wir nicht "D". Ich habe es mit "D" versucht und dann konnte ich den Server starten, aber als ich meine Anwendung hinzugefügt habe, scheint @profile noch nicht in Kraft zu sein. Ich werde meine Frage mit dem WAS-Protokoll aktualisieren. –