Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error at password = AESCodec.decode("...") in an external app.groovy #71

Open
fdutenho opened this issue Mar 9, 2024 · 6 comments
Open

Comments

@fdutenho
Copy link

fdutenho commented Mar 9, 2024

using an env.groovy in tomcat config folder with

environments {
   abc {
      username = "app_test"
      password = AESCodec.decode("***")
      ...
   }
   ...
}

this results in an error (log file):

...
org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [.../webapps/ROOT.war]
	java.lang.IllegalStateException: Error starting child
		at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:714)
		at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:687)
		at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:660)
		at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1016)
		at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1903)
		at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
		at java.util.concurrent.FutureTask.run(FutureTask.java:266)
		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
		at java.lang.Thread.run(Thread.java:750)
	Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
		at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:419)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:186)
		at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:710)
		... 9 more
Caused by: groovy.lang.MissingMethodException: No signature of method: groovy.util.ConfigObject.decode() is applicable for argument types: (String) values: [***]
...
@fdutenho
Copy link
Author

fdutenho commented Mar 9, 2024

Exact same config packaged with the grails app (as war) works. If I move the file and use grails.config.locations = ['file:${catalina.base}/conf/env.groovy'] will cause above mentioned error message.

@fdutenho fdutenho closed this as completed Mar 9, 2024
@fdutenho
Copy link
Author

fdutenho commented Mar 9, 2024

my fault I forget an import statement at the beginning of the file :-(

@fdutenho fdutenho reopened this Mar 9, 2024
@fdutenho
Copy link
Author

fdutenho commented Mar 9, 2024

adding the import statement is not fixing the issue

@fdutenho
Copy link
Author

fdutenho commented Mar 9, 2024

AESCodec is a class written by us.

@fdutenho
Copy link
Author

fdutenho commented Mar 9, 2024

import statement in the external file results into:

unable to resolve class ...
 @ line 1, column 1.
   import ...

@fdutenho
Copy link
Author

fdutenho commented Mar 9, 2024

using this in the internal file

import ....AESCodec
grails.config.locations = ['file:${catalina.base}/conf/runtime.groovy']

and no import statement in the external file results into:


Caused by: groovy.lang.MissingMethodException: No signature of method: groovy.util.ConfigObject.decode() is applicable for argument types: (String) values: [***]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant