Search Results

Search found 342 results on 14 pages for 'runtimeexception'.

Page 8/14 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Android: ProgressDialog.show() crashes with getApplicationContext

    - by Felix
    I can't seem to grasp why this is happening. This code: mProgressDialog = ProgressDialog.show(this, "", getString(R.string.loading), true); works just fine. However, this code: mProgressDialog = ProgressDialog.show(getApplicationContext(), "", getString(R.string.loading), true); throws the following exception: W/WindowManager( 569): Attempted to add window with non-application token WindowToken{438bee58 token=null}. Aborting. D/AndroidRuntime( 2049): Shutting down VM W/dalvikvm( 2049): threadid=3: thread exiting with uncaught exception (group=0x4001aa28) E/AndroidRuntime( 2049): Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime( 2049): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tastekid.TasteKid/com.tastekid.TasteKid.YouTube}: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application E/AndroidRuntime( 2049): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401) E/AndroidRuntime( 2049): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417) E/AndroidRuntime( 2049): at android.app.ActivityThread.access$2100(ActivityThread.java:116) E/AndroidRuntime( 2049): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) E/AndroidRuntime( 2049): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 2049): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime( 2049): at android.app.ActivityThread.main(ActivityThread.java:4203) E/AndroidRuntime( 2049): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 2049): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime( 2049): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) E/AndroidRuntime( 2049): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) E/AndroidRuntime( 2049): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 2049): Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application E/AndroidRuntime( 2049): at android.view.ViewRoot.setView(ViewRoot.java:460) E/AndroidRuntime( 2049): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177) E/AndroidRuntime( 2049): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91) E/AndroidRuntime( 2049): at android.app.Dialog.show(Dialog.java:238) E/AndroidRuntime( 2049): at android.app.ProgressDialog.show(ProgressDialog.java:107) E/AndroidRuntime( 2049): at android.app.ProgressDialog.show(ProgressDialog.java:90) E/AndroidRuntime( 2049): at com.tastekid.TasteKid.YouTube.onCreate(YouTube.java:45) E/AndroidRuntime( 2049): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) E/AndroidRuntime( 2049): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364) E/AndroidRuntime( 2049): ... 11 more Any ideas why this is happening? I'm calling this from the onCreate method.

    Read the article

  • Android Get Image Uri from Camera

    - by josnidhin
    Hi I have an application that calls the android phone's default camera to take photo the following is my code. Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent, TAKE_PICTURE); and in the onActivityResult method I am doing the following if ((requestCode == TAKE_PICTURE) && (resultCode == Activity.RESULT_OK)) { Uri photoPath = intent.getData(); // do something with the uri here } The above code works fine on htc Tatto and Sony ericsson's x10 running 1.6 but in on htc G1 running 1.6 the above code causes the following exception 03-08 18:54:25.906: ERROR/AndroidRuntime(4344): Uncaught handler: thread main exiting due to uncaught exception 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { act=inline-data (has extras) }} to activity removed java.lang.NullPointerException 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at android.app.ActivityThread.deliverResults(ActivityThread.java:3224) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3266) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at android.app.ActivityThread.access$2600(ActivityThread.java:116) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at android.os.Handler.dispatchMessage(Handler.java:99) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at android.os.Looper.loop(Looper.java:123) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at android.app.ActivityThread.main(ActivityThread.java:4203) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at java.lang.reflect.Method.invokeNative(Native Method) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at java.lang.reflect.Method.invoke(Method.java:521) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at dalvik.system.NativeStart.main(Native Method) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): Caused by: java.lang.NullPointerException 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at removed 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at android.app.Activity.dispatchActivityResult(Activity.java:3624) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at android.app.ActivityThread.deliverResults(ActivityThread.java:3220) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): ... 11 more Any insights into how to solve this problem. Thank you.

    Read the article

  • JSF with Enum 'Validation Error: Value is not valid'

    - by Shamik
    I have an enum whose code is like this - public enum COSOptionType { NOTAPPLICABLE, OPTIONAL, MANDATORY; private String[] label = { "Not Applicable", "Optional", "Mandatory"}; @Override public String toString() { return label[this.ordinal()]; } public static COSOptionType getCOSOption(String value) { int ivalue = Integer.parseInt(value); switch(ivalue) { case 0: return NOTAPPLICABLE; case 1: return OPTIONAL; case 2: return MANDATORY; default: throw new RuntimeException("Should not get this far ever!"); } } } I have the converter to convert the enum type public class COSEnumConverter implements Converter { public Object getAsObject(FacesContext context, UIComponent comp, String value) { return COSOptionType.getCOSOption(value); } public String getAsString(FacesContext context, UIComponent comp, Object obj) { if (obj instanceof String) { return (String) obj; } COSOptionType type = (COSOptionType) obj; int index = type.ordinal(); return ""+index; } } The view looks like this <h:selectOneMenu value="#{controller.type}" id="smoking"> <f:selectItems value="#{jnyController.choices}" /> </h:selectOneMenu> Here is the code for create choices private List<SelectItem> createChoicies() { List<SelectItem> list = new ArrayList<SelectItem>(); for (COSOptionType cos : COSOptionType.values()) { SelectItem item = new SelectItem(); item.setLabel(cos.toString()); item.setValue("" + cos.ordinal()); list.add(item); } return list; } I do not understand why this would throw "validation error" all the time ? I can debug and see that the converter is working fine. NOTE: I am using JSF 1.1

    Read the article

  • Using android.view.SurfaceView with a camera on part of the screen

    - by oneself
    Hi, I trying to put together an Android app that will take a picture and process it in some way. I'd like the layout to be similar to Google Goggles. Meaning, camera preview on the top, and some controls on the bottom using portrait orientation. I've built a first version using code sample from here. This works, but I want to add a button on the bottom. I've modified my main.xml to look as follows: <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="150dp" android:stretchColumns="1"> <TableRow> <android.view.SurfaceView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/preview" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </TableRow> <Button android:id="@+id/snap" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Snap" /> <TableRow> </TableRow> </TableLayout> But when I run this code I get an exception: java.lang.RuntimeException: startPreview failed. When I replace the SurfaceView above with something else, e.g. a TextView, that it displays, but in landscape. How can I get a camera preview on part of the screen using portrait view? Thanks

    Read the article

  • Selenium error on Win7

    - by hawkeye
    I'm starting Selenium server with the following on a command line: java -jar selenium-server.jar Here is the code: import com.thoughtworks.selenium.*; import java.util.regex.Pattern; import org.openqa.selenium.server.SeleniumServer; import junit.framework.*; public class orkut extends SeleneseTestCase { public void setUp() throws Exception { //SeleniumServer server = new SeleniumServer(); //server.start(); setUp("https://www.google.com/", "*firefox C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"); } public void testOrkut() throws Exception { selenium.setTimeout("10000"); selenium.open("/accounts/ServiceLogin?service=orkut&hl=en-US&rm=false&continue=http%3A%2F%2Fwww.orkut.com%2FRedirLogin%3Fmsg%3D0&cd=IN&skipvpage=true&sendvemail=false"); selenium.type("Email", "username"); selenium.type("Passwd", "password"); selenium.click("signIn"); selenium.selectFrame("orkutFrame"); selenium.click("link=Communities"); selenium.waitForPageToLoad("10000"); } public static Test suite() { return new TestSuite(orkut.class); } public void tearDown(){ selenium.stop(); } public static void main(String args[]) { junit.textui.TestRunner.run(suite()); } } Here is the error: .E Time: 33.386 There was 1 error: 1) testOrkut(orkut)java.lang.RuntimeException: Could not start Selenium session: Failed to start new browser session: Unable to delete file C:\Users\user\AppData\Local\Temp\customProfileDir78cf02e3efca4772a71525c4a7523cac\parent.lock at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:89) at com.thoughtworks.selenium.SeleneseTestBase.setUp(SeleneseTestBase.java:123) at com.thoughtworks.selenium.SeleneseTestBase.setUp(SeleneseTestBase.java:104) at com.thoughtworks.selenium.SeleneseTestCase.setUp(SeleneseTestCase.java:78) at orkut.setUp(orkut.java:14) at com.thoughtworks.selenium.SeleneseTestCase.runBare(SeleneseTestCase.java:212) at orkut.main(orkut.java:37) Caused by: com.thoughtworks.selenium.SeleniumException: Failed to start new browser session: Unable to delete file C:\Users\M022534\AppData\Local\Temp\customProfileDir78cf02e3efca4772a71525c4a7523cac\parent.lock at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97) at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91) at com.thoughtworks.selenium.HttpCommandProcessor.getString(HttpCommandProcessor.java:262) at com.thoughtworks.selenium.HttpCommandProcessor.start(HttpCommandProcessor.java:223) at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:81) ... 16 more FAILURES!!! Tests run: 1, Failures: 0, Errors: 1

    Read the article

  • Java - HtmlUnit - Unable to save HTML to file (in some cases)

    - by Walter White
    Hi all, I am having intermittent issues saving the response HTML in HtmlUnit. Caused by: java.io.IOException: Unable to save file:C:\ccview\PP50773_4.0_walter\TSC_hca\Applications\HCA_J2EE\HCA\target\HtmlUnitTests\single\1\com\pnc\tsc\hca\ui\test\SiteCrawler\crawlSiteAsProvider\10.SiteCrawler.crawl.html at com.pnc.tsc.hca.ui.util.GetUtil.save(GetUtil.java:128) at com.pnc.tsc.hca.ui.util.GetUtil.add(GetUtil.java:75) at com.pnc.tsc.hca.ui.util.GetUtil.click(GetUtil.java:49) at com.pnc.tsc.hca.ui.test.SiteCrawler.crawl(SiteCrawler.java:87) at com.pnc.tsc.hca.ui.test.SiteCrawler.crawl(SiteCrawler.java:61) at com.pnc.tsc.hca.ui.test.SiteCrawler.crawl(SiteCrawler.java:63) at com.pnc.tsc.hca.ui.test.SiteCrawler.crawl(SiteCrawler.java:63) at com.pnc.tsc.hca.ui.test.SiteCrawler.crawl(SiteCrawler.java:63) at com.pnc.tsc.hca.ui.test.SiteCrawler.crawl(SiteCrawler.java:54) at com.pnc.tsc.hca.ui.test.SiteCrawler.crawlSiteAsProvider(SiteCrawler.java:50) ... 15 more Caused by: java.lang.RuntimeException: java.io.IOException: The system cannot find the path specified at com.gargoylesoftware.htmlunit.html.XmlSerializer.getAttributesFor(XmlSerializer.java:165) at com.gargoylesoftware.htmlunit.html.XmlSerializer.printOpeningTag(XmlSerializer.java:126) at com.gargoylesoftware.htmlunit.html.XmlSerializer.printXml(XmlSerializer.java:83) at com.gargoylesoftware.htmlunit.html.XmlSerializer.printXml(XmlSerializer.java:93) at com.gargoylesoftware.htmlunit.html.XmlSerializer.printXml(XmlSerializer.java:93) at com.gargoylesoftware.htmlunit.html.XmlSerializer.asXml(XmlSerializer.java:73) at com.gargoylesoftware.htmlunit.html.XmlSerializer.save(XmlSerializer.java:55) at com.gargoylesoftware.htmlunit.html.HtmlPage.save(HtmlPage.java:2259) at com.pnc.tsc.hca.ui.util.GetUtil.save(GetUtil.java:126) ... 24 more Caused by: java.io.IOException: The system cannot find the path specified at java.io.WinNTFileSystem.createFileExclusively(Native Method) at java.io.File.createNewFile(File.java:883) at com.gargoylesoftware.htmlunit.html.XmlSerializer.createFile(XmlSerializer.java:216) at com.gargoylesoftware.htmlunit.html.XmlSerializer.getAttributesFor(XmlSerializer.java:160) ... 32 more Now, the parent directory exists and some other files have already been written to the directory. Looking at the filename, I don't see anything that would stand out as a red flag indicating the filename is bad. What can I do to correct this error? Thanks, Walter

    Read the article

  • Android WebView - cannot understand - Null or empty value for header "if-none-match"

    - by ganesh
    Hi When i tried to load a url i get an exception as below Uncaught handler: thread WebViewCoreThread exiting due to uncaught exception 06-16 10:22:31.471: ERROR/AndroidRuntime(635): java.lang.RuntimeException: Null or empty value for header "if-none-match" 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.net.http.Request.addHeader(Request.java:161) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.net.http.Request.addHeaders(Request.java:179) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.net.http.Request.<init>(Request.java:132) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.net.http.RequestQueue.queueRequest(RequestQueue.java:480) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.net.http.RequestHandle.createAndQueueNewRequest(RequestHandle.java:419) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.net.http.RequestHandle.setupRedirect(RequestHandle.java:195) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.webkit.LoadListener.doRedirect(LoadListener.java:1216) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.webkit.LoadListener.handleMessage(LoadListener.java:220) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.os.Handler.dispatchMessage(Handler.java:99) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.os.Looper.loop(Looper.java:123) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:471) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at java.lang.Thread.run(Thread.java:1060) the code i am using is webview = (WebView)findViewById(R.id.generalwebview); webview.getSettings().setJavaScriptEnabled(true); webview.setWebViewClient(new WebViewClient() { public boolean shouldOverrideUrlLoading(WebView view, String url) { Log.i("ReserveBooking", "Processing webview url click..."); view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { Log.i("ReserveBooking", "Finished loading URL: " +url); } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Log.e("ReserveBooking", "Error: " + description); Toast.makeText(ReserveBooking.this, description, Toast.LENGTH_SHORT).show(); } }); webview.loadUrl(utls); and when i changed the emulator, this programs works without any error .Please help me to know the reason why i get this error ,is this error somehow related to cache? ,I shall be glad if someone explains ganesh

    Read the article

  • How to mock HTTPSession/FlexSession with TestNG and some Mocking Framework

    - by ifischer
    I'm developing a web application running on Tomcat 6, with Flex as Frontend. I'm testing my backend with TestNG. Currently, I'm trying to test the following method in my Java-Backend: public UserPE login(String mail, String password) { UserPE dbuser = findUserByMail(mail); if (dbuser == null || !dbuser.getPassword().equals(password)) throw new RuntimeException("Invalid username and/or password"); // Save logged in user FlexSession session = FlexContext.getFlexSession(); session.setAttribute("user", dbuser); return dbuser; } The method needs access to the FlexContext which only exists when i run it on the Servlet container (don't bother if you don't know Flex, it's more a Java-Mocking question in general). Otherwise i get a Nullpointer exception when calling session.setAttribute(). Unfortunately, I cannot set the FlexContext from outside, which would make me able to set it from my tests. It's just obtained inside the method. What would be the best way to test this method with a Mocking framework, without changing the method or the class which includes the method? And which framework would be the easiest for this use case (there are hardly other things i have to mock in my app, it's pretty simple)? Sorry I could try out all of them for myself and see how i could get this to work, but i hope that i'll get a quickstart with some good advices!

    Read the article

  • android DES decrypt file : pad block corrupted

    - by Kenny Chang
    public class TestDES { Key key; public TestDES(String str) { getKey(str); } public void getKey(String strKey) { try { KeyGenerator _generator = KeyGenerator.getInstance("DES"); _generator.init(new SecureRandom(strKey.getBytes())); this.key = _generator.generateKey(); _generator = null; } catch (Exception e) { throw new RuntimeException("Error initializing SqlMap class. Cause: " + e); } } public void decrypt(String file, String dest) throws Exception { Cipher cipher = Cipher.getInstance("DES"); cipher.init(Cipher.DECRYPT_MODE, this.key); InputStream is = new FileInputStream(file); OutputStream out = new FileOutputStream(dest); CipherOutputStream cos = new CipherOutputStream(out, cipher); byte[] buffer = new byte[1024 * 1024 * 6]; int r; while ((r = is.read(buffer)) >= 0) { cos.write(buffer, 0, r); } cos.close();a out.close(); is.close(); } } The code works well on PC JAVA Program, but not on android.The error "pad block corrupted" happended at 'cos.close();' LogCat shows:" 03-10 07:43:04.431: WARN/System.err(23765): java.io.IOException: pad block corrupted 03-10 07:43:04.460: WARN/System.err(23765): at javax.crypto.CipherOutputStream.close(CipherOutputStream.java:157) "

    Read the article

  • Problem reading from two separate InputStreams

    - by Emil H
    I'm building a Yammer client for Android in Scala and have encountered the following issue. When two AsyncTasks try to parse an XML response (not the same, each task has it's own InputStream) from the Yammer API the underlying stream throws a IOException with the message "null SSL pointer", as seen below: Uncaught handler: thread AsyncTask #1 exiting due to uncaught exception java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:200) at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:234) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:258) at java.util.concurrent.FutureTask.run(FutureTask.java:122) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673) at java.lang.Thread.run(Thread.java:1060) Caused by: java.io.IOException: null SSL pointer at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.nativeread(Native Method) at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.access$300(OpenSSLSocketImpl.java:55) at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:524) at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:103) at org.apache.http.impl.io.AbstractSessionInputBuffer.read(AbstractSessionInputBuffer.java:134) at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:174) at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:188) at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:178) at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:504) at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:467) at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:329) at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:286) at javax.xml.parsers.SAXParser.parse(SAXParser.java:361) at org.mediocre.util.XMLParser$.loadXML(XMLParser.scala:28) at org.mediocre.util.XMLParser$.loadXML(XMLParser.scala:12) ..... Searching for the error didn't give much clarity. Does this have something to do with the response from the server? Or is it something else? Complete code can be found at: http://github.com/archevel/YammerTime I get no error if I wait until the first repsponse is finished and then let the other complete. The request is made with the DefaultHttpClient, but this is supposedly thread safe. What am I missing? If anything needs to be clarified just ask :) Cheers, Emil H

    Read the article

  • How to set an EditText on top of a ListView ?

    - by Spredzy
    Hi everyone, I am trying to do an autocomplete version my way (logic, layout, etc...) , so I don't want to use the AutoCompleteTextView. My question is how to set an EditText on top of a ListView in a class inheriting from a ListAcvitivy. I tried two kinds of layout, none of them worked. First one : <EditText android:id="@+id/autocomplete_server" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:completionThreshold="1" android:singleLine="true"/> <ListView android:id="@id/android:list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#000000" android:layout_weight="1" android:drawSelectorOnTop="false"/> <TextView android:id="@id/android:empty" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#FF0000" android:text="No data"/> This one only shows me the EditText but does not display the list Second one : <LinearLayout android:id="@id/android:list" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="5dp"> <EditText android:id="@+id/autocomplete_server" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:completionThreshold="1" android:singleLine="true"/> <ListView android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#000000" android:layout_weight="1" android:drawSelectorOnTop="false"/> </LinearLayout> This sample gives me a : java.lang.RuntimeException: Unable to start activity ComponentInfo{com.eip.core/com.eip.core.Search}: java.lang.ClassCastException: android.widget.LinearLayout Does anyone have any idea bout how to implement an EditText on top of a listView ?

    Read the article

  • Renaming column in Android sqlite database results in error

    - by Apophenia Overload
    I've been modifying the Notepad tutorial for Android very subtly- all I did was rename the column from title to name: Before: public static final String KEY_TITLE = "title"; ... private static final String DATABASE_CREATE = "create table notes (_id integer primary key autoincrement, " + "title text not null, body text not null);"; After: public static final String KEY_TITLE = "name"; ... private static final String DATABASE_CREATE = "create table notes (_id integer primary key autoincrement, " + "name text not null, body text not null);"; However, it always results in this: 06-10 03:29:38.421: ERROR/AndroidRuntime(344): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.demo.notepad1/com.android.demo.notepad1.Notepadv1}: android.database.sqlite.SQLiteException: no such column: name: , while compiling: SELECT _id, name, body FROM notes ... 06-10 03:29:38.421: ERROR/AndroidRuntime(344): Caused by: android.database.sqlite.SQLiteException: no such column: name: , while compiling: SELECT _id, name, body FROM notes Am I failing to rename something? All I am modifying is the Exercise 1 Solution program from the Notepad tutorial.

    Read the article

  • Android - How to Use SQLiteDatabase.open?

    - by Edwin Lee
    Hi all, i'm trying to use SQLiteDatabase.openDatabase( "/data/data/edwin11.myapp/databases/myapp.db", null, (SQLiteDatabase.CREATE_IF_NECESSARY | SQLiteDatabase.NO_LOCALIZED_COLLATORS)); to create/open a database instead of making use of the SQLiteOpenHelper (because i want to pass in the flag SQLiteDatabase.NO_LOCALIZED_COLLATORS. However, i am getting this exception for that line of code: 04-18 09:50:03.585: ERROR/Database(3471): sqlite3_open_v2("/data/data/edwin11.myapp/databases/myapp.db", &handle, 6, NULL) failed 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): java.lang.RuntimeException: An error occured while executing doInBackground() 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at android.os.AsyncTask$3.done(AsyncTask.java:200) 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:234) 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:258) 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at java.util.concurrent.FutureTask.run(FutureTask.java:122) 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648) 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673) 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at java.lang.Thread.run(Thread.java:1060) 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): Caused by: android.database.sqlite.SQLiteException: unable to open database file 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at android.database.sqlite.SQLiteDatabase.dbopen(Native Method) 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1584) 04-18 09:50:03.665: ERROR/AndroidRuntime(3471): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:638) ... Doing some testing just before that line of code (using File.isExists) shows that the file /data/data/edwin11.myapp/databases/myapp.db does not exist. Would that be the cause of the error? (Or am i just using SQLiteDatabase.openDatabase the wrong way?) Would it help if i create the file beforehand? (Shouldn't that be taken care of by the SQLiteDatabase.CREATE_IF_NECESSARY flag that i passed in?) If creating the file manually is the way to go, is it just an empty file, or do i have to write something to it? Thanks and Regards.

    Read the article

  • org.smslib port in use exception

    - by danar jabbar
    I am trying to create web application to send sms by gsm modem in JSP first I put destination mobile number and sms text in url and get by request.getparameter and first message sent with no problem but when send a message again by referenshing the same page i get this exception: org.smslib.GatewayException: Comm library exception: java.lang.RuntimeException: gnu.io.PortInUseException: org.smslib at org.smslib.modem.SerialModemDriver.connectPort(SerialModemDriver.java:102) at org.smslib.modem.AModemDriver.connect(AModemDriver.java:114) at org.smslib.modem.ModemGateway.startGateway(ModemGateway.java:189) at org.smslib.Service$1Starter.run(Service.java:276) I tried to stop gateway and stop service but no hope My code: public boolean sendMessage(String strMobileNo,String strSMSText) { try { OutboundMessage outboundMessage=new OutboundMessage(); SMS message=new SMS(); SerialModemGateway gateway = new SerialModemGateway("modem.com1", "COM12", 9600, "Huawie", "EF200"); gateway.setInbound(true); gateway.setOutbound(true); gateway.setSimPin("0000"); gateway.setSmscNumber("+9647701144010"); Service.getInstance().setOutboundMessageNotification(message); Service.getInstance().addGateway(gateway); Service.getInstance().startService(); outboundMessage.setText(strSMSText); outboundMessage.setRecipient(strMobileNo); outboundMessage.setEncoding(Message.MessageEncodings.ENCUCS2); //outboundMessage.setDeliveryDelay(5000); Service.getInstance().sendMessage(outboundMessage); System.out.println(outboundMessage); gateway.stopGateway(); Service.getInstance().stopService(); Thread.sleep(10000); return true; } catch (Exception e) { e.printStackTrace(); return false; } }

    Read the article

  • Javassist failure in hibernate: invalid constant type: 60

    - by Kaleb Pederson
    I'm creating a cli tool to manage an existing application. Both the application and the tests build fine and run fine but despite that I receive a javassist failure when running my cli tool that exists within the jar: INFO: Bytecode provider name : javassist ... INFO: Hibernate EntityManager 3.5.1-Final Exception in thread "main" javax.persistence.PersistenceException: Unable to configure EntityManagerFactory at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:371) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:55) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:48) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:32) ... at com.sophware.flexipol.admin.AdminTool.<init>(AdminTool.java:40) at com.sophware.flexipol.admin.AdminTool.main(AdminTool.java:69) Caused by: java.lang.RuntimeException: Error while reading file:flexipol-jar-with-dependencies.jar at org.hibernate.ejb.packaging.NativeScanner.getClassesInJar(NativeScanner.java:131) at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:467) at org.hibernate.ejb.Ejb3Configuration.addMetadataFromScan(Ejb3Configuration.java:457) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:347) ... 11 more Caused by: java.io.IOException: invalid constant type: 60 at javassist.bytecode.ConstPool.readOne(ConstPool.java:1027) at javassist.bytecode.ConstPool.read(ConstPool.java:970) at javassist.bytecode.ConstPool.<init>(ConstPool.java:127) at javassist.bytecode.ClassFile.read(ClassFile.java:693) at javassist.bytecode.ClassFile.<init>(ClassFile.java:85) at org.hibernate.ejb.packaging.AbstractJarVisitor.checkAnnotationMatching(AbstractJarVisitor.java:243) at org.hibernate.ejb.packaging.AbstractJarVisitor.executeJavaElementFilter(AbstractJarVisitor.java:209) at org.hibernate.ejb.packaging.AbstractJarVisitor.addElement(AbstractJarVisitor.java:170) at org.hibernate.ejb.packaging.FileZippedJarVisitor.doProcessElements(FileZippedJarVisitor.java:119) at org.hibernate.ejb.packaging.AbstractJarVisitor.getMatchingEntries(AbstractJarVisitor.java:146) at org.hibernate.ejb.packaging.NativeScanner.getClassesInJar(NativeScanner.java:128) ... 14 more Since I know the jar is fine as the unit and integration tests run against it, I thought it might be a problem with javassist, so I tried cglib. The bytecode provider then shows as cglib but I still get the exact same stack trace with javassist present in it. cglib is definitely in the classpath: $ unzip -l flexipol-jar-with-dependencies.jar | grep cglib | wc -l 383 I've tried with both hibernate 3.4 and 3.5 and get the exact same error. Is this a problem with javassist?

    Read the article

  • Using EJB in Wicket WebPage

    - by Errandir
    When I'm using @EJB annotation to access stateless EJB through remote interface in common HttpServlet, it works OK: public class ListMsgs extends HttpServlet { @EJB private Msgs msgsRI; ... protected void processRequest(...) ... { List msgs = msgsRI.getAll(); ... } ... } But when I'm trying the same thing in Wicket WebPage, I'm getting null in return for bean: public class ListM extends WebPage { @EJB private Msgs msgsRI; ... public ListM() { List msgs = msgsRI.getAll(); // NullPointerException ... } ... } The several lines of this “Unexpected RuntimeException” are: WicketMessage: Can't instantiate page using constructor public testapp.web.ListM() Root cause: java.lang.NullPointerException at testapp.web.ListM.<init>(ListM.java:22) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:192) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:57) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479) at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:138) at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) .... There are ejb-module with bean and web-module with servlet and wicket web page deployed to GlassFish v2.1.1 server (if it makes any sense). What should I do to use my enterprise bean through remote interface in wicket webpage?

    Read the article

  • ADT-like polymorphism in Java (without altering class)

    - by ffriend
    In Haskell I can define following data type: data Tree = Empty | Leaf Int | Node Tree Tree and then write polymorphic function like this: depth :: Tree -> Int depth Empty = 0 depth (Leaf n) = 1 depth (Node l r) = 1 + max (depth l) (depth r) In Java I can emulate algebraic data types with interfaces: interface Tree {} class Empty implements Tree {} class Leaf implements Tree { int n; } class Node implements Tree { Tree l; Tree r; } But if I try to use Haskell-like polymorphism, I get an error: int depth(Empty node) { return 0; } int depth(Leaf node) { return 1; } int depth(Node node) { return 1 + Math.max(depth(node.l), depth(node.r)); // ERROR: Cannot resolve method 'depth(Tree)' } Correct way to overcome this is to put method depth() to each class. But what if I don't want to put it there? For example, method depth() may be not directly related to Tree and adding it to class would break business logic. Or, even worse, Tree may be written in 3rd party library that I don't have access to. In this case, what is the simplest way to implement ADT-like polymorpism? Just in case, for the moment I'm using following syntax, which is obviously ill-favored: int depth(Tree tree) { if (tree instanceof Empty) depth((Empty)tree) if (tree instanceof Leaf) depth((Leaf)tree); if (tree instanceof Node) depth((Node)tree); else throw new RuntimeException("Don't know how to find depth of " + tree.getClass()); }

    Read the article

  • No Commons Logging in Android?

    - by Joe Boese
    Hello all, I have a pretty big library I developed specifically for use in my Android Application. However business logic itself has no dependency on Android. To preserve that, I used Commons Logging throughout this library and it's respective JUnit tests (which I run in Eclipse). However now that I am starting to integrate it into an Activity which I launch on Android, I am unable to get my logging to work. In Eclipse/JUnit, I had simply pulled in log4j's jar file as well as a log4j.properties file. This doesn't seem to work when deploying to a device. After struggling with attempting to get that to work for several hours, I gave up and tried replacing all my commons logging stuff with android.util.Log. Now I can log on the device.. but all JUnit tests are broken. When any JUnit tries to log using android.util.Log, it throws a RuntimeException 'Stub!'. I would prefer to revert to my commons logging approach.. if anyone can help with that.. otherwise.. what can I do to get my JUnit test cases running using 'android.util.Log'? Many thanks in advance.. I've spent more than a few hours on this and I'd like to move on to writing real code again! Joe

    Read the article

  • Powershell / .Net: Get a reference to an object returned by a method

    - by Dan Menes
    I am teaching myself PowerShell by writing a simple parser. I use the .Net framework class Collections.Stack. I want to modify the object at the top of the stack in place. I know I can pop() the object off, modify it, and then push() it back on, but that strikes me as inelegant. First, I tried this: $stk = new-object Collections.Stack $stk.push( (,'My first value') ) ( $stk.peek() ) += ,'| My second value' Which threw an error: Assignment failed because [System.Collections.Stack] doesn't contain a settable property 'peek()'. At C:\Development\StackOverflow\PowerShell-Stacks\test.ps1:3 char:12 + ( $stk.peek <<<< () ) += ,'| My second value' + CategoryInfo : InvalidOperation: (peek:String) [], RuntimeException + FullyQualifiedErrorId : ParameterizedPropertyAssignmentFailed Next I tried this: $ary = $stk.peek() $ary += ,'| My second value' write-host "Array is: $ary" write-host "Stack top is: $($stk.peek())" Which prevented the error but still didn't do the right thing: Array is: My first value | My second value Stack top is: My first value Clearly, what is getting assigned to $ary is a copy of the object at the top of the stack, so when I the object in $ary, the object at the top of the stack remains unchanged. Finally, I read up on teh [ref] type, and tried this: $ary_ref = [ref]$stk.peek() $ary_ref.value += ,'| My second value' write-host "Referenced array is: $($ary_ref.value)" write-host "Stack top is still: $($stk.peek())" But still no dice: Referenced array is: My first value | My second value Stack top is still: My first value I assume the peek() method returns a reference to the actual object, not the clone. If so, then the reference appears to be being replaced by a clone by PowerShell's expression processing logic. Can somebody tell me if there is a way to do what I want to do? Or do I have to revert to pop() / modify / push()?

    Read the article

  • How to handle custom Java exception in Flex app.

    - by mico
    Hello, we are using BlazeDS as a proxy between Flex and Java. The approach is the same as in (http://www.flexpasta.com/index.php/2008/05/16/exception-handling-with-blazeds-and-flex/) Java exception declaration: public class FlexException extends RuntimeException { private String name = 'John'; public FlexException(String message) { super(message); } public String getName() { return name; } } Then, we are throwing it: public void testMethod(String str) throws Exception { throw new FlexException("Custom exception"); } Flex part: private function faultHandler(event:FaultEvent):void { var errorMessage:ErrorMessage = event.message as ErrorMessage; trace("error++"); } and remote object is instantiated here: <mx:RemoteObject id="mySample" destination="mySample" channelSet="{cs1}" fault="faultHandler(event)" /> But in event.fault I get "Server.Processing" and event.faultString equals "There was an unhandled failure on the server. Custom exception" How can I receive the data is specified in exception props ? BlazeDS log is similar to the log that was mentioned in the comment [BlazeDS] 11:28:13.906 [DEBUG] Serializing AMF/HTTP response Version: 3 (Message #0 targetURI=/2/onStatus, responseUR|-) (Typed Object #0 ‘flex.messaging.messages.ErrorMessage’) headers = (Object #1) rootCause = null body = null correlationId = “2F1126D7-5658-BE40-E27C-7B43F3C5DCDD” faultDetail = null faultString = “Login required before authorization can proceed.” clientId = “C4F0E77C-3208-ECDD-1497-B8D070884830? timeToLive = 0.0 destination = “books” timestamp = 1.204658893906E12 extendedData = null faultCode = “Client.Authentication” messageId = “C4F0E77C-321E-6FCE-E17D-D9F1C16600A8? So the quesion is why rootClause is null? How can I get that Exception object not just a string 'Custom exception'?

    Read the article

  • How to use Struts2-jQuery Plugin with sitemesh

    - by fayway
    Hi I have this error when I try to include the tag (http://code.google.com/p/struts2-jquery/wiki/HeadTag) in a sitemesh decorator main.jsp (decorator) <%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %> <%@ taglib prefix="s" uri="/struts-tags"%> <%@ taglib prefix="sj" uri="/struts-jquery-tags"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>My Project- <decorator:title /></title> <sj:head compressed="false" jqueryui="true"></sj:head> </head> <body> <!-- head --> .... Tomcat Error exception java.lang.RuntimeException: org.apache.jasper.JasperException: An exception occurred processing JSP page /decorators/main.jsp at line 11 8: <head> 9: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 10: <title>My Project- <decorator:title /></title> 11: <sj:head compressed="false" jqueryui="true"></sj:head> 12: </head> 13: <body> 14: <!-- head --> Stacktrace: com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator.render(BaseWebAppDecorator.java:39) com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:84) Please any idea ? Thanks in advance

    Read the article

  • "SessionId doesn't exist" error when starting Selenium server

    - by ripper234
    I'm raising a Selnium-server (the jar), and getting this exception without trying to talk to the server. What can be the cause? The errors keep coming in once every 2 seconds. Could this be some leftover from a previous Selenium run? C:\Foo>java -jar ..\..\..\..\lib\Selenium\selenium-server.jar 14:53:30.141 INFO - Java: Sun Microsystems Inc. 14.2-b01 14:53:30.142 INFO - OS: Windows Server 2008 6.1 amd64 14:53:30.149 INFO - v1.0.1 [2696], with Core v@VERSION@ [@REVISION@] 14:53:30.209 INFO - Version Jetty/5.1.x 14:53:30.210 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver] 14:53:30.211 INFO - Started HttpContext[/selenium-server,/selenium-server] 14:53:30.211 INFO - Started HttpContext[/,/] 14:53:30.217 INFO - Started SocketListener on 0.0.0.0:4444 14:53:30.218 INFO - Started org.mortbay.jetty.Server@2747ee05 14:53:31.729 INFO - Checking Resource aliases 14:53:31.735 WARN - POST /selenium-server/driver/?seleniumStart=true&localFrameAddress=top&seleniumWindowName= &uniqueId=sel_27224&sessionId=1f2385b8bae24f6fb79816753de7cd69&counterToMakeURsUniqueAndSoStopPageCachingInThe Browser=1255006411692&sequenceNumber=268 HTTP/1.1 java.lang.RuntimeException: sessionId 1f2385b8bae24f6fb79816753de7cd69 doesn't exist; perhaps this session was already stopped? at org.openqa.selenium.server.FrameGroupCommandQueueSet.getQueueSet(FrameGroupCommandQueueSet.java:218 ) at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleBrowserResponse(SeleniumDriverResour ceHandler.java:159) at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java: 127) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:820) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

    Read the article

  • Getting message in android app: Binary XML file line #2: You must supply a layout_width attribute.

    - by opike
    I'm trying to use a ListView inside of a RelativeLayout but when I run my app I get a runtimeexception with the message: Binary XML file line #2: You must supply a layout_width attribute. I tried putting layout_width attributes in every conceivable place in the xml resource files but so far no luck. I attempt to populate the listview with this line of code: setListAdapter(new ArrayAdapter(this, R.layout.tablerow3, R.id.label, items)); Here's the tablerow3.xml contents: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"> android:layout_width="20dp" android:layout_height="5dp" android:id="@+id/tablerow01"> <Label android:id="@+id/label01" android:layout_width="5dp" android:layout_height="5dp" android:textColor="@color/solid_white" android:singleLine="true"/> <Label android:id="@+id/label02" android:layout_width="5dp" android:layout_height="5dp" android:textColor="@color/solid_white" android:singleLine="true"/> </LinearLayout> Here's the xml that contains the RelativeLayout(forex2.xml): <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Button android:text="Static Button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:id="@+id/button_id"> </Button> <Spinner android:id="@+id/spinner1" android:layout_width="match_parent" android:layout_toRightOf="@id/button_id" android:layout_alignParentTop="true" android:layout_height="wrap_content" android:drawSelectorOnTop="true" /> <ListView android:id="@android:id/list" android:layout_width="5dp" android:layout_height="5dp" android:layout_alignParentBottom="true" /> <!-- android:layout_width="wrap_content" android:layout_height="wrap_content" --> </RelativeLayout>

    Read the article

  • Groovlet + Tomcat: "unable to resolve class" when importing libraries

    - by Rob Hruska
    I'm having some trouble running a groovy servlet (groovlet) in tomcat that imports a library class. When I don't import anything the groovlet works correctly, but if I do import something that I expect to be on the classpath (I can import the same class successfully in a regular servlet), I see the following error: groovy.util.ScriptException: Could not parse scriptName: /MyGroovlet.groovy java.lang.RuntimeException: groovy.util.ScriptException: Could not parse scriptName: /MyGroovlet.groovy at groovy.servlet.GroovyServlet$1.call(GroovyServlet.java:123) ... Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, /MyGroovlet.groovy: 1: unable to resolve class com.mycompany.mypackage.MyLibraryClass @ line 1, column 1. The jar containing MyLibraryClass is in shared/lib, which is loaded by tomcat by the following in catalina.properties: shared.loader=...,${catalina.base}/shared/lib/*.jar,... My groovlets are mapped as described in the user guide in my application's web.xml: <servlet> <servlet-name>GroovyServlet</servlet-name> <servlet-class>groovy.servlet.GroovyServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>GroovyServlet</servlet-name> <url-pattern>*.groovy</url-pattern> </servlet-mapping> And here's the code for the groovlet, MyGroovlet.groovy: import com.mycompany.mypackage.MyLibraryClass MyLibraryClass.someStaticMethod() My groovlet is deployed to WEB-INF/groovy/MyGroovlet.groovy, per the GroovyServlet API. When I visit http://localhost:8080/myapplication/MyGroovlet.groovy, the error described previously is written to my application logs. Is there some way that I need to explicitly declare the runtime classpath for GroovyServlet? I've tried moving the library jar to several places, including WEB-INF/lib and moving the actual MyLibraryClass.class file to WEB-INF/classes, but with no luck.

    Read the article

  • eclipse adt 17 and the libs folder

    - by max4ever
    Ok so i update to eclipse adt to version 17 and I get this error 04-05 12:28:55.810: E/AndroidRuntime(5470): FATAL EXCEPTION: main 04-05 12:28:55.810: E/AndroidRuntime(5470): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.galeola.agentis/com.galeola.agentis.activity.GestionaleActivity}: java.lang.ClassNotFoundException: com.galeola.agentis.activity.GestionaleActivity in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/com.galeola.agentis-1.apk] 04-05 12:28:55.810: E/AndroidRuntime(5470): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1742) 04-05 12:28:55.810: E/AndroidRuntime(5470): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1834) 04-05 12:28:55.810: E/AndroidRuntime(5470): at android.app.ActivityThread.access$500(ActivityThread.java:122) 04-05 12:28:55.810: E/AndroidRuntime(5470): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1027) 04-05 12:28:55.810: E/AndroidRuntime(5470): at android.os.Handler.dispatchMessage(Handler.java:99) 04-05 12:28:55.810: E/AndroidRuntime(5470): at android.os.Looper.loop(Looper.java:132) 04-05 12:28:55.810: E/AndroidRuntime(5470): at android.app.ActivityThread.main(ActivityThread.java:4126) 04-05 12:28:55.810: E/AndroidRuntime(5470): at java.lang.reflect.Method.invokeNative(Native Method) 04-05 12:28:55.810: E/AndroidRuntime(5470): at java.lang.reflect.Method.invoke(Method.java:491) 04-05 12:28:55.810: E/AndroidRuntime(5470): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844) 04-05 12:28:55.810: E/AndroidRuntime(5470): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602) 04-05 12:28:55.810: E/AndroidRuntime(5470): at dalvik.system.NativeStart.main(Native Method) 04-05 12:28:55.810: E/AndroidRuntime(5470): Caused by: java.lang.ClassNotFoundException: com.galeola.agentis.activity.GestionaleActivity in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/com.galeola.agentis-1.apk] 04-05 12:28:55.810: E/AndroidRuntime(5470): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:251) 04-05 12:28:55.810: E/AndroidRuntime(5470): at java.lang.ClassLoader.loadClass(ClassLoader.java:540) 04-05 12:28:55.810: E/AndroidRuntime(5470): at java.lang.ClassLoader.loadClass(ClassLoader.java:500) 04-05 12:28:55.810: E/AndroidRuntime(5470): at android.app.Instrumentation.newActivity(Instrumentation.java:1022) 04-05 12:28:55.810: E/AndroidRuntime(5470): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1733) 04-05 12:28:55.810: E/AndroidRuntime(5470): ... 11 more however if i move my libraries to /libs i can start the applications, but with the libraries in /libs javadoc and javasources stops working, while if they are not in /libs javadoc and javasource works, so I don't understand why.

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14  | Next Page >