On Mon, Feb 02, 2009 at 01:54:49PM +0900, Coe, Colin C. (Unix Engineer) wrote:
> 
> Hi all
> 
> I'm currently working on getting the Spacewalk web GUI to be able to create 
> and manage Cobbler snippets.
> 
> Right now I'm getting the following compile time error.
> 
> ---
> compile-main:
>     [javac] Compiling 5 source files to 
> /home/coec/git/spacewalk/java/build/classes
>     [javac] 
> /home/coec/git/spacewalk/java/code/src/com/redhat/rhn/frontend/action/kickstart/cobbler/CobblerSnippetEditAction.java:28:
>  cannot find symbol
>     [javac] symbol  : constructor CobblerSnippetEditCommand(java.lang.Long)
>     [javac] location: class 
> com.redhat.rhn.manager.kickstart.cobbler.CobblerSnippetEditCommand
>     [javac]         return new CobblerSnippetEditCommand(
>     [javac]                ^
>     [javac] Note: 
> /home/coec/git/spacewalk/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSnippetEditCommand.java
>  uses or overrides a deprecated API.
>     [javac] Note: Recompile with -Xlint:deprecation for details.
>     [javac] Note: 
> /home/coec/git/spacewalk/java/code/src/com/redhat/rhn/frontend/struts/RequestContext.java
>  uses unchecked or unsafe operations.
>     [javac] Note: Recompile with -Xlint:unchecked for details.
>     [javac] 1 error
> ---
> 
> In 
> java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSnippetEditCommand.java
>  I have
> ---
> public class CobblerSnippetEditCommand extends BaseCobblerSnippetCommand {
> 
>     /**
>      * Create new Command and Key
>      * @param snippetName of key to lookup.
>      */
>     public CobblerSnippetEditCommand(String snippetName) {
>         super();
>     }
> ---
> 
> In 
> java/code/src/com/redhat/rhn/frontend/action/kickstart/cobbler/CobblerSnippetEditAction.java
>  I have
> ---
> public class CobblerSnippetEditAction extends BaseCobblerSnippetEditAction {
> 
>     protected BaseCobblerSnippetCommand getCommand(RequestContext ctx) {
>         return new CobblerSnippetEditCommand(
>                 ctx.getRequiredParam(RequestContext.NAME));
>     }
> 
> }
> ---
> 
> git diff code/src/com/redhat/rhn/frontend/struts/RequestContext.java
> ---
> diff --git a/java/code/src/com/redhat/rhn/frontend/struts/RequestContext.java 
> b/java/code/src/com/redhat/rhn/frontend/struts/RequestContext.java
> index 1ca3636..7092612 100644
> --- a/java/code/src/com/redhat/rhn/frontend/struts/RequestContext.java
> +++ b/java/code/src/com/redhat/rhn/frontend/struts/RequestContext.java
> @@ -92,6 +92,7 @@ public class RequestContext {
>      public static final String KICKSTART_SCRIPT_ID = "kssid";
>      public static final String CONFIG_FILE_ID = "cfid";
>      public static final String SERVER_GROUP_ID = "sgid";
> +    public static final String NAME = "name";
>      // Request Attributes go here:
>      public static final String ACTIVATION_KEY = "activationkey";
>      public static final String KICKSTART = "ksdata";
> ---
> 
> 
> However the error talks about 'constructor 
> CobblerSnippetEditCommand(java.lang.Long)' but this is supposed to be a 
> string.  Could someone point me in the right direction?

getRequiredParam(String) returns a Long in RequestContext. Since your
CobblerSnippetEditCommand constructor is expecting a String , and
getRequiredParam returns Long, that's why you're getting that error.

Use getParam(String paramName, boolean required) as that method
returns a String.

-- 
jesus m. rodriguez        | [email protected]
sr. software engineer     | irc: zeus
rhn satellite & spacewalk | 919.754.4413 (w)
rhce # 805008586930012    | 919.623.0080 (c)
+-------------------------------------------+
|  "Those who cannot learn from history     |
|   are doomed to repeat it."               |
|                       -- George Santayana |
+-------------------------------------------+

_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to