java.lang.ClassCastException: java.util.ArrayList cannot be cast to org.jboss.forge.addon.resource.FileResource

JBoss Issue Tracker | Antonio Goncalves | 2 years ago
  1. 0

    When I scaffold a REST endpoint with several content types, I get an exception but the endpoint is created. When I execute the following script : {code} project-new --named test --topLevelPackage org.agoncal.training.javaee6adv --type war --finalName test jpa-new-entity --named Author ; jpa-new-field --named firstName --length 50 --columnName first_name ; jpa-new-field --named lastName --length 50 --columnName last_name ; jpa-new-field --named bio --length 5000 ; jpa-new-field --named dateOfBirth --type java.util.Date --temporalType DATE --columnName date_of_birth ; jpa-new-field --named age --type java.lang.Integer --transient ; rest-generate-endpoints-from-entities --targets org.agoncal.training.javaee6adv.model.Author --contentType application/xml application/json {code} I get the following output : {code} Exception when parsing/running: rest-generate-endpoints-from-entities --targets org.agoncal.training.javaee6adv.model.Author --contentType application/xml application/json , java.util.ArrayList cannot be cast to org.jboss.forge.addon.resource.Resource {code} With the following stack trace {code} 23:14:58,342 SEVERE [org.jboss.forge.addon.ui.impl.controller.AbstractCommandController] (AeshProcess: 8) Error while notifying listeners: java.lang.ClassCastException: java.util.ArrayList cannot be cast to org.jboss.forge.addon.resource.FileResource at org.jboss.forge.addon.projects.Projects.getSelectedProject(Projects.java:37) at org.jboss.forge.addon.projects.ui.ProjectBuildStatusListener.postCommandExecuted(ProjectBuildStatusListener.java:41) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45] at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45] at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:87) [furnace-proxy-2.10.1.Final.jar:2.10.1.Final] at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42) [furnace-api-2.10.1.Final.jar:2.10.1.Final] at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:103) [furnace-proxy-2.10.1.Final.jar:2.10.1.Final] at org.jboss.forge.addon.projects.ui.ProjectBuildStatusListener_$$_javassist_59d74715-a419-4cb7-bd02-126cfccbe569.postCommandExecuted(ProjectBuildStatusListener_$$_javassist_59d74715-a419-4cb7-bd02-126cfccbe569.java) at org.jboss.forge.addon.ui.impl.controller.AbstractCommandController.firePostCommandExecuted(AbstractCommandController.java:144) [ui-impl-2.10.1.Final.jar:2.10.1.Final] at org.jboss.forge.addon.ui.impl.controller.WizardCommandControllerImpl.execute(WizardCommandControllerImpl.java:155) [ui-impl-2.10.1.Final.jar:2.10.1.Final] at org.jboss.forge.addon.ui.impl.controller.NoUIWizardControllerDecorator.execute(NoUIWizardControllerDecorator.java:152) [ui-impl-2.10.1.Final.jar:2.10.1.Final] at org.jboss.forge.addon.shell.aesh.CommandAdapter.execute(CommandAdapter.java:74) [shell-impl-2.10.1.Final.jar:2.10.1.Final] at org.jboss.aesh.console.AeshConsoleImpl$AeshConsoleCallbackImpl.execute(AeshConsoleImpl.java:325) [aesh-0.56.1.jar:0.56.1] at org.jboss.aesh.console.AeshProcess.run(AeshProcess.java:40) [aesh-0.56.1.jar:0.56.1] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45] at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45] {code}

    JBoss Issue Tracker | 2 years ago | Antonio Goncalves
    java.lang.ClassCastException: java.util.ArrayList cannot be cast to org.jboss.forge.addon.resource.FileResource
  2. 0

    When I scaffold a REST endpoint with several content types, I get an exception but the endpoint is created. When I execute the following script : {code} project-new --named test --topLevelPackage org.agoncal.training.javaee6adv --type war --finalName test jpa-new-entity --named Author ; jpa-new-field --named firstName --length 50 --columnName first_name ; jpa-new-field --named lastName --length 50 --columnName last_name ; jpa-new-field --named bio --length 5000 ; jpa-new-field --named dateOfBirth --type java.util.Date --temporalType DATE --columnName date_of_birth ; jpa-new-field --named age --type java.lang.Integer --transient ; rest-generate-endpoints-from-entities --targets org.agoncal.training.javaee6adv.model.Author --contentType application/xml application/json {code} I get the following output : {code} Exception when parsing/running: rest-generate-endpoints-from-entities --targets org.agoncal.training.javaee6adv.model.Author --contentType application/xml application/json , java.util.ArrayList cannot be cast to org.jboss.forge.addon.resource.Resource {code} With the following stack trace {code} 23:14:58,342 SEVERE [org.jboss.forge.addon.ui.impl.controller.AbstractCommandController] (AeshProcess: 8) Error while notifying listeners: java.lang.ClassCastException: java.util.ArrayList cannot be cast to org.jboss.forge.addon.resource.FileResource at org.jboss.forge.addon.projects.Projects.getSelectedProject(Projects.java:37) at org.jboss.forge.addon.projects.ui.ProjectBuildStatusListener.postCommandExecuted(ProjectBuildStatusListener.java:41) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45] at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45] at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:87) [furnace-proxy-2.10.1.Final.jar:2.10.1.Final] at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42) [furnace-api-2.10.1.Final.jar:2.10.1.Final] at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:103) [furnace-proxy-2.10.1.Final.jar:2.10.1.Final] at org.jboss.forge.addon.projects.ui.ProjectBuildStatusListener_$$_javassist_59d74715-a419-4cb7-bd02-126cfccbe569.postCommandExecuted(ProjectBuildStatusListener_$$_javassist_59d74715-a419-4cb7-bd02-126cfccbe569.java) at org.jboss.forge.addon.ui.impl.controller.AbstractCommandController.firePostCommandExecuted(AbstractCommandController.java:144) [ui-impl-2.10.1.Final.jar:2.10.1.Final] at org.jboss.forge.addon.ui.impl.controller.WizardCommandControllerImpl.execute(WizardCommandControllerImpl.java:155) [ui-impl-2.10.1.Final.jar:2.10.1.Final] at org.jboss.forge.addon.ui.impl.controller.NoUIWizardControllerDecorator.execute(NoUIWizardControllerDecorator.java:152) [ui-impl-2.10.1.Final.jar:2.10.1.Final] at org.jboss.forge.addon.shell.aesh.CommandAdapter.execute(CommandAdapter.java:74) [shell-impl-2.10.1.Final.jar:2.10.1.Final] at org.jboss.aesh.console.AeshConsoleImpl$AeshConsoleCallbackImpl.execute(AeshConsoleImpl.java:325) [aesh-0.56.1.jar:0.56.1] at org.jboss.aesh.console.AeshProcess.run(AeshProcess.java:40) [aesh-0.56.1.jar:0.56.1] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45] at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45] {code}

    JBoss Issue Tracker | 2 years ago | Antonio Goncalves
    java.lang.ClassCastException: java.util.ArrayList cannot be cast to org.jboss.forge.addon.resource.FileResource
  3. 0

    Collections which extend iterators

    Coderanch | 2 years ago | Henry Wong
    java.lang.ClassCastException: java.util.ArrayList$Itr cannot be cast to java.util.ArrayList
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Collections which extend iterators

    Coderanch | 2 years ago | claire bird
    java.lang.ClassCastException: java.util.ArrayList$Itr cannot be cast to java.util.ArrayList
  6. 0

    Sort elements of Java ArrayList

    Stack Overflow | 3 years ago | user2996028
    java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.Comparable

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      java.util.ArrayList cannot be cast to org.jboss.forge.addon.resource.FileResource

      at org.jboss.forge.addon.projects.Projects.getSelectedProject()
    2. Forge - Projects API
      ProjectBuildStatusListener.postCommandExecuted
      1. org.jboss.forge.addon.projects.Projects.getSelectedProject(Projects.java:37)
      2. org.jboss.forge.addon.projects.ui.ProjectBuildStatusListener.postCommandExecuted(ProjectBuildStatusListener.java:41)
      2 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[rt.jar:1.7.0_45]
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[rt.jar:1.7.0_45]
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[rt.jar:1.7.0_45]
      4. java.lang.reflect.Method.invoke(Method.java:606)[rt.jar:1.7.0_45]
      4 frames
    4. Furnace - Proxy Utilities
      ClassLoaderInterceptor$1.call
      1. org.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:87)[furnace-proxy-2.10.1.Final.jar:2.10.1.Final]
      1 frame
    5. Furnace - Runtime API
      ClassLoaders.executeIn
      1. org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)[furnace-api-2.10.1.Final.jar:2.10.1.Final]
      1 frame
    6. Furnace - Proxy Utilities
      ClassLoaderInterceptor.invoke
      1. org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:103)[furnace-proxy-2.10.1.Final.jar:2.10.1.Final]
      1 frame