w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to configure build.sbt so that xsbt-web-plugin a creates war file without compression?
If you have your war file unzipped in a directory you can: zip -r -0 project.war project/ That should be zero compression. In case you don't see those options, this is my setup: [node@hip1 dev]$ zip -v Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license. This is Zip 3.0 (July 5th 2008), by Info-ZIP. Which, you could execute as a run task I believe, after the war is packaged. UPDATE 1 I believe this is the best way to achieve your needs: http://www.scala-sbt.org/release/docs/Detailed-Topics/Process val exitcode = "zip -r -0 project.war project/"! However, if you need to work from a specific directory (Please see Update 2 below): Modified this to execute within directory but place .war above directory. The path (2nd) argument should include the directory, so

Categories : Scala

Why would someone use jetty-maven-plugin vs embedded jetty
Typically the jetty-maven-plugin is used for development purposes, it lets you launch a webapp from the commandline, deploy into jetty and autoreload as class files or static content are changed. Embedded jetty is often used for integrating jetty as an http server or servlet engine into your application, often bypassing the concept of a war file all together and building out servlet contexts directly in your java code. Alternately people dislike the idea of distributing their application in war files or in a distribution form, so they use jetty in a Main class type format where they bootstrap the application and deploy their webapp transparently to the user, making it seem like there isn't even a war file in play at all. Embedded jetty is also often used in test cases either as a way of

Categories : Spring

Jetty Maven plugin - Put properties file in classpath
It was just a matter of configuration of the maven plugin <configuration> <scanIntervalSeconds>10</scanIntervalSeconds> <jettyXml>jetty/jetty.xml</jettyXml> <webApp> <extraClasspath>${basedir}/jetty/classpath</extraClasspath> </webApp> </configuration> to add a classpath folder to Jetty, it needs the extraClasspath folder in the webApp tag.

Categories : Misc

Config error Jetty
The jar containing the net.shibboleth.utilities.jetty7.DelegateToApplicationSslContextFactory class needs to be in the server classpath. Do this: Put the shibboleth jars into the ${jetty.home}/lib/ext directory. Test that they are present on the server classpath by executing the following command. $ java -jar start.jar --version Start Jetty like you did before.

Categories : Java

Make jetty display effective config?
Well, that depends on the config change you've done. Jetty will output things like the connector's ports, etc. in the stdout output. Another thing to mention is --dry-run: See: http://www.eclipse.org/jetty/documentation/current/advanced-jetty-start.html for details. Then you can enable jmx where you can verify lots of currently applied settings: http://www.eclipse.org/jetty/documentation/current/jmx-chapter.html web.xml stuff usually belongs to your application and not to jetty. However using jetty you can override the settings of your web.xml. Consult the documentation if you're interested in this. So really, you need to be more specific about what setting is not applied to your wishes. Edit: You can specify the mime settings in webdefault.xml that is shipped together with the

Categories : Java

Run-Jetty-Run (RJR) with Jetty 8 and Servlet 3.0 scanns all JAR files ignoring WebInfIncludeJarPattern in jetty-web.xml
Here is a workaround for speeding up Jetty 8 with Servlet 3.x. Create a file (jetty.xml) Open the RJR configuration Click on "Show advanced options" Additional Jetty.xml: The file (jetty.xml) must have these lines: <Configure id="Server" class="org.eclipse.jetty.server.Server"> <Get name="handler"> <Call name="setAttribute"> <Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg> <Arg>.*/mwa-web-.*.jar$</Arg> </Call> </Get> </Configure> Here, I'm telling Jetty that any file starting with mwa-web-* should be scanned for Servlet 3.x.

Categories : Eclipse

ERROR: Plugin 'EmailComposer' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml
Try this in config.xml: <feature name="EmailComposer"> <param name="ios-package" value="EmailComposer"/> </feature> The first "EmailComposer" is the name of this plugin in JS side, and the second "EmailComposer" is the class name of this plugin in native(Objective-C) side .

Categories : IOS

After reloading jetty-maven-plugin 503's
Solved by changing the jetty-maven-plugin to and the source. <groupId>org.eclipse.jetty</groupId> <jetty.plugin.version>9.0.4.v20130625</jetty.plugin.version>

Categories : Java

Filtering web.xml when using the jetty-maven-plugin?
Your configuration seems correct, but in my experience you may need also <filters> section. For example, my application has something similar to: <build> <plugins> <plugin> <artifactId>maven-war-plugin</artifactId> <version>${maven-war-plugin.version}</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> <webResources> <resource> <directory>src/main/webapp</directory> <filtering>true</filtering> <includes> <include>**/bm.js</include>

Categories : Java

Running jetty-maven-plugin in production
The jetty-maven-plugin is a development tool and is not recommended as a production deployment mechanism. Since you are deploying a war file then you should look to using the jetty distribution for production deployment, alternately you can look to just using jetty embedded to start up your webapp and then you are free to structure your own application in any form you like, be it a main() method or building your own start up mechanism or just using something like the maven appassembler plugin if you like. So while there may not be any known security or performance issue related to the jetty-maven-plugin for use in production deployment, neither it nor maven itself should be viewed as a replacement for standard production deployment practices.

Categories : Java

available security roles in elasticsearch-jetty plugin
I have just found that roles are defined inside of jetty-restrict-*.xml files, depending on which is used. For default jetty-restrict-all.xml file, only "readwrite" role is defined, but for jetty-restrict-write.xml role "admin" is also used. That is also the place where other roles can be defined.

Categories : Elasticsearch

how to public static content with jetty-maven-plugin?
I found the solution, here it is: <build> <plugins> <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>${jetty.version}</version> <configuration> <webApp> <contextPath>/</contextPath> <war>${basedir}/target/myapp.war</war> </webApp> <contextHandler implementation="org.eclipse.jetty.server.handler.ContextHandler"> <contextPath>/img</contextPath> <resourceBase>/home/neuquino/svn_co/FrameworkIMG/img</resourceBase> &l

Categories : Java

Unable to use VisualVM profiler with Maven Jetty plugin
The link you include in your question (https://visualvm.java.net/troubleshooting.html#xshare) has some advice: There is a known problem with dynamic attach which is used for profiling, it may cause target JVM to crash when class sharing is enabled. To start an application without class sharing, provide -Xshare:off argument to the java command starting the application.

Categories : Java

maven jetty plugin how to pass system variable
mvn jetty:run -DcommandLineName=value <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>6.1.10</version> <configuration> <systemProperties> <systemProperty> <name>arg1</name> <value>${commandLineName}</value> </systemProperty> </systemProperties> </configuration> </plugin> for more details see this

Categories : Maven

Maven Jetty Plugin OutOfMemoryError When Sharing Instance Between Two Web Apps
Add following jvm argument, if you get error regarding cannot allocate memory then try using lesser value (128 and 256) -XX:PermSize=256M -XX:MaxPermSize=512M Reference What is 'PermSize' in Java? -XX:MaxPermSize with or without -XX:PermSize

Categories : Java

override git config --system in .gitconfig user file ( git config --global )
If it is a system wide config, each user can override a config value in his/her global and local settings. But there is no easy way to "deactivate" a setting in a lower config file. Even set it to "" generally has unintended consequences. That very topic was discussed in April 2010. For instance, deactivating the send-email option: True, after thinking a bit about this using no value to unset is a horrible, horrible hack. git-send-email should be corrected to not only check that there is value from config or command line option, but also that it is sane (i.e. non-empty, or simply true-ish if we say that smtpuser = "0" is not something we need to worry about supporting). That would be true for any setting: the diff.c#run_diff_cmd() function will attempt to run an external diff i

Categories : GIT

mongoDB, could not read from config file -- config in different folder / Uninstall it?
Issue resolved with following steps (thanks to Karl Seguin's 'The Little MongoDB Book'). If you installed MongoDB via the download package from mongodb.org, you have to create create your own config file in /bin. Follow the instructions below (copied from Karl Seguin's book): download package unzip package Create a new text file in the bin subfolder named mongodb.config (if you have permission issues saving the file, save it first to your desktop then move file into folder). Add a single line to your mongodb.config: dbpath=PATH_TO_WHERE_YOU_WANT_TO_STORE_YOUR_DATABASE_FILES. For example, on Windows you might do dbpath=c:mongodbdata and on Linux you might do dbpath=/var/lib/ mongodb/data. Make sure the dbpath you specified exists Launch mongod with the --config /path/to/your/mongodb

Categories : Mongodb

Updating a config file adds additional config sections
Try changing the ConfigurationSaveMode from ConfigurationSaveMode.Minimal to ConfigurationSaveMode.Modified Modified only saves the properties that you have changed. From MSDN: Full Causes all properties to be written to the configuration file. This is useful mostly for creating information configuration files or moving configuration values from one machine to another. Minimal Causes only properties that differ from inherited values to be written to the configuration file. Modified Causes only modified properties to be written to the configuration file, even when the value is the same as the inherited value.

Categories : C#

Is there a way to unset a global git config section in a local git config file?
No Git config includes operate: as if its contents had been found at the location of the include directive ref That means you can't override/remove the include itself, as as soon as it's found the contents of the included file are injected/loaded. You can of course override the settings it contains in a more specific config file: # ~/.git.config.team [user] name = name Locally, via git config user.name nic # /some/project/.git/config [user] name = alias Yielding: /some/project $ git config user.name alias /some/project $

Categories : GIT

codeigniter custom config file calling config data
it seems you create form at wrong place, try to get main controller first: $CI =$ get_instence(); 'rules'=>'required|min_length['.$CI->config->item('min_password_length', 'ion_auth').']'

Categories : Codeigniter

Passing config file as argument to config parse module
start.py ... options.ConfigFile = args.filename ... options.py from ConfigReader import getConfigValue as getVal, ConfigFile def getTest(): Test = getVal('main', 'test') return Test ConfigReader.py import os import ConfigParser ConfigFile='default.cfg' def config(): cfg = ConfigParser.ConfigParser() for f in set(['default.cfg',ConfigFile]):

Categories : Python

Filter that exists in Tomcat doesn't in Jetty, how do I get Jetty to ignore it?
The obvious solution is to remove it from web.xml. This is the deployment descriptor after all, which exists precisely to customize the deployment of the app. If you really want to have a single war file deployable on both servers without being touched, then you could write your own filter that delegates to the catalina CorsFilter is available, and doesn't do anything if not available. You would test if the filter is available by doing Class.forName("org.apache.catalina.filters.CorsFilter") and see if you get an exception.

Categories : Java

ConfigurationManager reading wrong file - Web.config instead of App.config
App.config that resides in a Class Library project would not be loaded (at least not without extra effort), the only configuration loaded by the framework is the Client configuration (i.e the Web.config of a project that references and uses your Class Library). See this answer for possible solutions.

Categories : Asp Net Mvc

Maven plugin config inheritance
To an extent - yes - but I expect there are limits. Here's a cut-down example of some uses of inheritance. This shows re-use of project properties and dependency details. I am sure there are other examples. Parent POM: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.xxx</groupId> <artifactId>ArtefactID</artifactId> <version>1.2.3.4</version> <packaging>pom</packaging> <name>${project.artifactId} - ${project.version}</name> <modules> <mod

Categories : Java

cordova 3.0 plugin plist config
Yes, this does appear to be a bug in Cordova's handling of plugins' configuration settings for plist files. The duplicate array entries are annoying, but shouldn't break the build or affect the app. However the whitespace added to the NSMainNibFile* settings does cause XCode to fail to build with the NSInternalInconsistencyException error message you saw. Until this is fixed I am working around it using the following hook script - placed in .cordova/hooks/after_platform_add/patch_plist.sh: #!/bin/bash if pushd platforms/ios 2>/dev/null ; then # iOS-specific actions... # Patch *-Info.plist PROJNAME=$(echo *.xcodeproj|sed -e 's/..*//') sed -i '' '/<key>NSMainNibFile</key>/,/</string>/d' $PROJNAME/*-Info.plist sed -i '' '/<key>NSMainNibFile~ipa

Categories : IOS

Grails Plugin Config Excluded
You have a few options: define a configuration file that is not excluded in src/groovy. eg. MyPluginConfig.groovy and merge it in in the doWithSpring and onConfigChange closures in your plugin's definition class. This method is outlined in this blog post. use your plugin's _Install.groovy script to manually write your configuration into the host application's Config.groovy. This method is evident in the S2Quickstart script from the Spring Security Core plugin. Use the Plugin Config plugin. This plugin handles these situations very nicely.

Categories : Grails

Jenkins HelloWorld plugin does not persist config after restart
So this is problem with the hello world application. You need to define in your constructor that you want to load the configuration. public DescriptorImpl(){ load(); } That fixes the issue I was seeing with the configuration not being persisted.

Categories : Jenkins

Fetching values from app.config on plugin click in VS 2012 C#
I don't know of any built-in API that allows you to access config files at design time in Visual Studio in order to use them in T4 templates. You will have to open and read the .config file yourself: Get a reference to your project via the Visual Studio Automation Interface (EnvDTE) Find the Project Item that is the desired .config file Parse the .config file with the Xml Api of your choice You can also skip steps 1+2 and parse the .config file from its path, but that won't be very reusable. If you don't want to deep-dive into that Automation model and stuff, have a look at tangible's free T4 editor. It comes with a T4 Template gallery. There is a T4 file ready to be included in yours that provides you with the appSettings and connectionStrings from any .config file in your solution.

Categories : C#

CakePHP - How to change default plugin router config
If you want it to be applicable to all the plugin controllers/actions, you need to be a little more verbose. Try: Router::connect('/console/:controller/:action/*', array('plugin'=>'admin')); But if that's what you want, you're better off just renaming your "Admin" plugin to "Console". Re-routing all the plugin controllers and actions will make debugging not very fun. :)

Categories : PHP

How can I rollback Jenkins config when using the SCM sync configuration plugin?
Found it - the reload link is in the section in the config where you specify the git repo. It doesn't work for me because of a bug where it leaves out a part of the URL. If you are at http://myserver.org/jenkins/ then it will leave out the 'jenkins' bit and you get a 404. Manually adding it back in makes the url work.

Categories : GIT

Not able to config option on call back (jQuery Plugin)
Update I've just realized that you are setting the element to its current height, that doesn't seem to make much sense, however I'm not 100% sure about your intentions, so I've only updated the last two examples to only set the height in case the minHeight option is set. Another update Ok, I think I got it, you also want the option to be set to the current height in case the option wasn't set by the user. I've updated the examples again. Check whether the option is set and if that's the case, use it over the element height. You could simply use the || operator: return this.each(function() { options.minHeight = options.minHeight || $(this).outerHeight(); $(this).height(options.minHeight); alert(options.minHeight); }); minHeight will contain the minHeight option value in

Categories : Javascript

I don't see the Web.Debug.config and Web.Release.config files on my web.config after upgrading my project to VS2012
I found the answer in a post here: how to add files in web.config transformation process? In your "App Data" folder you'll find your publish profiles you created and can right click on them to add a config transform file.

Categories : Visual Studio 2012

Embedding Jetty 9 - where is jetty-all.jar?
I found it in maven repo with a different version: http://repo1.maven.org/maven2/org/eclipse/jetty/aggregate/jetty-all/9.0.4.v20130625/jetty-all-9.0.4.v20130625.jar The Search Engine for The Central Repository may helps you find jar files even you don't use maven

Categories : Java

Rails assets pipeline difference between using config file and using manifest file
When you want include in HTML headers only application.css, it is the same. But if you want to use only foo.css (without application.css and bar.css) in some page, you have to do it in config.assets, to ensure, that there will be foo.css asset standalone compiled.

Categories : Ruby On Rails

linux Bash - read contents of file , store them in a variable and create network config file
I tried yesterday and I am very close to the solution. Researching the internet , I made a perl script and was able to create multiple interface by extracting data from csv file. But there is small issue I see and not able to figure out why an extra character is coming in the file. Following is the code: #!/usr/bin/perl use strict; use warnings; sub main { # Note: this could be a full file path my $filename = "file1.csv"; open(INPUT, $filename) or die "Cannot open $filename"; # Read the header line. #my $line = <INPUT>; my $line; # Read the lines one by one. while($line = <INPUT>) { chomp($line); # Display the header, just to check things are working.

Categories : Linux

How to switch from a hardcoded static config file to a .properties file?
Load the properties from the file using Properties.load(...) and assign the constants from those properties. class Constants{ public static final String name1; public static final String name2; public static final Integer value3; static{ Properties p = new Properties(); try ( FileInputStream stream = new FileInputStream( new File("path/to/file.properties") )) { p.load( stream ); }catch( Exception e ){ //handle exceptions } name1 = p.getProperty( "name1" ); name2 = p.getProperty( "name2" ); value3 = Integer.valueOf( p.getProperty( "value3" ) ); } Note that this is just a quick and dirty solution and makes a lot of assumptions. It would be better to handle the individual exceptions and you'd also have to handle the NumberFormat

Categories : Java

Setting file directory in appSettings of an app.config file
I'm not sure if I understand correctly what you want. But personnaly if I have a file path I would put it in a key value in my web.config: <appSettings> <add key="UploadPath" value="C: emp" /> </appSettings> I normally Have a ConfigurationManager class that have each app setting value into this class like that: public class ConfigurationManager { public string UploadPath { get { return System.Configuration.ConfigurationManager.AppSettings["UploadPath"]; } } } It's also very useful when you have unit test so you can mock your class. I don't use static class because I'm using dependency injection.. but if you are not and you don't have unit test, you can set your class as static

Categories : C#

setting xml file path in web.config file
add this in your configuration section : <appSettings> <add key="xmlPath" value="C:/Users/Jonesy" /> </appSettings> then in the code : string path = ConfigurationManager.AppSettings["xmlPath"]; you may need to add a reference to System.Configuration.

Categories : C#

vbs and csv config file
Use this instead of setTimeOut: Set sh = CreateObject("WScript.Shell") Set oStream = oFSO.OpenTextFile( INPUT_FILE ) oStream.SkipLine Do Until oStream.AtEndOfStream ... sh.Run Chr(34) & soft & Chr(34), 0, False sh.Run "ping -n " & (1+Delai/1000) & " 127.0.0.1", 0, True Loop Note: Using Execute for assigning values from one array (aData) to variable names from another array (aVars) is really, really ugly and makes your code unnecessarily difficult to read. I strongly recommend to either use aData directly or to use "normal" variable assignments instead: Dim Horloge, Nom, Delai, Soft, Resultat ... Do While oStream.AtEndOfStream = False aData = Split(oStream.ReadLine, ",") Horloge = aData(0) Nom = aData(1) Delai = aData(2) Soft = aData(3) Re

Categories : Csv

What is the correct way of using a config file?
Like you wrote, usually a properties-file is used for config. It comes in the format of: key1=value1 key2=value2 ... It's really not complicated to use - you can practically pick it up in less than 5 mins. Here's a nice example for using a properties-file. UPDATE In case you have to use an XML file - I would use any XML parser (JAXB/XStream...) and create a hashMap that'll hold the pairs of key/value - same like it's done with properties-file.

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.