Search Results

Search found 2650 results on 106 pages for 'pm 77 1'.

Page 96/106 | < Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >

  • Passing arguments to commandline with directories having spaces

    - by superstar
    Hi guys, I am making a system call from perl for ContentCheck.pl and passing parameters with directories (having spaces). So I pass them in quotes, but they are not being picked up in the ContentCheck.pl file Random.pm my $call = "$perlExe $contentcheck -t $target_path -b $base_path -o $output_path -s $size_threshold"; print "\ncall: ".$call."\n"; system($call); Contentcheck.pl use vars qw($opt_t $opt_b $opt_o $opt_n $opt_s $opt_h); # initialize getopts('t:b:o:n:s:h') or do{ print "*** Error: Invalid command line option. Use option -h for help.\a\n"; exit 1}; if ($opt_h) {print $UsagePage; exit; } my $tar; if ($opt_t) {$tar=$opt_t; print "\ntarget ".$tar."\n";} else { print " in target"; print "*** Error: Invalid command line option. Use option -h for help.\a\n"; exit 1;} my $base; if ($opt_b) {$base=$opt_b;} else { print "\nin base\n"; print "*** Error: Invalid command line option. Use option -h for help.\a\n"; exit 1;} This is the output in the commandline call: D:\tools\PacketCreationTool/bin/perl/winx64/bin/perl.exe D:/tools/PacketCr eationTool/scripts/ContentCheck.pl -t "C:/Documents and Settings/pkkonath/Deskto p/saved/myMockName.TGZ" -b "input file/myMockName.TGZ" -o myMockName.validate -s 10 target C:/Documents in base *** Error: Invalid command line option. Use option -h for help. Any suggestions are welcome! Thanks.

    Read the article

  • log4js ConsoleAppender initialization

    - by perrierism
    I'm wondering if anyone happens to have some experience using Log4js? It seems its normal ConsoleAppender isn't always ready to use immediately after it's added to a logger object... If I have two sequential script tags in a document like: //Initialize logger <script type="text/javascript"> var logger = new Log4js.getLogger("JSLOG"); logger.addAppender(new Log4js.ConsoleAppender(logger, false)); logger.setLevel(Log4js.Level.INFO); </script> //Use logger <script type="text/javascript"> logger.info('Test test'); </script> ... It causes the console pop-up (pop-up window) to appear with an error message on page load: 12:58:23 PM WARN Log4js - Could not run the listener function () { return fn.apply(object, arguments); }. TypeError: this.outputElement is null The console is still initialised, it's there afterward, but for just that first logger call it doesn't seem to be there fully. If I make the first logger call setTimeout("logger.info('test test')", 1000), it doesn't have the error. So it's like it's not ready immediately. Anyone see this before or know what a workaround might be? Cheers

    Read the article

  • Why do I get an error when inserting rows with Net::Cassandra::Easy and Cassandra 0.5x?

    - by knorv
    When using the Perl module Net::Cassandra::Easy to interface with Cassandra I use the following code to read colums col[123] from rows row[123] in the column-family Standard1: my $cassandra = Net::Cassandra::Easy->new(keyspace => 'Keyspace1', server => 'localhost'); $cassandra->connect(); my $result = $cassandra->get(['row1', 'row2', 'row3'], family => 'Standard1', byname => ['col1', 'col2', 'col3']); This works as expected. However, when trying to insert row row1 with .. $result = $cassandra->mutate(['row1'], family => 'Standard1', insertions => { "col1" => "Value to set." }); .. I get the error message Can't use string ("0") as a SCALAR ref while "strict refs" in use at .../Net/GenThrift/Thrift/BinaryProtocol.pm line 376. What am I doing wrong?

    Read the article

  • DBD::CSV: Problem with file-name-extensions

    - by sid_com
    In this script I have problems with file-name-extensions: if I use /home/mm/test_x it works, with file named /home/mm/test_x.csv it doesn't: #!/usr/bin/env perl use warnings; use strict; use 5.012; use DBI; my $table_1 = '/home/mm/test_1.csv'; my $table_2 = '/home/mm/test_2.csv'; #$table_1 = '/home/mm/test_1'; #$table_2 = '/home/mm/test_2'; my $dbh = DBI->connect( "DBI:CSV:" ); $dbh->{RaiseError} = 1; $table_1 = $dbh->quote_identifier( $table_1 ); $table_2 = $dbh->quote_identifier( $table_2 ); my $sth = $dbh->prepare( "SELECT a.id, a.name, b.city FROM $table_1 AS a NATURAL JOIN $table_2 AS b" ); $sth->execute; $sth->dump_results; $dbh->disconnect; Output with file-name-extention: DBD::CSV::st execute failed: Execution ERROR: No such column '"/home/mm/test_1.csv".id' called from /usr/local/lib/perl5/site_perl/5.12.0/x86_64-linux/DBD/File.pm at 570. Output without file-name-extension: '1', 'Brown', 'Laramie' '2', 'Smith', 'Watertown' 2 rows Is this a bug?

    Read the article

  • Problem storing a hash in DB using Storable::nfreeze in Perl

    - by Sam
    I want to insert a hash in the db using Storable::nfreeze but the data is not inserted properly. My code is as follows: %rec=(); $rec{'name'} = 'my name'; $rec{'address'} = 'my address'; my $order1 = new Order(); $order1->set_session(\%rec); $self->createOrder($order1); sub createOrder { my $self = $_[0]; my $order = $_[1]; # Retrieve the fields to insert into the database. my $st = $dbh->prepare("insert into order (session,.......) values(?,........)"); my $session = %{$order->get_session()}; $st->execute(&Storable::nfreeze(\%session),.....); $st->finish(); } sub getOrder { ... my $session = &Storable::thaw( $ref->{'session'} ); ..... } The thaw is working fine because I tested it withe some rows that have been inserted correctly, but when I try to get a row that was inserted using the createOrder subroutine, I get an error saying: Storable binary image v36.65 more recent than I am (v2.7) at blib/lib/Storable.pm (autosplit into blib/lib/auto/Storable/thaw.al) line 415 The error comes from the line that have thaw. The nfreeze did not store the hash properly. Can someone point me to what I'm doing wrong in the createOrder subroutine? I know the module version have nothing to do with the problem.

    Read the article

  • Mahout - Error when try out wikipedia exmaples

    - by Li'
    Note this post is similar to Caused by: java.lang.ClassNotFoundException: classpath but different error message. When I try to run Wikipedia Bayes Example from https://cwiki.apache.org/confluence/display/MAHOUT/Wikipedia+Bayes+Example When I ran the following command : lis-macbook-pro:mahout-distribution-0.8 Li$ mahout wikipediaXMLSplitter -d examples/temp/enwiki-latest-pages-articles10.xml -o wikipedia/chunks -c 64 I got error message: MAHOUT_LOCAL is set, so we don't add HADOOP_CONF_DIR to classpath. MAHOUT_LOCAL is set, running locally SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/Users/Li/File/Java/mahout-distribution-0.8/examples/target/mahout-examples-0.8-job.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/Users/Li/File/Java/mahout-distribution-0.8/examples/target/dependency/slf4j-jcl-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.JCLLoggerFactory] Oct 21, 2013 4:25:47 PM org.slf4j.impl.JCLLoggerAdapter warn WARNING: Unable to add class: wikipediaXMLSplitter java.lang.ClassNotFoundException: wikipediaXMLSplitter at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:171) at org.apache.mahout.driver.MahoutDriver.addClass(MahoutDriver.java:236) at org.apache.mahout.driver.MahoutDriver.main(MahoutDriver.java:127) I am using Hadoop 1.2 and Mahout 0.8. mahout-distribution-0.8/bin has been added to $PATH. $MAHOUT_LOCAL is set to "True", so it runs locally. I dont know why I got "Unable to add class: wikipediaXMLSplitter"

    Read the article

  • "hour" int taken from NSDate not behaving as expected at midnight??

    - by Eric
    I feel like I've lost my mind. Can someone tell me what's going on here? Also, I'm sure there is a better way to do what I'm trying to do, but I'm not interested in that now. I'd just like to solve the mystery of why my ints are not responding to logic as expected. // Set "At: " field close to current time NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"HH"]; int hour = [[dateFormatter stringFromDate:[NSDate date]] intValue]; [dateFormatter setDateFormat:@"mm"]; int minute = [[dateFormatter stringFromDate:[NSDate date]] intValue]; NSLog(@"currently %i:%i",hour, minute); if(hour >= 12){ // convert to AM/PM selectedMeridiem = 1; if(hour != 12){ hour = hour - 12; } } else{ selectedMeridiem = 0; } selectedHour = hour - 1; if(selectedHour <= 0){ selectedHour = 11; } When I debug the above code with my clock set to 12:XX AM, the integer "hour" returned is 0. But then any if statements with the condition if(hour == 0) are not evaluated. Likewise, this would not be evaluated either: if(hour < 1). The code above puts the hour int into another int, selectedHour (don't worry about why I'm doing this for now), but selectedHour suffers from the same weird behavior; the if(selectedHour <= 0) line is never evaluated. Am I going crazy, or am I just an idiot? Maybe there's some behavior of 0 integers that I'm not aware of. All of my code runs fine as long as it's not 12:XX AM.

    Read the article

  • How do i pass arbitary date format from C# to sql backend

    - by Jims
    I have a datetime field for the transaction date in the back end. So I am passing that date from front C#.net, in the below format: 2011-01-01 12:17:51.967 to do this I have written: presentation layer: string date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture); PropertyClass prp=new PropertyClass(); Prp.TransDate=Convert.ToDateTime(date); PropertyClass structure: Public class property { private DateTime transdate; public DateTime TransDate { get { return transdate; } set { transdate = value; } } } From DAL layer passing the TransactionDate like this: Cmd.Parameters.AddWithValue("@TranSactionDate”, SqlDbType.DateTime).value=propertyobj.TransDate; While debugging from presntation layer: string date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture); in this I am getting correct expected date format, but when debugs goes to this line Prp.TransDate=Convert.ToDateTime(date); again date format changing to 1/1/2011. But my backend sql datefield wants the date paramter 2011-01-01 12:17:51.967 in this format otherwise throwing exception invalid date format. Note: While passing date as string without converting to datetime getting exceptions like: System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. at System.Data.SqlTypes.SqlDateTime.FromTimeSpan(TimeSpan value) at System.Data.SqlTypes.SqlDateTime.FromDateTime(DateTime value) at System.Data.SqlTypes.SqlDateTime..ctor(DateTime value) at System.Data.SqlClient.MetaType.FromDateTime(DateTime dateTime, Byte cb) at System.Data.SqlClient.TdsParser.WriteValue(Object value, MetaType type, Byte scale, Int32 actualLength, Int32 encodingByteSize, Int32 offset, TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.TdsExecuteRPC(_SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc)

    Read the article

  • Where do I put jar files in Tomcat 6?

    - by Simon
    I am having trouble getting my JSP page to load a Java class which is in a jar file. The message I get appears to indicate a class not found exception: Jan 6, 2011 12:21:45 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 72 in the jsp file: /xmlloader.jsp FactArray cannot be resolved to a type 69: sourceType = "1"; 70: } 71: 72: FactArray fa = new FactArray(); 73: Fact f; 74: 75: /***********************/ The Type FactArray is one of my classes in a package com.mypackage.fact.FactArray which exists in myjar.jar. myjar.jar is a separate Java project (using NetBeans, but I don't think that's relevant). I include the package in my JSP as follows: <%@ page import="com.mypackage.fact.*" %> I deploy my web site and JSPs into Tomcat 6 as a WAR file. I include myjar.jar in that WAR in WEB-INF/lib but that doesn't work. I tried putting myjar.jar in my tomcat/lib folder, but that doesn't work either. I have bounced the server several times between changes. I have read a whole bunch of questions on here which say "put it in WEB-INF/lib" but that isn't working, so I'm asking my own question. Where do I need to put common JAR files so they get picked up by Tomcat?

    Read the article

  • Perl Module from relative path not working in IIS6

    - by Laramie
    Disclaimer: I am not a PERL developer and am learning by the seat of my pants. I am using a Perl module called from a CGI scipt in IIS 6 that is bombing. The identical folder structure on an XP machine (IIS 5.1) works fantastic. If I remove the module loading command at line 9, it will print "about to load" and "ok", but When I try to run use Language::Guess; I receive The specified CGI application misbehaved by not returning a complete set of HTTP headers. in the browser. The folder structure is /cgi-bin/test.pl /PerlModules/Language/Guess.pm I have tried adjusting the file/folder permissions and have reviewed my IIS configuration time and again. It runs fine from the command line on the IIS machine or if I copy the module into \Perl\site\lib, but I don't have permission to load modules on the shared server this script is destined for. Am I missing something simple? Here is test.pl use strict; use CGI ':standard'; print header("text/html"); use lib "..\\PerlModules\\"; print "about to load<br/>"; #bombs here use Language::Guess; print "ok"

    Read the article

  • Characters in usernames that cause trouble

    - by acidzombie24
    I am testing out security and reliability issues on my site. I have made \n and \r illegal. I created a user with null in the name which caused my PM system to not message the user. However \b worked and \t didnt allow copy/paste to work correctly. The browser (firefox which i am testing with) copied the tab as a single space causing the name not to be the same thus not recognizing the username. Since i cant copy paste easily i'll probably disallow it. \f works as well although i do see a symbol in the title but nowhere else because of the \f. What else should i try? It appears 0-31 127-159 (i dont understand this range) are illegal. What characters in legal range might i want to disallow? I heard there was a 0 width character space. That may be something i want to disallow? What else is there?

    Read the article

  • Why "Not an ARRAY reference" error?

    - by Sandra Schlichting
    I have this script #!/usr/bin/perl use strict; use warnings; use yy; my $data = [ ["aax", "ert", "ddd"], ["asx", "eer", "kkk"], ["xkk", "fff", "lll"], ["xxj", "vtt", "lle"], ]; use Test::More tests => 4; is(yy::type1_to_type2(\$data, 'aax'), 'ert'); is(yy::type1_to_type3(\$data, 'asx'), 'kkk'); is(yy::type2_to_type3(\$data, 'fff'), 'lll'); is(yy::type3_to_type1(\$data, 'lle'), 'xxj'); which uses this module package yy; sub typeX_to_typeY { my ($x, $y, $data, $str) = @_; foreach (@$data) { if ($_->[$x - 1] eq $str) { return $_->[$y - 1]; } } return; } sub type1_to_type2 { typeX_to_typeY(1, 2, @_) } sub type1_to_type3 { typeX_to_typeY(1, 3, @_) } sub type2_to_type1 { typeX_to_typeY(2, 1, @_) } sub type2_to_type3 { typeX_to_typeY(2, 3, @_) } sub type3_to_type1 { typeX_to_typeY(3, 1, @_) } sub type3_to_type2 { typeX_to_typeY(3, 2, @_) } 1; and gives this error Not an ARRAY reference at yy.pm line 6. # Looks like your test died before it could output anything. The line it complains about is foreach (@$data) { Isn't this the way to pass an array reference? What am I doing wrong?

    Read the article

  • problem storing a hash in DB using Storage::nfreeze Perl

    - by Sam
    Hello, I want to insert a hash in the db using Storage::nfreeze but the data is not inserted properly. the code is as follow: %rec=(); $rec{'name'} = 'my name'; $rec{'address'} = 'my address'; my $order1 = new Order(); $order1->set_session(\%rec); $self->createOrder($order1); sub createOrder { my $self = $_[0]; my $order = $_[1]; # Retrieve the fields to insert into the database. my $st = $dbh->prepare("insert into order (session,.......) values(?,........)"); my $session = %{$order->get_session()}; $st->execute(&Storable::nfreeze(\%session),.....); $st->finish(); } sub getOrder { ... my $session = &Storable::thaw( $ref->{'session'} ); ..... } the thaw is working fine because I tested it withe some rows that have been inserted correctly. but when I try to get a row that was inserted using the createOrder subroutine, I get an error saying" Storable binary image v36.65 more recent than I am (v2.7) at blib/lib/Storable.pm (autosplit into blib/lib/auto/Storable/thaw.al) line 415 the error comes from the line that have thaw. the nfreeze did not store the hash properly. Can someone point me to what i m doing wrong in the createOrder subroutine? Thanks in advance. I know the module version have nothing to do with the problem.

    Read the article

  • parsing xml using dom4j

    - by D3GAN
    My XML structure is like this: <rss> <channel> <yweather:location city="Paris" region="" country="France"/> <yweather:units temperature="C" distance="km" pressure="mb" speed="km/h"/> <yweather:wind chill="-1" direction="40" speed="11.27"/> <yweather:atmosphere humidity="87" visibility="9.99" pressure="1015.92" rising="0"/> <yweather:astronomy sunrise="8:30 am" sunset="4:54 pm"/> </channel> </rss> when I tried to parse it using dom4j SAXReader xmlReader = createXmlReader(); Document doc = null; doc = xmlReader.read( inputStream );//inputStream is input of function log.info(doc.valueOf("/rss/channel/yweather:location/@city")); private SAXReader createXmlReader() { Map<String,String> uris = new HashMap<String,String>(); uris.put( "yweather", "http://xml.weather.yahoo.com/ns/rss/1.0" ); uris.put( "geo", "http://www.w3.org/2003/01/geo/wgs84_pos#" ); DocumentFactory factory = new DocumentFactory(); factory.setXPathNamespaceURIs( uris ); SAXReader xmlReader = new SAXReader(); xmlReader.setDocumentFactory( factory ); return xmlReader; } But I got nothing in cmd but when I print doc.asXML(), my XML structure print correctly!

    Read the article

  • How can I prevent/make it hard to download my flash video?

    - by Billy
    I want to at least prevent normal users to download my flash video. What's the best way to do it? Create a httphandler, add a token (e.g. timeid), set the cache control to no-cache so that only the users with correct token can view the correct video. Is that feasible? It is the requirement from client that the video should not be downloaded by users and should be watched only in the particular website. I want to know if this works: http://www.somesite.com/video.swf?time=1248319067 Server will generate a token(time in the above example) so that user can only have one request to this link. If the user wants to watch the video again, he needs to go to our website to get the token again. Is this okay to prevent novices from downloading? I can't download this flash video by the downloadHelper firefox plugin: http://news.bbc.co.uk/2/hi/americas/8164177.stm Updated (13:49 pm 2009/07/23): The above file can be downloaded using some video download software. The video files of following Chinese sites are well protected (I can't download it using many video download software): http://programme.tvb.com/drama/abrideforaride/video/ Do you know how it is done?

    Read the article

  • Is this a bug in plist or Xcode?

    - by Pedro
    G'day All If you create a date item in the plist editor of Xcode or Apple's standalone plist editor you get something of the form <date>2010-05-29T10:30:00Z</date> which is a nice well formed ISO date at UTC (indicated by the "Z"). Because I'm in timezone UTC +10 when that's read into my app & then displayed I get 8:30 PM out, still good. However if that is a time in my timezone it should be <date>2010-05-29T10:30:00+10</date> (replacing "Z" with my timezone offset). All of my attempts at reading such dates into my iPhone app have had the plist rejected as if it is malformed & editing a plist with such a date in Apple's editors changed the "+10" to "Z" without adjusting the time. Do others think I'm correct in thinking this is a bug in either plist or Xcode? My feeling is that the implementation of ISO date & time in plist is incomplete. Cheers, Pedro :)

    Read the article

  • java.lang.ExceptionInInitializerError Exception when creating Application Context in Spring

    - by cyotee
    I am practicing with Spring, and am getting a java.lang.ExceptionInInitializerError exception when I try to instantiate the context. The Exception appears below, with my code following it. I have simplified my experiment from before. The Exception Oct 17, 2012 5:54:22 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@570c16b7: startup date [Wed Oct 17 17:54:22 CDT 2012]; root of context hierarchy Exception in thread "main" java.lang.ExceptionInInitializerError at org.springframework.context.support.AbstractRefreshableApplicationContext.createBeanFactory(AbstractRefreshableApplicationContext.java:195) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:128) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:535) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:449) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at helloworld.HelloWorldTest.main(HelloWorldTest.java:13) Caused by: java.lang.NullPointerException at org.springframework.beans.factory.support.DefaultListableBeanFactory.<clinit>(DefaultListableBeanFactory.java:105) ... 7 more My configuration XML <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://www.springframework.org/schema/c" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"> <bean id="messageContainer" class="helloworld.MessageContainer"> <property name="message" value="Hello World"> </property> </bean> <bean id="messageOutputService" class="helloworld.MessageOutputService"> </bean> My test class. package helloworld; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class HelloWorldTest { /** * @param args */ public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("HelloWorldTest-context.xml"); MessageContainer message = context.getBean(MessageContainer.class); MessageOutputService service = context.getBean(MessageOutputService.class); service.outputMessageToConsole(message); } }

    Read the article

  • Google App Engine Java app couldn't find javac ?

    - by Frank
    I'm learning to use Google App Engine, I installed it in Netbeans, the project works, but when I clicked on "Deploy To Google App Engine", I got the following error : Beginning server interaction for ... 0% Creating staging directory 5% Scanning for jsp files. 8% Compiling jsp files. 11% Compiling java files. Error Details: Apr 20, 2010 3:51:23 PM org.apache.jasper.JspC processFile INFO: Built File: \PayPal_Monitor.jsp java.lang.IllegalStateException: cannot find javac executable based on java.home, tried "C:\Program Files (x86)\Java\jre6\bin\javac.exe" and "C:\Program Files (x86)\Java\bin\javac.exe" Unable to update app: cannot find javac executable based on java.home, tried "C:\Program Files (x86)\Java\jre6\bin\javac.exe" and "C:\Program Files (x86)\Java\bin\javac.exe" Please see the logs [C:\Users\NM\AppData\Local\Temp\appcfg3946701335172983337.log] for further information. The file "javac.exe" is in : C:\Program Files (x86)\Java\jdk1.6.0_18\bin How can I add it to "java.home" ? I'm using Win Vista, and I tried to add it from "System - Environment Variables", but there is no "java.home" in there. Where can I find it ? Frank

    Read the article

  • How do I post a .wav file from CS5 Flash, AS3 to a Java servlet?

    - by Muostar
    Hi, I am trying to send a byteArray from my .fla to my running tomcat server integrated in Eclipse. From flash I am using the following code: var loader:URLLoader = new URLLoader(); var header:URLRequestHeader = new URLRequestHeader("audio/wav", "application/octet-stream"); var request:URLRequest = new URLRequest("http://localhost:8080/pdp/Server?wav=" + tableID); request.requestHeaders.push(header); request.method = URLRequestMethod.POST; request.data = file;//wav; loader.load(request); And my java servlet looks as follows: try{ int readBytes = -1; int lengthOfBuffer = request.getContentLength(); InputStream input = request.getInputStream(); byte[] buffer = new byte[lengthOfBuffer]; ByteArrayOutputStream output = new ByteArrayOutputStream(lengthOfBuffer); while((readBytes = input.read(buffer, 0, lengthOfBuffer)) != -1) { output.write(buffer, 0, readBytes); } byte[] finalOutput = output.toByteArray(); input.close(); FileOutputStream fos = new FileOutputStream(getServletContext().getRealPath(""+"/temp/"+wav+".wav")); fos.write(finalOutput); fos.close(); When i run the flash .swf file and send the bytearray to the server, I receive following in the server's console window:: (loads of loads of Chinese symbols) May 20, 2010 7:04:57 PM org.apache.tomcat.util.http.Parameters processParameters WARNING: Parameters: Character decoding failed. Parameter '? (loads of loads of Chinese symbols) and then looping this for a long time. It is like I recieve the bytes but not encoding/decoding them correctly. What can I do?

    Read the article

  • In this example, would Customer or AccountInfo properly be the entity group parent?

    - by Badhu Seral
    In this example, the Google App Engine documentation makes the Customer the entity group parent of the AccountInfo entity. Wouldn't AccountInfo encapsulate Customer rather than the other way around? Normally I would think of an AccountInfo class as including all of the information about the Customer. import javax.jdo.annotations.IdGeneratorStrategy; import javax.jdo.annotations.PersistenceCapable; import javax.jdo.annotations.Persistent; import javax.jdo.annotations.PrimaryKey; import com.google.appengine.api.datastore.Key; import com.google.appengine.api.datastore.KeyFactory; @PersistenceCapable public class AccountInfo { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; public void setKey(Key key) { this.key = key; } } // ... KeyFactory.Builder keyBuilder = new KeyFactory.Builder(Customer.class.getSimpleName(), "custid985135"); keyBuilder.addChild(AccountInfo.class.getSimpleName(), "acctidX142516"); Key key = keyBuilder.getKey(); AccountInfo acct = new AccountInfo(); acct.setKey(key); pm.makePersistent(acct);

    Read the article

  • How can a SVN::Error callback identify the context from which it was called

    - by Colin Fine
    I've written some fairly extensive Perl modules and scripts using the Perl bindings SVN::Client etc. Since the calls to SVN::Client are all deep in a module, I have overridden the default error handling. So far I have done so by setting $SVN::Error::handler = undef as described in [1], but this makes the individual calls a bit messy because you have to remember to make each call to SVN::Client in list context and test the first value for errors. I would like to switch to using an error handler I would write; but $SVN::Error::handler is global, so I can't see any way that my callback can determine where the error came from, and what object to set an error code in. I wondered if I could use a pool for this purpose: so far I have ignored pools as irrelevant to working in Perl, but if I call a SVN::Client method with a pool I have created, will any SVN::Error object be created in the same pool? Has anybody any knowledge or experience which bears on this? [1]: http://search.cpan.org/~mschwern/Alien-SVN-1.4.6.0/src/subversion/subversion/bindings/swig/perl/native/Core.pm#svn_error_t_-_SVN::Error SVN::Core POD

    Read the article

  • How can I determine PerlLogHandler performance impact?

    - by Timmy
    I want to create a custom Apache2 log handler, and the template that is found on the apache site is: #file:MyApache2/LogPerUser.pm #--------------------------- package MyApache2::LogPerUser; use strict; use warnings; use Apache2::RequestRec (); use Apache2::Connection (); use Fcntl qw(:flock); use File::Spec::Functions qw(catfile); use Apache2::Const -compile => qw(OK DECLINED); sub handler { my $r = shift; my ($username) = $r->uri =~ m|^/~([^/]+)|; return Apache2::Const::DECLINED unless defined $username; my $entry = sprintf qq(%s [%s] "%s" %d %d\n), $r->connection->remote_ip, scalar(localtime), $r->uri, $r->status, $r->bytes_sent; my $log_path = catfile Apache2::ServerUtil::server_root, "logs", "$username.log"; open my $fh, ">>$log_path" or die "can't open $log_path: $!"; flock $fh, LOCK_EX; print $fh $entry; close $fh; return Apache2::Const::OK; } 1; What is the performance cost of the flocks? Is this logging process done in parallel, or in serial with the HTTP request? In parallel the performance would not matter as much, but I wouldn't want the user to wait another split second to add something like this.

    Read the article

  • Hibernate saveorUpdate method problem

    - by umesh awasthi
    Hi all, i am trying to work on with Hibernate (Database side for first time) and some how struck in choosing best possible way to use saveOrUpdate or Save.Update i have a destination POJO class and its other attributes which needs to be updated along with the Destination entity. i am getting an XML file to be imported and i am using the following code to update/save the destination entity along with its attribute classes. try{ getSessionFactory().getCurrentSession().beginTransaction(); getSessionFactory().getCurrentSession().saveOrUpdate(entity); getSessionFactory().getCurrentSession().getTransaction().commit(); } catch(Exception e){ getSessionFactory().getCurrentSession().getTransaction().rollback(); } finally{ getSessionFactory().close(); } everything is working fine untill i am using the same session instance.but later on when i am using the same XML file to update the destination PO for certain attributes it giving me the following error. SEVERE: Duplicate entry 'MNLI' for key 'DESTINATIONID' 9 Jan, 2011 4:58:11 PM org.hibernate.event.def.AbstractFlushingEventListener performExecutions SEVERE: Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:114) at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:109) at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:244) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2242) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2678) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79) i am using UUID as primary key for the Destination table and in destination table i have a destination id which is unique.but i can understand that in the secodn case hibernate is not able to find if there is already an entry for the same destination in the DB and trying to execute insert statement rather than update. one possible solution is i can user destinationid to check if there is already a destination inplace with the given id and based on the results i can issue save or update command. my question is can this be achieve by any other good way..? Thanks in advance

    Read the article

  • Intermittent Issue Writing to Google Appengine Datastore

    - by user242153
    Hi, I have a functioning app and recently have had intermittent problems writing to the datastore. I did not make any relevant code changes, however in the last few days my attempts to write to the datastore sometimes work and sometimes don't. I am trying to save an object that is in a many to one relationship with an existing persisted parent. So, the logic works like this: 1) Parent pulled from the datastore 2) Child created / instantiated using constructor 3) Parent.addSingleChild(child); // the "addSingleChild" method just adds the object argument to the collection of children 4) child.setParent(Parent); // sets the Parent object to the parent field I am using transactions as explained in the documentation ending with "finally {if (tx.isActive()) {tx.rollback(); } }" When the servlet is called, the parent is called from the datastore and the child object is created and added to the many to one mapping to the pre-existing parent. The child should automatically be persisted, since the parent is already persistent, and the child is added to the collection of children that map to the parent. And it worked this way in the past. However, to be sure, i did add a pm.makePersistent(child). Doesn't seem to help, still have the intermittent problem. Any suggestions would be appreciated, and if you need to see the actual code I can post. Thanks

    Read the article

  • How do you use FastInfoset with JAXWS?

    - by Chris Kessel
    I've got code that looks like it should be correct based on what I can find, but the spewed output doesn't indicate that it's using FastInfoset. My understanding is the Accept should indicate it can accept Fastinfoset and the response would actually use it, meaning it's not text/xml as the response type. Any idea what I'm doing wrong? I've scoured with Google and I'm having a hard time finding much detail on how to use FastInfoset at all. JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.getInInterceptors().add(new LoggingInInterceptor()); factory.getOutInterceptors().add(new LoggingOutInterceptor()); factory.setServiceClass( C360Server.class); factory.setAddress("http://localhost:8501/cxfcontroller/cl_v5"); C360Server client = (C360Server)factory.create(); ((BindingProvider)client).getRequestContext().put( "com.sun.xml.ws.client.ContentNegotiation", "optimistic"); C360Request requestTrans = new C360Request(); ... code to fill in the request ... C360Response response = client.findContacts( requestTrans ); The logging doesn't seem to indicate FastInfoset is even attempted though: INFO: Outbound Message --------------------------- ID: 1 Address: http://localhost:8501/cxfcontroller/cl_v5 Encoding: UTF-8 Content-Type: text/xml Headers: {SOAPAction=[""], Authorization=[Basic cWFfc3VwZXI6cWFfc3VwZXI=], Accept=[*/*]} Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:findContacts>...bunch of xml deleted for brevity...</ns1:findContacts></soap:Body></soap:Envelope> -------------------------------------- May 17, 2010 3:23:45 PM org.apache.cxf.interceptor.LoggingInInterceptor logging INFO: Inbound Message ---------------------------- ID: 1 Response-Code: 200 Encoding: UTF-8 Content-Type: text/xml; charset=utf-8 Headers: {content-type=[text/xml; charset=utf-8], Content-Length=[611], Server=[Jetty(6.1.x)]} Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:findContactsResponse>...bunch of xml spew deleted for brevity...</ns1:findContactsResponse></soap:Body></soap:Envelope> -------------------------------------- Any ideas what I'm doing wrong? Even if the server wasn't supporting FastInfoset, I still should see the attempted negotiation in the request, right?

    Read the article

< Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >