classcastexception

java.lang.ClassCastException: com.sun.faces.facelets.compiler.UIInstructions cannot be cast to org.primefaces.model.menu.MenuElement

白昼怎懂夜的黑 提交于 2019-12-02 21:50:40
This morning I came in to my office and the first thing I saw: my company site crashed. Because of me I think. Now I tried for one hour and a half to fix this, but I found nothing and everybody looses their mind because the website doesn't work and I can't fix it (i'm alone. The creators of the site are gone or in holidays). So I hope you can help me out! I get this exception, when I call the dashboard.xhtml of my website. java.lang.ClassCastException: com.sun.faces.facelets.compiler.UIInstructions cannot be cast to org.primefaces.model.menu.MenuElement My problem is: in the whole exception,

Android ClassCastException for RadioGroup into RadioButton

随声附和 提交于 2019-12-02 21:01:14
问题 This error just popped out of nowhere. Everything was working smoothly for the last 2 days. So why is this incorrect: In Questionnaire1.java snippet at line 45 for onCreate(): r_male = (RadioButton) findViewById(R.id.radio_male); r_female = (RadioButton) findViewById(R.id.radio_female); q1.xml snippet is as follows: <RadioGroup android:id="@+id/radiogroup1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:weightSum="100" android

Hibernate Class Cast Exception

前提是你 提交于 2019-12-02 14:01:08
问题 I am getting a class cast exception with hibernate when trying to cast the result set to the mapping class... I am able to see the data in the result set that is returned...however it comes back as an Object [] and I am able to set the Object [] to the a List...Am I doing my hibernate mappings correctly? I get the correct data back from the query but its not mapping correctly... Mapping <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate

What is wrong here? I get a java.lang.ClassCastException error but I can't see where I have gone wrong

折月煮酒 提交于 2019-12-02 13:01:33
问题 This is the first time I have really used Lists and Queues so this might be a very simple mistake. Is it because my queue is full of objects that can't be cast to integers? //populate array for(int i=0; i<11; i++){ numberarray[i] = i; } // populate list with numbers from array List numList = Arrays.asList(numberarray); Collections.shuffle(numList); Queue queue = new LinkedList(); queue.addAll(numList); int num1 = (Integer) queue.poll(); assignPictures(button01, num1); 回答1: You really should

Android ClassCastException for RadioGroup into RadioButton

。_饼干妹妹 提交于 2019-12-02 10:16:25
This error just popped out of nowhere. Everything was working smoothly for the last 2 days. So why is this incorrect: In Questionnaire1.java snippet at line 45 for onCreate(): r_male = (RadioButton) findViewById(R.id.radio_male); r_female = (RadioButton) findViewById(R.id.radio_female); q1.xml snippet is as follows: <RadioGroup android:id="@+id/radiogroup1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:weightSum="100" android:paddingLeft="10pt" android:paddingBottom="10pt" > <RadioButton android:id="@+id/radio_male" android

Can't put Double number in BigDecimal variable

北城以北 提交于 2019-12-02 08:35:22
I'm using a Double variable which holds the Item price. That variable is stored in postgresql database under a column of money type. I use setBigDecimal(position,value) SQL function.In other part, i'm using a JSpinner as input. Double current = 0.0; Double min = (double) Integer.MIN_VALUE; Double max = (double) Integer.MAX_VALUE; Double step = 0.1; JSpinner priceSpinner = new JSpinner(new SpinnerNumberModel(current, min, max, step)); When the user clicks on a button, I get the value entred by the user and put it in the database via SQL query. insertStmt.setBigDecimal(position,BigDecimal

android classcastexception at android.app.Application

独自空忆成欢 提交于 2019-12-02 07:40:34
问题 i have the following exception when i running the following application Activity: package com.google.android.SmartStudentmCompanion; import java.io.BufferedReader; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.client.HttpClient; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; import org.apache.http.message

java.lang.ClassCastException with the same class object

不问归期 提交于 2019-12-02 07:36:05
问题 This piece of code irritates me, sometimes it working and some other times it doesn't ! The NamedQuery : (name = "User.findByLogin", query = "SELECT u FROM User u WHERE u.login = :login") public User findByLogin(String login) { Query query = em.createNamedQuery("User.findByLogin"); query.setParameter("login", login); try { return (User) query.getSingleResult(); } catch (javax.persistence.NoResultException ex) { return null; } } The error make me crazy ! Avertissement: EJB5184: A system

Class cast exception in Groovy

送分小仙女□ 提交于 2019-12-02 07:12:54
I want to upload an image using a groovy on grails. My gsp page is as follows (I am showing a simplified version of the original) <g:form controller="post" action="save" enctype="multipart/form-data"> My picture <input type="file" name="myPicture" /> <g:submitButton name="submit" value="Save"/> </g:form> My domain class is as follows: class Post { byte[] myPicture static mapping = { myPicture type: "blob" } I need this mapping otherwise MySql will create a smallblob which is to small to fit the images static constraints = { myPicture(nullable:false) } } At the controller I have an action

Android java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to android.widget.EditText

≡放荡痞女 提交于 2019-12-02 06:09:37
问题 I get the following exception in Android when clicking a button to take me from an activity to another (I'm new in Android development, so it may not be the brightest of questions): java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to android.widget.EditText I have tried cleaning the project several times, I've tried the option Fix Project Properties from Android Tools, I've checked my xml for mistakes but I just can't seem to figure this out. I have to mention that