No worries, Rusty! If you need help with anything, just shoot the questions
out.

-- Rick

On Jan 28, 2017 1:42 PM, "Rusty Wright" <rusty.wri...@gmail.com> wrote:

> I've retired and haven't done any programming in at least 5 years and have
> forgotten almost everything, which is why I was spaced out about
> configuring my ActionBeanContext subclass.
>
> Once I studied my web.xml I would have known. I was thinking that the code
> could be self documenting if there was an annotation, one that did had the
> same effect as the ActionBeanContext.Class init param in the web.xml.
>
>
>
> On Fri, Jan 27, 2017 at 5:57 PM, Rusty Wright <rusty.wri...@gmail.com>
> wrote:
>
>> My fault; I'm a dummy.  I wasn't paying attention and didn't put my
>> ActionBeanContext subclass in the Extension.Packages.
>>
>> On Fri, Jan 27, 2017 at 10:45 AM, Rusty Wright <rusty.wri...@gmail.com>
>> wrote:
>>
>>> The link to it is on
>>>
>>> https://stripesframework.atlassian.net/wiki/display/STRIPES/
>>> Maven2+Archetype+for+Stripes
>>>
>>> In any event, I'll try the link you've provided.
>>>
>>>
>>>
>>> On Fri, Jan 27, 2017 at 10:41 AM, Rick Grashel <rgras...@gmail.com>
>>> wrote:
>>>
>>>> Hi Rusty,
>>>>
>>>> I've never seen that project before.  If you are trying to set up a
>>>> Maven project, you might want to start from the Stripes Example Webapp (and
>>>> the POM) straight out of Jenkins:
>>>>
>>>> https://stripesframework.ci.cloudbees.com/job/Stripes%20Mast
>>>> er/857/net.sourceforge.stripes$stripes-examples/
>>>>
>>>> That should actually work and it is built daily.
>>>>
>>>> -- Rick
>>>>
>>>>
>>>> On Fri, Jan 27, 2017 at 12:29 PM, Rusty Wright <rusty.wri...@gmail.com>
>>>> wrote:
>>>>
>>>>> (Thumbnail synopsis; the app blows up with ClassCastException when I
>>>>> extend ActionBeanContext.)
>>>>>
>>>>> This was downloaded from
>>>>>
>>>>>   https://sourceforge.net/projects/mvnstripes/files/stripes-qu
>>>>> ickstart-1.0/1.0/stripes-archetype-quickstart-1.0.jar/download
>>>>>
>>>>> Using eclipse with its built in maven I couldn't get it to create a
>>>>> new maven project by adding the archetype using the eclipse dialog box for
>>>>> creating a new project, where you can type in all of the parameters into
>>>>> the dialog box (archetypeArtifactId etc.)  So I downloaded the jar
>>>>> file, extracted it, and manually copied the files into a new maven project
>>>>> where the selected archetype was groupid= org.apache.maven.archetypes
>>>>> and the artifact id= maven-archetype-webapp, version 1.0, and fixed the
>>>>> places and replaced ${groupId} with mine (com.objecteffects) and
>>>>> ${artifactId} with sample.
>>>>>
>>>>> I couldn't change the eclipse project facet Dynamic Web Module from
>>>>> 2.3 to 2.4 (to match the web-app 2.4 version in web.xml) so I resorted to
>>>>> brute force and edited org.eclipse.wst.common.project.facet.core.xml
>>>>> and changed it to 2.4 there.  Being paranoid since I'm editing one of
>>>>> eclipse's files I exited and then started it.  Then right clicked on the
>>>>> project and ran maven -> Update Project, followed by a menu Project ->
>>>>> Clean... and that finally got rid of the red error flag on the project.
>>>>>
>>>>>
>>>>> I created an eclipse run configuration for maven with the goal
>>>>> jetty:run and ran that, then waited for maven to download a billion and 
>>>>> one
>>>>> jar files and start jetty, which it finally did.
>>>>>
>>>>> Opened the url localhost:8080/sample and got the Home.html
>>>>> "Congratulations!" page. (But with some intervening flailing around until 
>>>>> I
>>>>> remembered that I needed to replace the ${package} in web.xml (global
>>>>> search and replace never seems to come to mind in these situations).
>>>>>
>>>>> Next, I created a new Action Bean Context class:
>>>>>
>>>>> package com.objecteffects.sample.action;
>>>>>
>>>>> import net.sourceforge.stripes.action.ActionBeanContext;
>>>>>
>>>>> /**
>>>>>  */
>>>>> public class SampleActionBeanContext extends ActionBeanContext {
>>>>> }
>>>>>
>>>>> Then I changed the BaseActionBean to use this class:
>>>>>
>>>>> package com.objecteffects.sample.action;
>>>>>
>>>>> import net.sourceforge.stripes.action.ActionBean;
>>>>> import net.sourceforge.stripes.action.ActionBeanContext;
>>>>>
>>>>> public class BaseActionBean implements ActionBean {
>>>>>     private SampleActionBeanContext context;
>>>>>
>>>>>     public ActionBeanContext getContext() {
>>>>>         return this.context;
>>>>>     }
>>>>>
>>>>>     public void setContext(ActionBeanContext context1) {
>>>>>         this.context = (SampleActionBeanContext) context1;
>>>>>     }
>>>>> }
>>>>>
>>>>> Now when I try to open the page it blows up with a ClassCastException,
>>>>> "net.sourceforge.stripes.action.ActionBeanContext cannot be cast to
>>>>> com.objecteffects.sample.action.SampleActionBeanContext".  This is
>>>>> happening on the line "this.context = ...".
>>>>>
>>>>> The supplied pom.xml specifies 1.5 for the java language, and the
>>>>> project's properties has 1.5 for the java compiler JDK compliance.  But 
>>>>> I'm
>>>>> using jdk 1.8.0_111.
>>>>>
>>>>> I'm going to try replacing my 1.8 jdk with the 1.5 one and see if that
>>>>> fixes it, but while I'm in the process of that I thought I'd ask if anyone
>>>>> knows what's wrong?
>>>>>
>>>>> Thanks
>>>>>
>>>>>
>>>>> ------------------------------------------------------------
>>>>> ------------------
>>>>> Check out the vibrant tech community on one of the world's most
>>>>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>>>>> _______________________________________________
>>>>> Stripes-users mailing list
>>>>> Stripes-users@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/stripes-users
>>>>>
>>>>>
>>>>
>>>> ------------------------------------------------------------
>>>> ------------------
>>>> Check out the vibrant tech community on one of the world's most
>>>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>>>> _______________________________________________
>>>> Stripes-users mailing list
>>>> Stripes-users@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/stripes-users
>>>>
>>>>
>>>
>>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to