Cloud Foundry Maven Plugin proxy with authentication - maven-3

I am trying to deploy to Pivotal Web Services using the Cloud Foundry maven plugin. I can deploy very easily with no network proxy in use, but when behind the network proxy I am unsure how to configure the plugin and I was not able to find a good answer while searching online. Thank you for any help!
<plugin>
<groupId>org.cloudfoundry</groupId>
<artifactId>cf-maven-plugin</artifactId>
<version>1.1.2</version>
<configuration>
<target>https://api.run.pivotal.io</target>
<server>cloud-foundry-credentials</server>
<org>MindWaveService</org>
<space>development</space>
<appname>MindwaveServiceApp</appname>
<url>http://appurl-service.cfapps.io/</url>
<memory>512</memory>
<instances>1</instances>
</configuration>
</plugin>
<proxy>
<id>optional</id>
<active>true</active>
<protocol>*</protocol>
<username>myUsername</username>
<password>myPass</password>
<host>myHostUrl</host>
<port>8080</port>
<nonProxyHosts>153.2.128.54|153.2.204.21|com.ups.*|10.244.223.27</nonProxyHosts>
</proxy>

Related

How to let JBoss not to affect my own log4j2 settings?

I'm using Log4j2(2.17.1) with two type of configs(log4j.prop & log4j2.xml) on multiple projects. My APP's log4j2 works properly on Tomcat 9 while reading external log4j config. But somehow it stops working or only logging into server.log when I deploy my APP onto JBoss EAP 7. So I think the problem is coming from JBoss, and I need a way to tell it don't mess with my own Log4j2. Does anyone know how to do it?
With JBoss EAP 7.4 there is a new module which delegates the log4j-api logs to the jboss-logmanager. If you want to use the log4j log manager (log4j-core) then you need to exclude some modules from your deployment.
Option 1 below I would say is preferred since it only affects a single deployment. Option 2 will affect all deployments.
Option 1
Add a jboss-deployment-structure.xml to your deployment:
<jboss-deployment-structure>
<deployment>
<exclusions>
<module name="org.apache.logging.log4j.api" />
</exclusions>
</deployment>
</jboss-deployment-structure>
Option 2
Change the add-logging-api-dependencies attribute in the logging subsystem to false.
CLI example:
/subsystem=logging:write-attribute(name=add-logging-api-dependencies, value=false)
The root cause for this issue is related to the "ClassLoader" which is searched by JBoss EAP Logging in order to find the appropriate logging provider implementation. This search is made in the following order:
JBoss EAP LogManager
Log4j
Slf4j
JDK logging
Since both JBoss EAP LogManager and Log4j2 are available in the classpath, the JBoss EAP LogManager will be utilized due to the "higher precedence". For this reason, you must set the use-deployment-logging-config=false in the logging subsystem.
Furthermore, the JBoss EAP LogManager also uses classes from Log4j2 in its own implementation. That's why the modules, org.apache.log4j and org.apache.commons.logging have to be excluded from the deployment in order for Log4J2 to work correctly.

jqassistant-maven-plugin: cannot connect browser to embedded Neo4j

Note: There are already similar questions, but the solutions do not work for the jqassistant-maven-plugin.
I am facing an issue on a new client site, where I would like to view the Neo4j contents which have been scanned by JQAssistant, by using the jqassistant-maven-plugin (1.10.0).
Running mvn jqassistant:scan jqassistant:analyze jqassistant:server will spin up and embedded Neo4j, scan the contents of my Maven project, and keep the embedded instance open so I can access it via http://localhost:7474/
When trying to login in the browser (using the bolt protocol) I am facing a connection issue.
ServiceUnavailable: WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver.
Please use your browsers development console to determine the root cause of the failure.
Common reasons include the database being unavailable, using the wrong connection URL or temporary network problems. If you have enabled encryption, ensure your browser is configured to trust the certificate Neo4j is configured to use.
WebSocket `readyState` is: 3
I've never seen anything like this before with this tool. The only ressource I've found was this documentation saying that the listenAddress should be changed.
Basically JQAssistant is configured as always, with the exception of the embeddedListenAddress:
<plugin>
<groupId>com.buschmais.jqassistant</groupId>
<artifactId>jqassistant-maven-plugin</artifactId>
<version>${jqassistant.version}</version>
<executions>
<execution>
<id>default-cli</id>
<goals>
<goal>scan</goal>
<goal>analyze</goal>
</goals>
<configuration>
<warnOnSeverity>INFO</warnOnSeverity>
<failOnSeverity>MAJOR</failOnSeverity>
<embeddedListenAddress>0.0.0.0</embeddedListenAddress>
</configuration>
</execution>
</executions>
</plugin>
Does anyone had a similar experience? It seems to me that some corporate setting in the browsers (all which are available) are blocking websockets. Is there a way around this. My only workaround in the moment is using an dedicated Neo4j instance, which complicates the dev-setup and I would like to avoid this.
Further analysis:
Checking the browser-port, shows that it is listening
netstat -a | findstr 7474
TCP 0.0.0.0:7474
TCP [::]:7474
The bolt-port on the other hand is not available
netstat -a | findstr 7687
After setting <embeddedBoltPort>45856</embeddedBoltPort> (an arbitrary high number) I can finally connect. For some reason the port was not allowed to come up, even changing it to something commonly used like 8080 did not work.
I do not understand why this happened, because the port was not used. When testing a used port the correct exception appears that it is already in use. I can only assume some weird security setting at the client.
My only suggestion for the jqassistant-maven-plugin would be to test if all required ports are up and running even when no exception occured during startup.
Thanks anyone for sharing ideas to track this down.

Quartz.Net Remove Proxy Azure WebJob

Is it possible to run Quartz.Net in an Azure WebJob and communicate with it using a RemoteClient proxy? If so, how could I figure out what the address would be?
<quartz>
<add key="quartz.scheduler.instanceName" value="RemoteClient"/>
<add key="quartz.scheduler.proxy" value="true"/>
<add key="quartz.scheduler.proxy.address" value="tcp://127.0.0.1:555/QuartzScheduler"/>
</quartz>
I know that Azure has its own scheduling mechanisms, but my application has to run in both Azure and Self-Hosted environments.
The Azure WebJob has the same sandbox limitation as the Azure Website in which it cannot open an arbitrary port and listen on it.
One possible way to communicate with a WebJob is via persistent queues (like Azure storage queue, servicebus queue or any other).

WSO2 Carbon 4.x JNDI Tomcat

WSO2 Registry 4.5.x based on Carbon 4.x plattform allows to deploy WARs. For configuration of resources I want to use JNDI.
As described here, I try to configure JNDI resources:
http://kishanthan.wordpress.com/2012/05/31/how-to-register-jndi-resources-for-webapps-in-wso2-application-server/
1) WEB-INF/web.xml
<resource-ref>
<res-ref-name>url/ZoneConfiguration</res-ref-name>
<res-type>java.net.URL</res-type>
<res-auth>Container</res-auth>
</resource-ref>
2) META-INF/context.xml
<Context debug="5" reloadable="true" crossContext="true">
<ResourceLink name="url/ZoneConfiguration" global="url/ZoneConfiguration" type="java.net.URL"/>
</Context>
3) $CARBON_HOME/repository/conf/tomcat/catalina-server.xml:
<GlobalNamingResources>
<Resource name="url/ZoneConfiguration" factory="org.jee.jndi.URLResourceFactory"
type="java.net.URL" url="file:///temp/local.zone.properties"/>
</GlobalNamingResources>
(about factory: see here http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html#Adding_Custom_Resource_Factories)
The library with URLResourceFactory is deployed in $CARBON_HOME/lib/endorsed
This configuration works in a Tomcat 7.x but not in the WSO2 Tomcat. I am inclined to file an issue.
Or am I lacking anything WSO2 specific?
WSO2 Registry 4.5.X does not support hosting webapps out of the box, unless you have installed the webapp management feature on top of WSO2 Registry.
You can find more info related to JNDI Resources configurations from this post [1]. A sample is also included in that post which demonstrates the configurations and accessing resources defined as global naming resources with custom resource factory implementation.
[1] http://kishanthan.wordpress.com/2012/05/31/how-to-register-jndi-resources-for-webapps-in-wso2-application-server/

Sharepoint site running in a VM

Basic question...I have a site running in a VM, say the URL is http://localhost/sites/foo/default.aspx
I want to surf to the URL from my host box, so I get the IP of the VM, and I try:
http:///sites/foo/default.aspx.
When I do, I get an error:
<configuration>
<system.web>
<customErrors mode="RemoteOnly"/>
</system.web>
</configuration>
Shouldn't I be able to do this, isn't this basic?
I also tried using the IP on in a browser on the VM (instead of localhost), but I get the same error.
Thanks
That message means that IIS would like to display a .NET error to you, but your web.config file is not set up to allow that.
I'm not sure where the web.config file is located for sharepoint, but when you find it, you can change it to this:
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
That way, you'll be able to see the error message remotely.
You must to place that VM IP into your hosts file and to associate it with your Sharepoint real website (i.e., not localhost)

Resources