getting error invalid bean definition with datasource

after completing installation on ubuntu, and while start deployed openboxes.war i am getting error (invalid bean definition with name ‘dataSource’ defined in null : could not resolve placeholder ‘destinationpartycode’

getting error (unexpected token : ) (dataSource.url=jdbc:mysql://localhost:3306/openboxes?useSSL=false).
while starting the deployed openboxes.war it does not accept the “:” in the dataSource.url

Could you post your openboxes-config.properties file, taking care to redact any sensitive information such as passwords and API keys?

Database connection settings

dataSource.username=
dataSource.password=
dataSource.url=jdbc:mysql://localhost:3306/openboxes?useSSL=false

Used primarily with g:link when absolute Url is true (e.g. links in emails)

grails.serverURL=http://localhost:8080/openboxes

That all looks ok to me.

It’s the destinationpartycode in the error that has me confused.

invalid bean definition with name ‘dataSource’ defined in null : could not resolve placeholder ‘destinationpartycode’

Would you mind sending your full catalina.out file to support@openboxes.com?

You could also schedule a troubleshooting call since this one is a bit of a puzzler.

Hi Justin
I sent you the log

So here’s the error from the log file.

Using configuration locations [classpath:openboxes-config.properties, classpath:openboxes-config.groovy, file:/opt/tomcat/.grails/openboxes-config.properties, file:/opt/tomcat/.grails/openboxes-config.groovy] [production]
Unable to load specified config location classpath:openboxes-config.properties : class path resource [openboxes-config.properties] cannot be opened because it does not exist
Unable to load specified config location classpath:openboxes-config.groovy : class path resource [openboxes-config.groovy] cannot be opened because it does not exist
Unable to load specified config location file:/opt/tomcat/.grails/openboxes-config.groovy : startup failed:
script16952289077291843229236.groovy: 3: unexpected token: : @ line 3, column 20.
   dataSource.url=jdbc:mysql://localhost:3306/openboxes?useSSL=false
                      ^

1 error

It looks like you have create two configuration files

  • openboxes-config.properties
  • openboxes-config.groovy.

That is ok. You can use either or both. In fact, I do that myself in most environments because *.properties files don’t handle complex objects or boolean values well. So I generally put the configuration that is required to start OpenBoxes in openboxes-config.properties and all of my custom configuration in openboxes-config.groovy.

The problem that you are encountering is due to the fact that the syntax for the two files is not interchangeable.

openboxes-config.properties expects the following format

dataSource.username = username
dataSource.password = password
dataSource.url = jdbc:mysql://localhost:3306/openboxes?useSSL=false

while openboxes-config.groovy expects this fomat

dataSource.username = "username"
dataSource.password = "password"
dataSource.url = "jdbc:mysql://localhost:3306/openboxes?useSSL=false"

For now you probably don’t have a need for custom configuration so just empty openboxes-config.groovy to be safe. Going forward, I would recommend keeping the dataSource and grails.serverURL properties in openboxes-config.properties and everything else can go into openboxes-config.groovy.

Hi Justin
Thank you for your quick response. I shall do the changes tomorrow and see what happens.

Regards

Hi Justin,
Ok the problem is fixed and app is up and running.

Now i have loaded my products successfully.

But when loading the inventory using the template i get the below error. Can you assist please?

Error 500:
Servlet:
URI:
Exception Message: No signature of method: java.lang.Double.trim() is applicable for argument types: () values: [] Possible solutions: wait(), trunc(), wait(long), div(java.lang.Number), print(java.lang.Object), div(java.lang.Character)
Caused by: No signature of method: java.lang.Double.trim() is applicable for argument types: () values: [] Possible solutions: wait(), trunc(), wait(long), div(java.lang.Number), print(java.lang.Object), div(java.lang.Character)
Class: GrailsFragmentCachingFilter
At Line: [66]
Code Snippet:

groovy.lang.MissingMethodException: No signature of method: java.lang.Double.trim() is applicable for argument types: () values: []
Possible solutions: wait(), trunc(), wait(long), div(java.lang.Number), print(java.lang.Object), div(java.lang.Character)

at org.pih.warehouse.inventory.InventoryService$_validateInventoryData_closure87.doCall(InventoryService.groovy:2722)

at org.pih.warehouse.inventory.InventoryService.validateInventoryData(InventoryService.groovy:2691)

at org.pih.warehouse.inventory.InventoryService$$FastClassByCGLIB$$a7f866ff.invoke(<generated>)

at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)

at org.pih.warehouse.inventory.InventoryService$$EnhancerByCGLIB$$1dec85b1.validateInventoryData(<generated>)

at org.pih.warehouse.inventory.InventoryService$validateInventoryData.call(Unknown Source)

at org.pih.warehouse.importer.InventoryExcelImporter.validateData(InventoryExcelImporter.groovy:62)

at org.pih.warehouse.importer.InventoryExcelImporter$validateData.call(Unknown Source)

at org.pih.warehouse.batch.BatchController$_closure6.doCall(BatchController.groovy:220)

at org.pih.warehouse.batch.BatchController$_closure6.call(BatchController.groovy)

at grails.plugin.springcache.web.GrailsFragmentCachingFilter.doFilter(GrailsFragmentCachingFilter.groovy:66)

at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:86)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:622)

at java.lang.Thread.run(Thread.java:748)

Can you post your inventory XLS file here?

Sorry but i cannot share inventory information because it is confidential

Can you remove the confidential parts? I just need to see the structure to try to reproduce the issue.

From what I can see, this is an Excel issue. Excel is trying to force a double into a column that is expecting a string. Probably the bin location. So I would recommend attempting to format the bin location as a string.

Similar issues pop up all the time. Here’s an example. Read the entire thread (Kelsey’s response at the bottom is probably the most useful).

those are the fields that i am using in the file

Unfortunately, I need to see the data. But without seeing the data, my previous comment is the best to go on. This is an Excel issue, not an OpenBoxes issue. In other words, you need to take additional steps to ensure Excel is not coercing the data in the bin location column from text to number.

Ok my friend , it was the BIN , thank you

Awesome! Thanks for posting back an update.