Intershop 7.8 setting.gradle, jvm arguments - intershop

In the following cookbook chapter 3.3.3:
https://support.intershop.com/kb/index.php/Display/2V8150
There is a configuration for the jvm arguments, which is not working.
I've tried 4 different configs and they all crash my deploy:
tomcat {
instances {
appserver0 {
jvmArgs {
maxHeapSize = 4096
minHeapSize = 2048
additionalJvmArgs = ['\\u0022-XX:MaxPermSize=256m\\u0022']
}
}
}
}
tomcat {
instances {
appserver0 {
jvmArgs {
maxHeapSize = 4096m
minHeapSize = 2048m
additionalJvmArgs = ['\\u0022-XX:MaxPermSize=256m\\u0022']
}
}
}
}
appserver {
instances {
appserver0 {
jvmArgs {
maxHeapSize = 4096
minHeapSize = 2048
additionalJvmArgs = ['\\u0022-XX:MaxPermSize=256m\\u0022']
}
}
}
}
appserver {
instances {
appserver0 {
jvmArgs {
maxHeapSize = 4096m
minHeapSize = 2048m
additionalJvmArgs = ['\\u0022-XX:MaxPermSize=256m\\u0022']
}
}
}
}
Does someone has this configuration setting working?

The problem seems to be the additional JVM arguments. When leaving this out it works.
This will result in the following code snippet.
tomcat {
instances {
appserver0 {
jvmArgs {
minHeapSize = 2048
maxHeapSize = 4096
}
}
}
}

There was a defect in the deployment tools that caused double quotes to be preceded by a backslash character in the resulting file (in this case the process.appserver0.command property value in $IS_HOME/engine/nodemanager/config/nodemanager.properties). Please check the resulting property value in the nodemanager.properties file and the command line logged into the $IS_HOME/log/nodemanager.log and $IS_HOME/log/appserver0.log files.
The option in the $IS_HOME/engine/nodemanager/config/nodemanager.properties file should be surrounded by double quotes or the encoded form \u0022 – otherwise Windows interprets the = character as a separator (surrounding the option with double quotes is not necessary on Linux platforms).
This underlying issue has been fixed with Gradle tools version 2.11.6.
Please note that the support of the XX:MaxPermSize option was removed in JDK 8.0 (the option is ignored and results in a warning message).

Related

gradle plugin copy without default excludes

I want to get some dependency artifact and copy the content into a specific location.
This works well in general, but not for files called e.g. .gitignore.
I found that those are default excludes.
How can i disable those default exclude, by using the Java-Gradle-API in my plugin code?
project.copy( spec -> {
spec.from (project.zipTree(artifact.getFile()));
spec.into( tf.toFile());
//spec.setExcludes(Collections.emptyList()); // does not work
});
Also i tried to the setExcludes in the from/into copyspec.
Frank
I found a solution, but i don't like it, because it modifies the globally visible defaultExcludes:
private static void withoutDefaultExcludes( Runnable r ) {
String[] defaultExcludes = org.apache.tools.ant.DirectoryScanner.getDefaultExcludes();
try {
for( String defaultExclude : defaultExcludes) {
org.apache.tools.ant.DirectoryScanner.removeDefaultExclude(defaultExclude);
}
r.run();
}
finally {
for( String defaultExclude : defaultExcludes) {
org.apache.tools.ant.DirectoryScanner.addDefaultExclude(defaultExclude);
}
}
}
withoutDefaultExcludes( () -> {
project.copy( spec -> {
spec.from (project.zipTree(artifact.getFile()));
spec.into( tf.toFile());
});
});

Semi-colon required, optional, or disallowed in gRPC option value?

I'm seeing one piece of code like the following:
rpc SayFallback (FooRequest) returns (FooResponse) {
option (com.example.proto.options.bar) = {
value : "{ message:\"baz\" }";
};
}
and another like the following:
rpc SayFallback (FooRequest) returns (FooResponse) {
option (com.example.proto.options.bar) = {
value : "{ message:\"baz\" }"
};
}
The first has a ; on the line with value while the second doesn't. Are either OK according to the standard?
Yes, they are considered optional. See the protobuf file source snippet:
while (!TryConsumeEndOfDeclaration("}", NULL)) {
if (AtEnd()) {
AddError("Reached end of input in method options (missing '}').");
return false;
}
if (TryConsumeEndOfDeclaration(";", NULL)) {
// empty statement; ignore
} else {
...
}

juniper srx - basic routing/transparent mode

juniper firefly + basic static route in gns3.
Configuration is smilar in:
http://kb.juniper.net/InfoCenter/index?page=content&id=KB21421
I'm delete untrunt zone:
root# run show configuration
## Last commit: 2015-07-27 20:32:29 UTC by root
version 12.1X47-D20.7;
system {
root-authentication {
encrypted-password "$1$HtKID/TF$jteDsW8F17nSgIQj5e6KF0"; ## SECRET-DATA
}
}
interfaces {
ge-0/0/0 {
unit 0 {
family bridge {
interface-mode access;
vlan-id 10;
}
}
}
ge-0/0/1 {
unit 0 {
family bridge {
interface-mode access;
vlan-id 10;
}
}
}
irb {
unit 0 {
family inet {
address 172.27.186.63/24;
}
}
}
}
routing-options {
static {
route 0.0.0.0 next-hop 172.27.186.1
}
}
security {
policies {
from-zone trust to-zone trust {
policy 1 {
match {
source-address any;
destination-address any;
application any;
}
then {
permit;
}
}
}
}
bridge-domains {
test {
domain-type bridge;
vlan-id 10;
routing-interface irb.0;
}
}
ping 172.27.186.2->172.27.186.3 not work
ping 172.27.186.3->172.27.186.2 not work
ping 172.27.186. 2 or 3 -> 172.27.186.63 work.
I spent several hours and I do not see where the place is a problem.
This is a simple configuration to learn the rules and theoretically should work, but it is not.
Someone will say where is the error?
I made myself a static routing between 2 cisco routers - ping worked, I added between routers juniper-a and set similarly to the above is unfortunately also not working.
It does not operate even such a simple routing, where there are 2 commands:
youtube.com / watch?v=I9li31WvUA8
Thank you very much for any help
Try to set up default security policy to "permit-all":
security {
policies {
default-policy {
permit-all;
}
}
}
Try to create Security Zones if you haven't created it yet:
security {
zones {
security-zone Internal {
interfaces {
ge-0/0/0.0 {
host-inbound-traffic {
system-services {
ping;
ssh;
telnet;
all;
}
}
}
[...]
}
}
}
}

Thymeleaf at syntax: "#{/}" returns empty if I include ResourceUrlEncodingFilter

I'm using Thymeleaf.
This template:
<a th:href="#{/}">a</a>
produces this html:
a
This is what I'm expected.
I put ResourceUrlEncodingFilter bean to try ContentVersionStrategy in my WebMvcConfigurerAdapter extended class.
#Bean
public ResourceUrlEncodingFilter resourceUrlEncodingFilter() {
return new ResourceUrlEncodingFilter();
}
The produced html turned to:
a
The value of href is empty.
I hope href is "/" even if I put ResourceUrlEncodingFilter bean.
th:href="#{/a}" turns to href="/a" in both cases.
Did I do something wrong?
Thank you very much.
UPDATE:
This is my build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'io.spring.gradle:dependency-management-plugin:0.5.1.RELEASE'
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.3.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
apply plugin: 'io.spring.dependency-management'
version = '1.0'
jar {
manifest {
attributes 'Implementation-Title': 'Gradle Quickstart', 'Implementation-Version': version
}
}
repositories {
mavenCentral()
}
dependencyManagement {
imports {
mavenBom 'io.spring.platform:platform-bom:1.1.2.RELEASE'
}
}
dependencies {
compile('org.webjars:bootstrap:3.3.1')
compile('org.webjars:knockout:3.2.0')
compile('org.webjars:momentjs:2.9.0')
compile('org.webjars:numeral-js:1.5.3-1')
compile('org.webjars:underscorejs:1.7.0-1')
compile('org.webjars:sugar:1.4.1')
compile('org.webjars:jqplot:1.0.8r1250')
compile('org.webjars:jquery-cookie:1.4.1-1')
compile("org.springframework.boot:spring-boot-starter-actuator")
compile("org.springframework.boot:spring-boot-starter-batch")
compile("org.springframework.boot:spring-boot-starter-data-jpa")
compile("org.springframework.boot:spring-boot-starter-security")
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.boot:spring-boot-starter-tomcat")
compile("org.springframework.boot:spring-boot-starter-thymeleaf")
compile("org.springframework.boot:spring-boot-starter-test")
compile("org.springframework:spring-context-support") // this is for mail
compile('commons-codec:commons-codec')
compile("commons-io:commons-io")
compile('com.google.guava:guava')
compile('org.hibernate:hibernate-validator')
compile("com.sun.mail:javax.mail")
compile('mysql:mysql-connector-java')
compile("org.yaml:snakeyaml")
compile("org.apache.commons:commons-lang3:3.2")
compile('com.amazonaws:aws-java-sdk:1.9.4')
compile('net.sf.supercsv:super-csv:2.2.0')
compile('edu.vt.middleware:vt-password:3.1.2')
}
test {
//systemProperties 'property': 'value'
systemProperties 'spring.profiles.active': 'unittest'
systemProperties 'MAIL_PROP': 'mail.properties'
systemProperties 'user.timezone': 'UTC'
}
uploadArchives {
repositories {
flatDir {
dirs 'repos'
}
}
}
Thanks for this detailed explanation and the repro project!
This is actually a bug: see SPR-13241, to be fixed in Spring 4.1.8 and 4.2.0.
Spring Boot adds "/**" matcher for automatic configurations of static web resources locations.
The locations are /META-INF/resources/, /resources/, /static/ and /public/.
When you put below html in Thymeleaf template,
<a th:href="#{/}">a</a>
Below method in ResourceUrlProvider.java is called because of the matcher and get into for loop:
public final String getForLookupPath(String lookupPath) {
// -- omission --
for(String pattern : matchingPatterns) {
// -- omission --
String pathWithinMapping = getPathMatcher().extractPathWithinPattern(pattern, lookupPath);
String pathMapping = lookupPath.substring(0, lookupPath.indexOf(pathWithinMapping));
// -- omission --
String resolved = chain.resolveUrlPath(pathWithinMapping, handler.getLocations());
if (resolved == null) {
continue;
}
// -- omission --
return pathMapping + resolved;
}
// -- omission --
}
The argument, lookupPath is "/" by the "#{/}", Then:
The pathWithinMapping will be "".
The pathMapping will be "".
The resolved will be "".
So this method returns "" and the value is set to href="".
This is in my opinion, if the pathWithinMapping is "", to continue the for loop seems good. Calling chain.resolveUrlPath seems not good.
Thanks,

Could not find file to copy in ant.copy although file exists

I am calling ant.copy in a groovy script:
ant.copy(file:jdbcDriverPath, toFile:destJDBCJarFile,overwrite:true)
The call is failing with the exception below, although the file exists under the path.
The same code launched on Windows works. When launched on Unix with java jdk1.7.0_51, it is failing.
Machine details on Unix:
$ uname -a
SunOS 5.10 Generic_142910-17 i86pc i386 i86pc
$ isainfo -kv
64-bit amd64 kernel modules
Any ideas?
Exception in thread "main" : Warning: Could not find file /data/apps/packages/temp/jconn3-6.05_26312.jar to copy.
at org.apache.tools.ant.taskdefs.Copy.copySingleFile(Copy.java:639)
at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:455)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at groovy.util.AntBuilder.performTask(AntBuilder.java:250)
at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:212)
at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:147)
at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:166)
at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
Thanks
The copy task is failing while running the below snippet (from the source of Ant 1.9.4):
private void copySingleFile() {
// deal with the single file
if (file != null) {
if (file.exists()) {
if (destFile == null) {
destFile = new File(destDir, file.getName());
}
if (forceOverwrite || !destFile.exists()
|| (file.lastModified() - granularity
> destFile.lastModified())) {
fileCopyMap.put(file.getAbsolutePath(),
new String[] {destFile.getAbsolutePath()});
} else {
log(file + " omitted as " + destFile
+ " is up to date.", Project.MSG_VERBOSE);
}
} else {
String message = "Warning: Could not find file "
+ file.getAbsolutePath() + " to copy.";
if (!failonerror) {
if (!quiet) {
log(message, Project.MSG_ERR);
}
} else {
throw new BuildException(message);
}
}
}
}
From the message string, there is an additional space in the filename /data/apps/packages/temp/jconn3-6.05_26312.jar.
This can also be reproduced using the following:
java.io.File file = new java.io.File("some_file_that_exists ");
System.out.println(file.exists()); // true on Windows, false on SunOS
The file.exists() returns true on Windows (automatically trimmed), but false on SunOS.

Resources