Wildfly unable to load deployments after IntelliJ IDEA deploy - intellij-idea

I am running my local dev Wildfly 9.0.1 server and faced a problem that after I deploy my .war application via IntelliJ IDEA I cant open Deployments tab it says "Unable to load deployments".
And in logs there is a record:
16:20:15,868 ERROR [org.jboss.as.controller.management-operation] (XNIO-1 task-10) WFLYCTL0013: Operation ("read-attribute") failed - address: ([
("deployment" => "modules-journal"),
("subsystem" => "datasources"),
("data-source" => "java:jboss/datasources/mj2")
]) - failure description: "WFLYJCA0065: No DataSource exists at address [
(\"deployment\" => \"modules-journal\"),
(\"subsystem\" => \"datasources\"),
(\"data-source\" => \"java:jboss/datasources/mj2\")
]"
Yes, my application contains datasource definition in WEB-INF folder:
<?xml version="1.0" encoding="UTF-8"?>
<datasources xmlns="http://www.jboss.org/ironjacamar/schema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.org/ironjacamar/schema http://docs.jboss.org/ironjacamar/schema/datasources_1_0.xsd">
<!-- The datasource is bound into JNDI at this location. We reference
this in META-INF/persistence.xml -->
<datasource jndi-name="java:jboss/datasources/mj2"
pool-name="hibernate4-quickstart" enabled="true"
use-java-context="true">
<connection-url>jdbc:h2:~/test:mj2</connection-url>
<driver>h2</driver>
<security>
<user-name>test</user-name>
<password>test</password>
</security>
</datasource>
</datasources>
And my deployed application works successfully with it.
Why Wildfly Deployments tab says that "No DataSource exists" and doesn't open but my application still works?
Also everything works well if I don't use IntelliJ IDEA but deploy my app with Wildfly web interface.
Possibly it is an IntelliJ IDEA issue but it looks very strange from Wildfly side.
Could anyone explain why Wildfly reports that it doesn't see datasource when it exists and why it prevents Wildfly from loading "Deployments tab"? I missing something in how Wildfly works or it is a bug in Wildfly?

Do you see your datasource through admin interface? File-based datasource deployments are deprecated and are not available for management at runtime [1]. IDEA probably tries to check for datasource using jboss management and gets an error.
[1] http://www.mastertheboss.com/jboss-server/jboss-datasource/jboss-as-7-deployable-datasources

Related

Weblogic 12 ignore realm-name in weblogic-application.xml

I'm trying to use a custom realm into my webapp deployed in weblogic version 12.2.1.4.0 to manage login (through a form based authentication), but even if the new realm is correctly defined and also the SQLAuthenticator provider, when i try to set the realm name, according to Oracle guide, the results is that at deploy or starts of the application weblogic logs that the configuration is ignored:
<Warning: Ignore the realm name: myrealm in
deployment descriptor.>
This problems occurs even when i configure the name of the standard WL realm "myrealm".
The SQLAuthenticator provider (readonly) works good and if i configure it in the default realm the login works, but the users and groups specific of the application are mixed with the system users and can be inherited by others application eventually deployed on the same WL instance and I want to avoid this.
weblogic-application.xml is correctly contained in META-INF dir of the EAR that contain the WAR and this is the content:
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-application
xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-application"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/javaee_6.xsd http://xmlns.oracle.com/weblogic/weblogic-application http://xmlns.oracle.com/weblogic/weblogic-application/1.8/weblogic-application.xsd">
<wls:security>
<wls:realm-name>myrealm</wls:realm-name>
</wls:security>
</wls:weblogic-application>

Closed : Logback xml not picked by weblogic

We have externalized the logback configuration in our spring app.
Used logback spring ext
compile 'org.logback-extensions:logback-ext-spring:0.1.4'
Added following lines in web.xml
<context-param>
<param-name>logbackConfigLocation</param-name>
<param-value>file:/${log-config-folder}/api/logback.xml</param-value>
</context-param>
Placed logback.xml in the folder mentioned in web.xml
/usr/me/my-app/log-config
/api
/logback.xml
Added JVM argument in start up script of tomcat.
JAVA_OPTS="$JAVA_OPTS -Dlog-config-folder=usr/me/my-app/log-config"
When the app is deployed in tomcat, it works perfectly fine. We are able to see the logs. When logback xml gets updated, I can see changes reflecting immediately in the app (changing LOG LEVELs)
Problem: When this same configuration is moved to weblogic, its not picking up the logback xml from external folder. JVM argument is added to weblogic start up script. I can see the JVM argument getting set.
Weblogic team came back and told they have made the weblogic setting to prioritize application classes and config.
<prefer-web-inf-classes>true</prefer-web-inf-classes>
Any pointers to triaging this would be really helpful.

Change Worklight Application status on Console using action file

I need to know if I can change the status of the application on Worklight Console using action file that I can run on the server.
Details:
In our production server, we need to change the status of the previous versions of the application from "Active" to "Active, Notifying" then to "Access Disabled".
This can be achieved from the WL console and we can write the notification message that will be sent to the user:
However, to avoid the "human" work on our Prod environment, we are looking to use an action file to be run on the server which will do the change.
Is this possible. Or this should be from the Console?
WL Version : 6.2.0.1
PS: We use an action file to change any property on our WebSphere server.
Action File example (Looking for something similar):
<?xml version="1.0" encoding="UTF-8"?>
<!--
Environment specific WebSphere configuration management XML file.
Warning: This file contains clear text passwords and, therefore, cannot be
distributed outside of the eCommerce group without masking the
password values.
-->
<!DOCTYPE WAS [
<!-- Environment specific parameters -->
<!ENTITY KEY_STORE_PATH "/was85/resources/security/ecommerce_bk_mobile.p12">
]>
<WAS>
<!-- Applications: Application Types: WebSphere enterprise applications -->
<Application
name="IBM_Worklight_project_runtime_MobileBanking">
<!-- Enterprise Applications > application_name > Environment entries for Web modules -->
<WebAppBinding _action="update"
description="[OPTIONAL] SSL certificate keystore location. Default: conf/default.keystore."
module="Worklight"
name="ssl.keystore.path"
uri="MobileBanking.war,WEB-INF/web.xml"
value="&KEY_STORE_PATH;"/>
</Application>
</WAS>
You cannot use "action files".
In Worklight, you can use the REST APIs services that allow you to manage... stuff, such as setting Remote Disable.
See here: http://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.apiref.doc/apiref/c_restapi_oview.html
And specifically for Remote Disable (info and example): http://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.apiref.doc/apiref/r_restapi_app_version_access_rule_put.html

IBM Worklight 5.0.6.1 - Failed adapter deployment

I'm having a problem while trying to deploy an adapter to Worklight Console.
I figured out that the adapter which is reading the worklight.properties file does not get deployed. But an adapter that does not read the worklight.properties file is able to deploy without any problem.
I looked at the WAS log and its seems that the unsuccessful adapter deployment was actually deployed, but then they got rollbacked (undeployed) immediately.
Using Worklight 5.0.6.1 with latest iFix.
Edit:
Verified that both server and studio are using the same worklight version
The same configuration working fine in the UAT environmenet; problem happens only in the Production environment.
The Adapter XML:
<displayName>ConfigFileAdapter</displayName>
<description>ConfigFileAdapter</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>${adapter.config.protocol}</protocol>
<domain>${adapter.config.domain}</domain>
<port>${adapter.config.port}</port>
<!-- Following properties used by adapter's key manager for choosing specific certificate from key store
<sslCertificateAlias></sslCertificateAlias>
<sslCertificatePassword></sslCertificatePassword>
-->
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode="30" />
</connectivity>
<procedure name="getConfigData" securityTest="adapterProtectionTest" requestTimeoutInSeconds="10" />
<procedure name="getLoggingLevel" securityTest="adapterProtectionTest" requestTimeoutInSeconds="10" />
</wl:adapter>
Logs captured in SystemOut.log:
com.worklight.integration.services.impl.DeployServiceImpl
syncAdaptersFromDB FWLSE0084I: Deployed adapter 'xxx' successfully.
com.worklight.integration.services.impl.DeployServiceImpl
deleteAdapterInternal FWLSE0039I: Deleted adapter 'xxx' successfully.
From the log the adapter were deleted immediate after deployed.
Make sure that the .war file you have deployed to the Production environment contains a worklight.properties file that contains these adapter.config.protocol/host/port properties.
In my testing the only time I could not deploy an adapter that uses custom properties from worklight.properties was when these properties did not exist in worklight.properties. When this happened I saw this error: Failed to deploy adapter 'test.adapter'. Could not resolve placeholder 'test.idan'

IBM Worklight 6.0 - Worklight Console does not show up after installing WL 6.0 server on Liberty profile - Error 500

IBM Worklight 6.0 is installed on a Liberty Profile 8.5.5 with a mySQL db. While deploying the application and trying to access the Worklight console the below error is encountered on console
Error 500: javax.servlet.ServletException: Filter[authenticationFilter]: Could not find required filter class - com.worklight.core.auth.impl.AuthenticationFilter.class
In your server.xml you need to make sure that your worklight-jee-library.jar is in the application classloader.
<application id="worklight" name="worklight" location="BMOMobileBanking.war" type="war" context-root="/worklight">
<classloader delegation="parentLast">
<commonLibrary>
<fileset dir="/my/worklight/lib" includes="worklight-jee-library.jar"/>
</commonLibrary>
</classloader>
</application>
Make sure the "/my/worklight/lib" points to the directory where this JAR is. I may suggest ${shared.resource.dir}/worklight/lib which usually translates to $WASLP_HOME/usr/shared/resources/worklight/lib
I just went through the same issue. For me the issue is related to the worklight database not existing on my server. So check if the database WRKLGHT and WLREPORT are created and they are properly configured in your server.xml.
Look at the Create and Configure the databases link on the help website here
http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/index.jsp?topic=%2Fcom.ibm.worklight.deploy.doc%2Fdeploy%2Fc_deploy_wl_project.html
If you've ensured the worklight-jee-library.jar is in the application classloader, and you're still having the problem, then you may have an issue with the Liberty server cache.
Try: server start worklight --clean
NOTE: replace worklight with your server name