java,maven-2,encoding,utf-8,clojureRelated issues-Collection of common programming errors
WATTO Studios
java ssl
I am trying to send push notification to iPhone using Java-pns but I am getting the following error…javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failureThis is my code…String token=”95076d2846e8979b46efd1884206a590d99d0f3f6139d947635ac4186cdc5942″;String host = “gateway.sandbox.push.apple.com”; int port = 2195; String payload = “{\”aps\”:{\”alert\”:\”Message from Java o_O\”}}”;NotificationTest.verifyKeystore(“res/myFile.p12”, “password”, false); KeyStore keyStore = Ke
Wendy
java android onclick onclicklistener fatal-error
I’m getting a force close error on the line:mReadAgainButton.setOnClickListener(this);and I’m unsure why. I’m simply trying to set an onclick listener for mReadAgainButton however the application is crashing with a fatal exception and very little information in my logcat to suggest what might be causing it. LOGCAT: 09-26 15:44:51.540: E/AndroidRuntime(7918): FATAL EXCEPTION: main 09-26 15:44:51.540: E/AndroidRuntime(7918): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pr
Jeggy
64-bit java netbeans
This is probably my own fault, I removed and reinstalled java on my computer, this is what happends:jeggy@jeggy-XPS:~$ netbeans # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007fc3f78d5320, pid=2687, tid=140480869590784 # # JRE version: 6.0_27-b27 # Java VM: OpenJDK 64-Bit Server VM (20.0-b12 mixed mode linux-amd64 compressed oops) # Derivative: IcedTea6 1.12.6 # Distribution: Ubuntu 13.10, package 6b27-1.12.6-1ubuntu2.1 # Problematic frame: #
t0mm13b
java android
I’ve had this really annoying problem for a couple of days, and I cannot quite seem to solve it. I am trying to open a .csv file, so I imported it into the res/raw/ folder of my project. Then I am trying to open and read it via the getResources() method, and that’s exactly where I get the NullPointerException. Here’s the method that reads the file and fills an array with the available lines.Here’s my Activity where I create an Object newwords from the class Words, and then I want to call the Pla
Sven
java tomcat fonts debian
I want to run Tomcat on Debian 5 Minimal. So I don’t need a gui for my OS, it’s just a pure Tomcat-Server.Which packages do I need for my JVM to use Fonts in my applications? Im drawing texts in Graphics2D and am creating PDF-Files in my Java-Project.
Josh Pinter
java android bitmap
in my code, i first do a call from native to create a bitmap in java (of size: 800 x 480). This call is made recursively by a callback function and the bitmap is created by created by this function:public void createBitmap(byte[] buffer, int width, int height) { bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565); bitmap.copyPixelsFromBuffer(ByteBuffer.wrap(buffer)); }Another native function then calls a java function that is required to select an area of the original bitmap a
AmaniSwann
java android animation android-animation animationdrawable
I’m getting an error stating FATAL EXCEPTION: main java.lang.ArrayIndexOutOfBoundsException when attempting to animate a sequential set of loading icons and I’m not sure exactly why this is happening. …any suggestions?LOGCAT:07-24 16:08:38.944: E/AndroidRuntime(11979): FATAL EXCEPTION: main 07-24 16:08:38.944: E/AndroidRuntime(11979): java.lang.ArrayIndexOutOfBoundsException 07-24 16:08:38.944: E/AndroidRuntime(11979): at com.project.example.datasettings.ConfigFinalActivity$TableUpdateReque
jasonh
java xml jaxp
I’ve built a document using JAXP like this:DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); Element rootElement = document.createElement(“Root”);for (MyObject o : myCollection) {Element entry = document.createElement(“Entry”);Element entryItem = document.createElement(“EntryItem”);entryItem.appendChild(document.createTextNode(o.getProperty()));entry.appendChild(entryItem);root
Mike
java
I have a pretty good size project I’m working on here and I was adjusting one part and now I’m getting this errer box that pops up when I try and run the code. It was working before and the only are that I changed was “CREATE CONTRACTORS”. The error is either going to be in that section, or all the way at the bottom, I think. I am using Eclipse to run the code and after I run it I not only get that box to pop up, but a message at the bottom of the code that says: java.lang.NoSuchMethodError:
ultra_buckner
java android onitemclicklistener
The situation is when I select one of the list item. It will show the details of the item on the next activity.I trying to getting a values from selected ListItem by using onItemClick Listener. I got error [FATAL EXCEPTION] while click on the item.Please help me.This is part of ScheduleFragment.javapublic class ScheduleFragment extends Fragment {/* other activity */@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {View rootView = inflat
user1286093
maven-2 dependency-injection jersey tomcat7
I’m somewhat stuck with my problem. I try to run a RESTful webservice using Jersey and combine this with some Dependency Injection using OpenWebBeans on Tomcat7. The Jersey Part itself seems to work well, but when I create the beans.xml file i get the below mentioned errors…So here we go:I created the project using Maven in Eclipse:File->New->Other->Maven Project->maven-archetype-webapp and added the src/main/java folderThe file tree looks like this:TJOWB |-Deployment Descriptor |-Java Resou
Jack Murphy
java eclipse maven-2 jetty jersey
When I am trying to run my Jersey Servlet on jetty with mvn jetty:run I get back the error:SCHWERWIEGEND: The ResourceConfig instance does not contain any root resource classes. 2011-07-15 20:03:05.736:WARN:/server:unavailable com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.It must be something really simple, please help me out. I feel like I am doomed to fail developing a simple JAX-RS HelloWorld!!!When I open http://localh
user538442
maven-2 maven
I tried to build a project. It failed. I made the correct changes and tried to build it again. I relieve the following error:Embedded error: Directory simple already exists – please run from a clean directorydan@dan-netbook:~/Documents/Maven/mavenbook-examples-1-SNAPSHOT/ch03-simple$ mvn archetype:create -DgroupId=org.sonatype.mavenbook.ch03 -DartifactId=simple -DpackageName=org.sonatype.mavenbook -e + Error stacktraces are turned on. [INFO] Scanning for projects… [INFO] Reactor build order:
A M
hibernate jpa maven-2
I’m trying to set up a simple jpa 2.0 project by following the information in the Hibernate EntityManager documentation. I’ve been on this for hours now, but no matter what I do I always get this exception when I try to create a EntityManagerFactory:java.lang.AssertionError: Error creating bean with name ‘EntityManagerFactory’ defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: PR
Marcos Carceles
java hibernate spring maven-2 weblogic
I am trying to include spring and hibernate in an application running on a Weblogic 10.3 server. When I run the application in the server, while accessing an TestServlet to check my configuration I get the following exception:org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘mySessionFactory’ defined in class path resource [spring-config/HorizonModelPeopleConnectionsSpringContext.xml]: Instantiation of bean failed; nested exception is org.springframework.bea
nickdos
spring maven-2 spring-mvc
I have a Spring-MVC 3.0 web application built with Maven. All Spring dependency versions are defined with a maven property <spring.version>3.0.3.RELEASE</spring.version>. When I change the version to either 3.0.4.RELEASE or 3.0.5.RELEASE, then the web application fails with the following exception:ERROR: [DispatcherServlet] – Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.web.servlet.mvc.annota
Chris Smith
maven-2 appfuse
C:\source\myproject>mvn jetty:run [INFO] Scanning for projects… [INFO] ———————————————————————— [INFO] Building AppFuse Spring MVC Application [INFO] task-segment: [jetty:run] [INFO] ———————————————————————— [INFO] Preparing jetty:run [WARNING] POM for ‘xfire:xfire-jsr181-api:pom:1.0-M1:compile’ is invalid.Its dependencies (if any) will NOT be available to the current build. [INFO] [warpath:add-c
Rich Seller
java maven-2 ant maven-plugin mojo
My project generates source code using the Rats! parser generator. Rats! doesn’t have a Maven plugin that I’m aware of, so I’m trying to build the parser using an Ant Java task, like so:<plugin><artifactId>maven-antrun-plugin</artifactId><executions><execution><phase>generate-sources</phase><configuration><tasks><mkdir dir=”${project.build.directory}/generated-sources/main/java/” /><java classpath=”lib/xtc.jar” classname=”xtc.parser.
Chris Kannon
java maven-2 maven-release-plugin
This is an excerpt of the problem I get when doing a release using the maven release plugin. I think it has something to do with the basedir uppercase/lowercase c:\ showing up in the reactorProjects, but I can’t figure out how to fix it. My maven version is:Apache Maven 2.2.1 (r801777; 2009-08-06 16:16:01-0300) Java version: 1.6.0_13 Java home: c:\Java\jdk1.6.0_13x86\jre Default locale: en_US, platform encoding: Cp1252 OS name: “windows vista” version: “6.1” arch: “x86” Family: “windows”This is
Jean-Rémy Revy
java maven-2 maven-archetype
I have been busy in my project creating a webapp (in struts) that manages maven, using maven-2.2.1-uber.jar link text. The problem comes when the boss says it has to use some archetypes the company has created (so no predefined archetypes for you naughty boy!). So ok, I use the -DarchetypeRepository option (with ServletWrapper I get my complete web direction, becouse the repository will be inside the app), and the log seems to find it, but then the build fails -miserably- with this little text ‘
Brandon
ruby-on-rails ruby string encoding markdown
Good afternoon,I am trying to use a javascript based editor (EpicEditor) to allow for admins on my site to input markdown for blog posts. On clicking the submit button, the string generated by the editor is sent to the Ruby/Rails server for processing into HTML via RDiscount.It mostly seems to be working, with the exception of something to do with , spaces and the like. Clicking the “preview” button in EpicEditor is giving the exact output I expect, so I knew it was something to do w
Abhishek Mukherjee
python unicode encoding utf-8
I have a unicode string list file, saved in encode option utf-8. I have another input file, saved in normal ansi. I read directory path from that ansi file and do os.walk() and try to match if any file present in the list (saved by utf-8). But it is not matching even if it is present.Later I do some normal checking with a single string “40M_Ãzµ´ú¸ÕÀÉ” and save this particular string (from notepad) in three different files with encoding option ansi, unicode and utf-8. I write a python script to
NiKo
javascript python encoding xmlhttprequest base64
I’m trying to download a binary file using XMLHttpRequest (using a recent Webkit) and base64-encode its contents using this simple function:function getBinary(file){var xhr = new XMLHttpRequest(); xhr.open(“GET”, file, false); xhr.overrideMimeType(“text/plain; charset=x-user-defined”); xhr.send(null);return xhr.responseText; }function base64encode(binary) {return btoa(unescape(encodeURIComponent(binary))); }var binary = getBinary(‘http://some.tld/sample.pdf’); var base64encoded = base64encode
Nas Banov
python unicode encoding
[Update] Appreciate the answers and input all around, but working code would be most welcome. If you can supply code that can read the sample files you are king (or queen).[Update 2] Thanks for the excellent answers and discussion. What I need to do with these is to read them in, parse them, and save parts of them in Django model instances. I believe that means converting them from their native encoding to unicode so Django can deal with them, right?There are several questions on Stackoverflow a
Cheeso
windows linux encoding zip character-encoding
On my Linux server I have some files with accented names (test-éàïù.zip). When I add them to a new ZIP file using 7zip command-line tool, the charset/encoding information is not saved and when opened on a Windows computer, the archive does not correctly display filenames. I know that 7zip creates Zip V1.0 archives, not 2.0. Maybe the charset is limited to MSDos charset ? How could I specify an encoding using 7zip or another zip tool, in order to get portable archives ?Thanks 🙂
user1632979
python windows unicode encoding utf-8
My Python script creates a xml file under Windows XP but that file doesn’t get the right encoding with Spanish characters such ‘ñ’ or some accented letters.First of all, the filename is read from an excel shell with the following code, I use to read the Excel file xlrd libraries:filename = excelsheet.cell_value(rowx=first_row, colx=5)Then, I’ve tried some encodings without success to generate the file with the right encode:filename = filename[:-1].encode(“utf-8”) filename = filename[:-1].encode(
dongle
emacs encoding utf-8 character-encoding
I have a collection of .html files created in the mid-90s, which include a significant ammount of Korean text. The HTML lacks character set metadata, so of course all of the Korean text now does not render properly. The following examples will all make use of the same excerpt of text .In text editors such as Coda and Text Wrangler the text displays as?? ?????? ???????????? ????????????Which in the absence of character set metadata in < head > is rendered by the browser as:ÓË ¼ü¡ïÀS ²éÒ,ì¸æ«ì
Max Bolingbroke
linux unicode encoding
It’s not clear to me what encodings are used where in C’s argv. In particular, I’m interested in the following scenario:A user uses locale L1 to create a file whose name, N, contains non-ASCII characters Later on, a user uses locale L2 to tab-complete the name of that file on the command line, which is fed into a program P as a command line argumentWhat sequence of bytes does P see on the command line?I have observed that on Linux, creating a filename in the UTF-8 locale and then tab-completing
yonix
python windows unicode encoding cmd
I’m working on a python application that can print text in multiple languages to the console in multiple platforms. The program works well on all UNIX platforms, but in windows there are errors printing unicode strings in command-line.There’s already a relevant thread regarding this: ( Windows cmd encoding change causes Python crash. ) but I couldn’t find my specific answer there.For example, for the following Asian text, in Linux, I can run:>>> print u”\u5f15\u8d77\u7684\u6216″.encode(
Allwe
encoding markdown xslt-2.0 saxon xpath-2.0
Let’s say I have this file.md encoded in UTF-8 (.md means it’s markdown format)Hello world This text is encoded in UTF-8.Then I approach it using function unparsed-text(‘file.md’, ‘UTF-8’). That works like a charm.Problem shows up when (let’s say) I use one of my native language (Czech) specific character, for example this file2.md:Hello world This character “s” is read like “sh” in english. Using same encoding parameter in unparsed-text() I get error:XTDE1200: Failed to read input file file:/C
BalusC
jpa netbeans utf-8 glassfish
I’m developing a JPA application in netbeans. I use glassfish 3+ application server. I want to add useUnicode=true and characterEncoding=UTF-8 to the connection URL. Alghough I have set URL to jdbc:mysql://localhost:3306/gesht_db?useUnicode=yes&characterEncoding=UTF-8 it gives me an error which says: Connection could not be allocated because: The connection property ‘useUnicode’ only accepts values of the form: ‘true’, ‘false’, ‘yes’ or ‘no’. The value ‘yes;characterEncoding=UTF-8’ is no
karlcow
python unicode utf-8 cli
In the process of creating a small CLI notebook application, I decided to go with the cmd Python library (see also cmd on PyMOTW).My shell is UTF-8.? echo $LANG fr_FR.utf-8 ? echo $LC_ALL fr_FR.utf-8And it is working quite well.? echo “??” ??Starting the code of my little app and trying to use utf-8:? python nb.py log> foobar 2013-01-15 foobar log> æ±äº¬ 2013-01-15 æ±äº¬Edited The expected input/output is. When I type utf-8 characters, be accent or Japanese characters in that case, I get
Abhishek Mukherjee
python unicode encoding utf-8
I have a unicode string list file, saved in encode option utf-8. I have another input file, saved in normal ansi. I read directory path from that ansi file and do os.walk() and try to match if any file present in the list (saved by utf-8). But it is not matching even if it is present.Later I do some normal checking with a single string “40M_Ãzµ´ú¸ÕÀÉ” and save this particular string (from notepad) in three different files with encoding option ansi, unicode and utf-8. I write a python script to
mgaughan
ruby-on-rails postgresql utf-8
Can’t seem to figure this one out, trying to run any script I get this error: invalid byte sequence in UTF-8 (ArgumentError)I have a new OS X machine everything fresh, using Ruby 1.9.3 and Rails 3.2.1 , I’ve been developing for days with no problem.I left for a few hours today and now I can’t run any scripts.I first got the error trying a new migration and thought it was an issue with Postgres, reinstalled, made sure all tables were encoded with UTF-8.I’ve also reinstalled RVM and Rails.I though
Tomas Lycken
python django unicode utf-8
I know similar questions have been asked a million times, but despite reading through many of them I can’t find a solution that applies to my situation.I have a django application, in which I’ve created a management script. This script reads some text files, and outputs them to the terminal (it will do more useful stuff with the contents later, but I’m still testing it out) and the characters come out with escape sequences like \xc3\xa5 instead of the intended å. Since that escape sequence means
Pietro M
utf-8 locale cout multiplatform wstring
Is it possible to print UTF-8 strings without using platform specific functions?#include <iostream> #include <locale> #include <string>using namespace std;int main() {ios_base::sync_with_stdio(false);wcout.imbue(locale(“en_US.UTF-8″)); // broken on Windows (?)wstring ws1 = L”Wide string.”;wstring ws2 = L”Wide string with special chars \u20AC”; // Euro characterwcout << ws1 << endl;wcout << ws2 << endl;wcout << ws1 << endl; }I get this runtim
tkeE2036
c# c unicode utf-8 string-comparison
So I am attempting to write a compare function in C which can take a UTF-8 encoded Unicode string and use the Windows CompareStringEx() function and I am expecting it to work just like .NET’s CultureInfo.CompareInfo.Compare().Now the function I have written in C works some of the time, but not in all cases and I’m trying to figure out why. Here is a case that fails (passes in C#, not in C):CultureInfo cultureInfo = new CultureInfo(“en-US”); CompareOptions compareOptions = CompareOptions.IgnoreCa
Tuukka Mustonen
utf-8 character-encoding special-characters
We are building a (Java) web project with Eclipse. By default Eclipse uses Cp1252 encoding on Windows machines (which we use).As we also have developers in China (in addition to Europe), I started to wonder if that is really the encoding to use.My initial thought was to convert to UTF-8, because “it supports all the character sets”. However, is this really wise? Should we pick some other encoding instead? I see couple of issues:1) How do web browser interpret the files by default? Does it depend
Cody Gray
c++ winapi unicode utf-8 rc
I created an RC file which contains a string table, I would like to use some specialcharacters: ö ü ó ú o u á é. so I save the string with UTF-8 encoding.But when I call in my cpp file, something like this:LoadString(“hu.dll”, 12, nn, MAX_PATH);I get a weird result:How do I solve this problem?
rafael
python unicode utf-8
I execute following code on windows xp and python 2.6.4But it show IOError.How to open file whose name has utf-8 codec.>>> open( unicode(‘??.txt’, ‘euc-kr’).encode(‘utf-8’) )Traceback (most recent call last):File “<pyshell#0>”, line 1, in <module>open( unicode(‘??.txt’, ‘euc-kr’).encode(‘utf-8’) ) IOError: [Errno 22] invalid mode (‘r’) or filename: ‘\xed\x95\x9c\xea\xb8\x80.txt’But the following code to the normal operation.>>> open( unicode(‘??.txt’, ‘euc-kr’) ) &l
juan.facorro
clojure leiningen ring monger
I’m trying to run a small Clojure web app I wrote, and I’m getting an exception from lein ring server that isn’t giving me any useful information. I’ve googled the error and found this discussion, which suggested running lein deps :tree to route out the problem, but that’s been depreciated.Full stack trace:Exception in thread “main” java.lang.RuntimeException: java.lang.NoSuchMethodError: clojure.lang.RT.mapUniqueKeys([Ljava/lang/Object;)Lclojure/lang/IPersistentMap;at clojure.lang.Util.runtimeE
Sébastien Grans
vim clojure read-eval-print-loop
I tried to play with overtone on ubuntu, but I can’t eval some of overtone’s codes in Vim. :Eval works for the clojure code; I tried it in vim (a clj file in the lein project directory), ex: (+ 1 2 3) => :Eval => appeared on the bottom of the vim window => 6, so it’s ok.But, for example, I tried: (demo(sin-osc)) => :Eval ;(:Require don’t change nothing)It returned:java.lang.RuntimeException: Unable to resolve symbol: demo in this context, comp iling:(NO_SOURCE_PATH:1:1)So here’s what I do:jac
andrew cooke
clojure
SIMPLER VERSION:This works:user=> (map + [1 2 3] [4 5 6] [7 8 9]) (12 15 18)This doesn’t:user=> (for [n (range 3)] [n (+ 1 n)]) ([0 1] [1 2] [2 3]) user=> (map + (for [n (range 3)] [n (+ 1 n)])) java.lang.ClassCastExceptionWhy?I am very new to clojure so this is probably a newbie mistake. In the code below I am trying to add multiple signals together. Each signal contains a vector (called data) and I want to do piece-wise addition. At the REPL, something like this:user=> (map + [1
Ton van Bart
java google-app-engine ssl clojure
I’m trying to build a simple web widget in Clojure which should fetch a Picasa feed, retrieve the thumbnail URLs from there, and return HTML which will be inserted into a page (using JQuery AJAX call). The Picasa feed has a https://… url. Everything works when I run it in a local Jetty instance using mvn jetty:run ; however when I try to run in a local GAE instance (mvn gae:run) it fails with an AccessControlException. I’ve read the GAE documentation, but this states that for URLFetch from Jav
oskarkv
emacs clojure
I’m trying to setup ritz-nrepl to use emacs as a clojure debugger.I have lein 2. I got emacs 24.2.1 (fresh install) and clojure-mode. Then I did what the readme says here https://github.com/pallet/ritz/tree/develop/nrepl under nREPL debugger installation (putting stuff in init.el and .lein/profiles.clj) and then did M-x nrepl-ritz-jack-in. I got the output below. Am I doing something wrong? I have only done what I said, nothing more. Maybe I’m missing a step?Could not find artifact robert:hooke:
Marcus Junius Brutus
java clojure
Trying to use the approach described here I eventually came to the following simplified , narrow-down code that still exhibits the exception:import clojure.lang.RT;public class FooMain {public static void main(String [] args) {RT.var(“clojure.core”, “read-string”).invoke(“(+ 1 2)”); // line-6} }Which fails at runtime with the trace I append at the end of the post. I’ve tried that with either Clojure 1.4 or 1.5 Ivy deps:<dependency org=”org.clojure” name=”clojure” rev=”1.4.0″/> or:<depen
alyssackwan
java clojure jetty ring
I’m writing an embedded Jetty app in Clojure, and have the following as the main namespace:(ns rudkus.core(:require [clojure.tools.cli :as cli][ring.adapter.jetty :as jetty])(:gen-class))(defn handler [request]{:status 200:headers {“Content-Type” “text/html”}:body “Hello, World!”})(def ^{:private true} server (atom nil))(defn start [port](swap! server #(if (not (nil? %))(throw (IllegalStateException. “Server already started.”))(jetty/run-jetty handler{:port port:join? false}))))(defn stop [](swa
Milan
clojure osx-lion leiningen
When I try running leiningen on my os x lion I get the error below. The install is done as per the instructions on github (README). Can anyone give me a hint on this?The only possible solution I found via google was to run lein clean but that fails for me with a similar message.Exception in thread “main” java.lang.RuntimeException: java.lang.NoSuchMethodError: clojure.lang.KeywordLookupSite.<init>(ILclojure/lang/Keyword;)V at clojure.lang.Util.runtimeException(Util.java:165) at clojure.lan
qwertymk
scala groovy clojure jruby
I’m planning to broaden my perspectives in JVM platform, and I’ve got a dilemma: what should I learn first? Could you please explain, what are the advantages of Groovy, Scala and other languages for JVM? Thanks.
sakekasi
clojure
the generated uberwar for my project will not run on tomcat. this is the log for tomcat:Feb 13, 2014 7:21:33 PM org.apache.catalina.startup.HostConfig deployWAR SEVERE: Error deploying web application archive /var/lib/tomcat7/webapps/com.sakekasi.linkshare-0.2B.war java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/com.sakekasi.linkshare-0.2B]]at org.a
Web site is in building