Date cant save into database - grails

I am new in groovy on grails.I am facing problem saving date from excelsheet into database. My date is of form 2014-02-15 . I made changes into config.groovy for date
grails.databinding.dateFormats = ['dd/mm/yyyy','yyyy-MM-dd']
But still it will show me error message like
ERROR context.GrailsContextLoader - Error initializing the application: Validation Error(s) occurred during save():
- Field error in object 'org.grails.importexcel.SandyData' on field 'purchaseOrderDate': rejected value [2014-02-15]; codes [org.grails.importexcel.SandyData.purchaseOrderDate.typeMismatch.error,org.grails.importexcel.SandyData.purchaseOrderDate.typeMismatch,sandyData.purchaseOrderDate.typeMismatch.error,sandyData.purchaseOrderDate.typeMismatch,typeMismatch.org.grails.importexcel.SandyData.purchaseOrderDate,typeMismatch.purchaseOrderDate,typeMismatch.java.lang.String,typeMismatch]; arguments [purchaseOrderDate]; default message [Could not find matching constructor for: java.lang.String(org.joda.time.LocalDate)]
Message: Validation Error(s) occurred during save():
Can anybody give me solutions for this.
Thanks

As I see you're trying to use JodaTime. Install Joda-Time plugin which provides integration with Joda and basic data bindings.

Related

ALM JIRA Integration

I have created a link between ALM and JIRA to sync defects from ALM to JIRA. The integrity check passed and after enabling and trying to sync, am getting the following error,
05/22/2017,02:27:31,654 INFO (Create.From1To2.Source-1) Synchronize: JIRA: Creating new issue
05/22/2017,02:27:32,874 INFO (Create.From1To2.Source-1) Synchronize: JIRA: refreshing the issue id:26906
05/22/2017,02:27:32,925 INFO (Create.From1To2.Source-1) Synchronize: JIRA: Updating issue id:26906
05/22/2017,02:27:33,494 ERROR (Create.From1To2.Source-1) Create: Fatal exception caught,operation terminated. Cause: create: fatal error update: fatal error {"errorMessages":["one of 'fields' or 'update' required"],"errors":{}}
05/22/2017,02:27:33,499 INFO (Disconnection.Adapter1) DisconnectAdapter: Disconnecting adapter HPE-ALM
05/22/2017,02:27:33,499 INFO (Disconnection.Adapter1) DisconnectAdapter: HPE-ALM: disconnect() called
05/22/2017,02:27:33,502 INFO (Disconnection.Adapter1) DisconnectAdapter: HPE-ALM: Call to disconnect
05/22/2017,02:27:34,550 INFO (Disconnection.Adapter1) DisconnectAdapter: HPE-ALM: Call to logout
Not sure what this really means as am relatively new to both products. Could anyone help on this please?
It looks like the issue with 26906 ID have some required fields.
You can figure out what this issue is via this URL: http://your-jira-server/rest/api/2/issue/26906. If you know the project of this issue and know which fields are required, this could already help.
If this information won't help you to figure out the actual reason of error, you can check which fields are actually required using this URL: http://your-jira-server/rest/api/2/issue/26906/editmeta. This should return you a JSON object, containing metadata about fields of given issue. Search for "required": true (or use jq utility) and figure out which fields are missing.
If the import failing during issue creation, you can try another URL: http://your-jira-server/rest/api/2/issue/createmeta?projectK‌​eys=~PROJECT_KEY~&is‌​suetypeNames=~ISSUE_‌​TYPE_NAME~&expand=pr‌​ojects.issuetypes.fi‌​elds which will give you JSON metadata for creating new issue. Using this information, you can check whether some of the fields are missing in the source data.

Element type \"field\" must be followed by either attribute specifications, \">\" or \"/>\"."

I am try to make a collection with my solr
_config. I get the following error:
{
"failure": {
"10.47.24.19:5285_solr": "org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at https://10.47.24.19:5285/solr: Error CREATEing SolrCore 'localWebCollection_shard1_replica2': Unable to create core [localWebCollection_shard1_replica2] Caused by: Element type \"field\" must be followed by either attribute specifications, \">\" or \"/>\".",
"10.44.121.52:6560_solr": "org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at https://10.44.121.52:6560/solr: Error CREATEing SolrCore 'localWebCollection_shard1_replica1': Unable to create core [localWebCollection_shard1_replica1] Caused by: Element type \"field\" must be followed by either attribute specifications, \">\" or \"/>\"."
}
I checked all the fields existing in my schema.xml. They are all closed with "/>". Any Ideas on how to fix this error?
Any helps or ideas would be highly appreciated.
Turned out the 'space' between two of the attributes in one of the fields was removed! Seeing this error you should make sure that in the schema.xml all the attributes of each one of the fields are properly separated and that you have quoted the values of any of the attributes like "body", "false", "true"...etc. properly.

solr 5.3.1 is giving org.apache.solr.common.SolrException: ERROR: [doc=model id] Error adding field

I was working on rails app and I want to use solr as search engine so I installed latest version of solr and while I was trying to index I was getting this error:
org.apache.solr.common.SolrException: ERROR: [doc=User 6] Error adding field 'published_at_d'='2012-07-13T20:58:58Z' msg=For input string: "2012-07-13T20:58:58Z"
at org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.java:176)
Caused by: java.lang.NumberFormatException: For input string: "2012-07-13T20:58:58Z"**
Please suggest possible solution to resolve it. I checked several sites and tried editing my solrconfig.xml file with date formats still it is not working.
Check your schema: the
published_at_d
field should have TrieDate as type. Here, it seems it has been defined as TrieLong or some other numeric type and that cause the NaN failure

Quickfixj rejecting incoming message with "Tag appears more than once" where there is no repeated tag

Quickfixj is rejecting the following logon message:
8=FIXT.1.1|9=163|35=A|34=77086|1128=9|49=XXxVENUExXX|56=XXxUSxXX|52=20140704-11:24:22.308|108=4|98=0|1137=9|789=78069|58=RFA:f718fdb8-2ed3-4e0b-965f-4305188d06f9|1409=0|1407=100|10=013|
The actual log entry for it is:
20140704-11:24:22.316 ERROR [QFJ Message Processor] quickfixj.errorEvent - FIXT.1.1:XXxUSxXX->XXxVENUExXX: Rejecting invalid message: quickfix.FieldException: Tag appears more than once, field=1407: 8=FIXT.1.1^A9=184^A35=A^A34=77086^A49=XXxVENUExXX^A52=20140704-11:24:22.308^A56=XXxUSxXX^A1128=9^A58=RFA:f718fdb8-2ed3-4e0b-965f-4305188d06f9^A98=0^A108=4^A553=USRC^A554=test234^A789=7806 9^A1137=9^A1407=100^A1409=0^A10=093^A
Tag 1407 doesn't appear more than once though. We're using Quickfixj 1.5.3. With a FIX Version 5.0 SP2 - EP100 data dictionary. I can't see any issues with the data dictionary entries. The Logon message fields are all flat (except for the optional MsgTypeGrp which is not being used). Have tried with ValidateFieldsOutOfOrder as both Y and N. Config entries are:
[DEFAULT]
ConnectionType=initiator
HeartBtInt=4
FileStorePath=/dir/storeLoc
FileLogPath=/dir/logLoc
StartDay=sun
StartTime=09:55:00
EndDay=sun
EndTime=09:45:00
UseDataDictionary=Y
AppDataDictionary=/dir/dicLoc/QuickFIX_EP100.xml
TransportDataDictionary=/dir/dicLoc/QuickFIX_EP100.xml
ValidateFieldsOutOfOrder=N
EnableNextExpectedMsgSeqNum=Y
# Only the SP2 version supported
DefaultApplVerID=9
DefaultApplExtID=100
BeginString=FIXT.1.1
TargetCompID=XXxVENUExXX
TargetSubID=XXxSUBxXX
# Endpoint
SocketConnectHost=xxx.xxx.xxx.xxx
SocketConnectPort=XXXXX
[SESSION]
SenderCompID=XXxUSxXX
SenderLocationID=XXxLocxXX
Anyone have any ideas what could cause this. It couldn't be because there is '1407' in today's date?

Error 500: Error processing GroovyPageView: null

I'm building a Grails/Groovy/GSP app.
I'm used to seeing errors such as "Cannot get property 'id' on null object", or "no property named ...". But I'm not sure what "null" by itself means!
Error 500: Error processing GroovyPageView: null
Just "null".
Now I understand that the full error stack is going to help, and I'm still studying it to understand the error. But I just wonder in general what type of error is just "null".
One other thing I noticed is that for error messages regarding groovy/gsp pages, the line numbers are always completely off and useless.
org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: null
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at gsp_shop_viewCategoryshow_gsp$_run_closure1.doCall(gsp_shop_viewCategoryshow_gsp.groovy:36)
at gsp_shop_viewCategoryshow_gsp$_run_closure1.doCall(gsp_shop_viewCategoryshow_gsp.groovy)
at gsp_shop_viewCategoryshow_gsp.run(gsp_shop_viewCategoryshow_gsp.groovy:54)
... 6 more
I'd again assume you are doing something with a null object in your gsp. If you don't see such a thing, go and fine gsp_shop_viewCategoryshow_gsp.groovy, and see what's there on line 36.
I'm not sure exactly where this file would reside, and it depends on the settings, but check your HOME/.grails folder.

Resources