Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

how to specify multiple jar paths in web.config

 
Ranch Hand
Posts: 48
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

Can anybody tell how to specify multiple jar paths in web.config as per the example shown in link: https://azure.microsoft.com/en-in/documentation/articles/web-sites-java-custom-upload/


this is my config file :

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="%JAVA_HOME%\bin\java.exe"
arguments="-Djava.net.preferIPv4Stack=true -Dserver.port=%HTTP_PLATFORM_PORT% -jar "%HOME%\site\wwwroot\webapps\bookmark-service.jar" %HOME%\site\wwwroot\webapps\photo-service.jar" %HOME%\site\wwwroot\webapps\passport-service.jar"">
</httpPlatform>
</system.webServer>
</configuration>

but it is accepting only first jar not the other ones.

Thanks in advance
 
Ranch Hand
Posts: 261
15
Android Angular Framework Spring AngularJS Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, @shikha,
First, did you know you could post this as "XML Code"? There is a pulldown for code types in your format palette. Pulldown "Java" and you will see "XML" on the list. That would make it more readable.

Second, I look at what you have there, and I see (disclaimer: I know nothing of Asure, but I have used lots of XML), something odd about your text.



You have an arguments XML attribute. Its value is framed up with double-quotes. But within the value are more double-quotes. You might try doing a mixing, where the text within double quotes has single quotes around it. If your target tool balks at that, do just the opposite, and frame up the attribute value with singles, placing doubles between them. When you put double quotes between double quotes, the XML parser can get confused, and terminate the attribute value in the wrong place. Also, I recommend that if you do this mixing, do it consistently throughout the document, for readability.
 
L Foster
Ranch Hand
Posts: 261
15
Android Angular Framework Spring AngularJS Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BTW, note how your text looks now that it has been posted as Code/XML? It makes the problem very obvious.
 
shikha nirankari
Ranch Hand
Posts: 48
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Foster,
Thanks for you reply. That quotes I have corrected but still not able to run multiple deployable jar files.

corrected code is:

 
Ranch Hand
Posts: 385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please ignore my message below, and read Foster's replies.

Still wrong. Try:


<httpPlatform processPath="%JAVA_HOME%\bin\java.exe"
arguments="-Djava.net.preferIPv4Stack=true -Dserver.port=%HTTP_PLATFORM_PORT% -jar \"%HOME%\site\wwwroot\webapps\bookmark-service.jar;%HOME%\site\wwwroot\webapps\photo-service.jar;%HOME%\site\wwwroot\webapps\passport-service.jar;\"">
</httpPlatform>

 
L Foster
Ranch Hand
Posts: 261
15
Android Angular Framework Spring AngularJS Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Shikha,

I think what is needed is this. As I had written, we need to get away from enclosing a set of same-type quotes within another set. That is, it won't work to put "" inside of "". You wouldn't even want to see that an email. It would be like: "The generator produces 300W. The technician said, verbatim, "300W output". Okay?". If this is confusing to us, imagine some parser trying to read it. The parser would have to somehow (at a low level) look for a start-of quote, and then progress through the string looking for the end-of-quote. It only can detect symbols from Ascii/Unicode. So if it finds double-quote, it will look for the next double-quote.

@Ahmed,
Unfortunately, it is not enough to escape the inner double-quote, here. That could work if just making a Java quote-within-string, but not for handing something off to XML. XML does this by enclosing a different type of quote. If the outside has double, the inner has single, and vice-versa.



What could confuse one who is not used to doing this, is the fact that Java, and most other programming languages, has nesting of braces. Nesting of quotes does not work in XML. If you had to go three levels deep, it might be time to use an entity reference ("e;) instead. I think, however, if you don't have to do that, do not bother, because it will make this lengthy string even less readable.

I will post this, but I will also check the way the web page colors it. If the XML code section has a change in coloring after one of the quotes, I will adjust it accordingly and post it again. So, I will be leveraging something here, to check what I've done. I will post another message when it looks right to me. OK?
 
L Foster
Ranch Hand
Posts: 261
15
Android Angular Framework Spring AngularJS Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, it looks good to me. BTW, those inner single quotes are only there as far as I can tell, because %HOME% could have spaces in it. Had you stored your jars some place that guaranteed no spaces, you might not have needed those at all.

Unfortunately, I just noticed that my entity reference did not get transcribed correctly. Joys of HTML. that is ampersand-quote-semicolon. &quot; Also, dopey me, I forgot about preview.
 
Ahmed Bin S
Ranch Hand
Posts: 385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

L Foster wrote:
@Ahmed,
Unfortunately, it is not enough to escape the inner double-quote, here. That could work if just making a Java quote-within-string, but not for handing something off to XML. XML does this by enclosing a different type of quote. If the outside has double, the inner has single, and vice-versa.



Of course - you are absolutely correct. I don't know why I was thinking command line and ignoring this was inside an XML file - I can't even use the excuse I was recovering from a heavy night last night considering I am teetotal!

Thanks for correcting me, and I will strikethrough my response above to stop any potential confusion.
 
shikha nirankari
Ranch Hand
Posts: 48
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks All for your replies but I have tested all these but no +ve output.
 
PI day is 3.14 (march 14th) and is also einstein's birthday. And this is merely a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic