Forum Discussion

vadimator's avatar
vadimator
New Contributor
6 years ago
Solved

ERROR: java.lang.IllegalArgumentException: Name is not valid

Hey guys! I couldn't find answer to this question anywhere, so decided to ask community. For some reason Tech support is too slow. In short: I no longer can Save or Save As or Export one of my pr...
  • richie's avatar
    6 years ago

    Hey vadimator 

     

    Ok - I don't know if I can help cos I haven't seen this before but I'll try.  If you can save/save as/export other projects then the problem would appear to be some sort of corruption with the .xml file itself.

     

    So you have say a week's worth of changes that you're going to lose - right?  do you have a version controlled version by any chance?  probably not if you're raising this ticket. -but I had to ask - cos that'll take  all the effort out of the heavy lifting.

     

    anyway - navigate to the file's location and take a copy of the file - so worst case - you have a spare copy. you can do this with the project .xml file - I've just tested this and its fine with unsaved changes.

     

    according to what you said - you don't actually know when it started occuring - right?  so you could have only lost 1 days worth of changes?

     

    Now - this is either straightforward or not  - if the file's corruption was bad enough that it resulted in malformed xml you shouldn't be able to open the  project in ReadyAPI!.

     

    Try and open a spare copy of the project file in software with an XML parser (like XMLSpy or Notepad++ with the XMLplugins.  If the file is malformed you should get a warning about substitution characters - if it's not malformed xml - can you look through the file to see if anything pops out?  That's a really rubbish suggestion though - cos its unlikely you'll spot the problem

     

    This next might help - looking at the stack trace (and I don't know how ReadyAPI! stacktraces are logged) - sometimes I can see a problem in a stacktrace - sometimes I can't - but it mentions the following:

     

    java.lang.IllegalArgumentException: Name is not valid
    at org.apache.xmlbeans.impl.store.Cursor.validateLocalName(Cursor.java:125)
    at org.apache.xmlbeans.impl.store.Cursor._insertElementWithText(Cursor.java:1715)
    at org.apache.xmlbeans.impl.store.Cursor._insertElementWithText(Cursor.java:1711)
    at org.apache.xmlbeans.impl.store.Cursor.insertElementWithText(Cursor.java:4163)
    at com.eviware.soapui.support.xml.XmlObjectConfigurationBuilder.add(XmlObjectConfigurationBuilder.java:50)
    at com.eviware.soapui.impl.wsdl.teststeps.datasource.DataGenerator.UI.DataGeneratorDataSource.save(DataGeneratorDataSource.java:407)
    at com.eviware.soapui.impl.wsdl.teststeps.datasource.AbstractDataSource.saveConfig(AbstractDataSource.java:77)

    so - I'm totally guessing here - interpreting the content in the stacktrace, it 'appears' to be that you created some object with a name it didn't like - perhaps on a datasource object.  I'd go back to ReadyAPI! and look at each of the objects in your project (focusing first on Datasource type objects first just in case) and  rename each object ensuring you haven't managed to insert an illegal character into a name - every so often  - see if you can successfully hit save monitoring  the stacktrace.

     

    Overwrite all the names of every object in your project ensuring you haven't got any dodgy characters in there.

     

    That's my best guess at fixing this

     

    nice one,

     

    richie

  • vadimator's avatar
    vadimator
    6 years ago

    Thanks richie  for your reply. 

    My project xml file's Date modified is 2/14/19, so that tells me that it was the last day when it successfully saved. That file I'm able to open in a new instance of the ReadyAPI with no problem since there is no error in the xml, but unfortunately the one with the issue I'm not able to open seperately in Note++ to investigate xml because I can't save it in the first place.

    So far, I've gone through all project and renamed all the Test Case/Suites/Property names that contained any special characters except "_". (Underscore did not give problems before, so I left it.). No success yet.

     

    Next I'm planning to start deleting Data Source objects one by one and trying to save. I've read somewhere that whenever you moving objects up or down your file tree with your mouse it can cause breakage in project xml file, and I've done that a lot :(

     

    If you have any other ideas please share

    Thanks,