Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7855943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:32:09+00:00 2026-06-02T20:32:09+00:00

I created the following script in the script folder using netbeans. I can’t save

  • 0

I created the following script in the script folder using netbeans. I can’t save the domain class. Also, if I deploy the entire project as a war file, can I run the script using Windows scheduler?

Script

def json = ""
def txt = new URL("http://free.worldweatheronline.com/feed/weather.ashx?q=Singapore,Singapore&format=xml&num_of_days=1&key=b674fb7e94131612112609").text
def records = new XmlSlurper().parseText(txt)
def weather = records.weather
def dates = weather.date
def min = weather.tempMinC
def max = weather.tempMaxC
def img = weather.weatherIconUrl
def desc = weather.weatherDesc
def descLink = desc.toString().replaceAll(" ","%20")
println max
Weathers w  = new Weathers()
w.cityName="singapore"
w.day = dates
w.description =desc
w.max = max
w.img = img
w.min = min
w.url = "jk"

Domain class

package org.mPest

class Weathers {
    int id
    String day
    String min
    String max
    String img
    String description
    String cityName
    String url

static constraints = {
    id(blank:false, unique:true)
    cityName(blank:false)
    url(blank:false)

}

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:32:12+00:00Added an answer on June 2, 2026 at 8:32 pm

    You can’t use domain classes directly.

    See this FAQ to read how to use domain classes from src/groovy:

    import org.codehaus.groovy.grails.commons.ApplicationHolder
    //…
    def book = ApplicationHolder.application.getClassForName("library.Book").findByTitle("Groovy in Action")
    

    I don’t know if it possible to run the war packed script from windows but you could use the grails Quartz plugin to schedule your task…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created the following script to query a table and return the first 30
Based on a similar casestudy I've created the following bit of script to reveal/hide
I have created a file called untitled1.cpp in dev-cpp with the following script: #include
I'm using the following script in my website in order to create pagination next-previous
I have created following thing in android using android compatibility support package Basically i
When trying to deploy a VS2010 database project using the VSDBCMD tool, I get
I have created a new project in Xcode and performed the following to add
I have a Netbeans project that has a source folder (outside the Netbeans project
I have the following script to create a table: -- Create State table. DROP
following is the bash script I wrote for Sqlite. #!/bin/bash sqlite3 file.db CREATE TABLE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.