title: how to setup spring.profiles.active in websphere liberty 8.5
body: <p>Why I am getting the error "Unrecognized option: -spring.profiles.active=development" when I try to start the Websphere with jvm.options file? I am following the steps provided in <a href="http://www-01.ibm.com/support/docview.wss?uid=swg21596474" rel="nofollow noreferrer">http://www-01.ibm.com/support/docview.wss?uid=swg21596474</a>.</p>
  
  <p>In practical terms, I want to do with Websphere Liberty Profile added to Eclipse Server View the same I have done with Tomcat. In Tomcat 8 I just added "spring.profiles.active=development" in catalina.properties and it take the same effect as I start with "mvn ... -Dspring.profiles.active=development". </p>
  
  <p>I see my question as developer topic since I want to know how to start the Websphere Liberty Profile taking advantage of @profile.</p>
  
  <p>Please, be sure to understand that I am using Websphere Liberty which means I don't have Websphere Admin Console so, if someone provide the steps in Websphere Admin Console screens it will be worthless.</p>
  
  <p>I added an image to show how is my Eclipse Server view and where I added the jvm.options file which only contains -spring.profiles.active=development.</p>
  
  <p>The error only appears when I try to start the server with such jvm.otions there. If I took the file out the server starts but obviously, when I add my application @profile will not be taken in account.</p>
  
  <p>Entire error:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>P.S. I don't think it is relevant to my question, btw, the entire application can be found in <a href="https://github.com/jhades/spring-mvc-angularjs-sample-app" rel="nofollow noreferrer">https://github.com/jhades/spring-mvc-angularjs-sample-app</a> </p>
  
  <p><a href="https://i.stack.imgur.com/nKJCC.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nKJCC.jpg" alt="Eclipse Server view"></a></p>
  
  <p>*** Edited 1</p>
  
  <p>After I followed the suggestion to add "D" after "-" I could start the server (it is different in Tomcat since in Tomcat you must avoid "D"). Btw, I don't see the @profile taking effect at all when I deployed the application to WAS Liberty. I added below the entire Websphere logs and I don't see the same long log descriptions I usually see in Tomcat. Since I am facing an extra error related to context path (see the new image attached) I couldn't test the application beyond see the welcome page but I am almost sure that @profile was ignore someway because the logs doesn't seem it was taken in account.</p>
  
  <pre><code>********************************************************************************
  
  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 = 6780@GH-VDIKCISV252
  
  ********************************************************************************
  
  [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: [calories.tracker.config.SecurityWebApplicationInitializer@23cbd857, calories.tracker.config.WebAppInitializer@7c711eb2]
  
  [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: org.springframework.security.web.util.matcher.AnyRequestMatcher@1, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@297728f1, org.springframework.security.web.context.SecurityContextPersistenceFilter@724560fb, org.springframework.security.web.header.HeaderWriterFilter@d397b67, org.springframework.security.web.csrf.CsrfFilter@f62a487, com.allanditzel.springframework.security.web.csrf.CsrfTokenResponseHeaderBindingFilter@10fd6c23, org.springframework.security.web.authentication.logout.LogoutFilter@5ed9a45a, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@625bbf32, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@266bef7, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@343dbd9e, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@6a796e81, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@198ef120, org.springframework.security.web.session.SessionManagementFilter@79951250, org.springframework.security.web.access.ExceptionTranslationFilter@558e68b7, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@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&lt;calories.tracker.app.dto.MealDTO&gt; calories.tracker.app.controllers.MealController.saveMeals(java.security.Principal,java.util.List&lt;calories.tracker.app.dto.MealDTO&gt;)
  
  [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&lt;java.lang.Long&gt;)
  
  [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.
  </code></pre>
  
  <p>Profile("development") probably ignored</p>
  
  <pre><code>@Configuration
  @Profile("development")
  @EnableTransactionManagement
  public class DevelopmentConfiguration {
      @Bean(name = "datasource")
      public DriverManagerDataSource dataSource() {
  ...
      @Bean(name = "entityManagerFactory")
      public LocalContainerEntityManagerFactoryBean entityManagerFactory(DriverManagerDataSource dataSource) 
  ...
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/C2I4u.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C2I4u.jpg" alt="This is an error with context path blocking me to test the application"></a></p>