While running phantom sample-http-proxy there are few issues after successful build of Phantom with different version of Trooper dependencies:
Running with the Command given in getting started:
java -cp "./target/lib/*" org.trpr.platform.runtime.impl.bootstrap.BootstrapLauncher ./src/main/resources/external/bootstrap.xml
With org.trpr.version - 1.3.3
- First Error -- Error initializing logging framework!. Error message : org.slf4j.impl.Log4jLoggerFactory cannot be cast to ch.qos.logback.classic.LoggerContext
java.lang.ClassCastException: org.slf4j.impl.Log4jLoggerFactory cannot be cast to ch.qos.logback.classic.LoggerContext
Solved: I solved it by manually removing slf4j-log4j12-1.7.5.jar from target/lib of sample-http-proxy.
But it should be excluded from POM.
- Second Error : Bean property 'componentContainerClassName' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Solved: I solved it by commenting out property componentContainerClassName in bootstrap.xml as i checked in the source code of Trooper and didnot find the attribute in Bootstrap class
https://github.com/regunathb/Trooper/blob/master/runtime-core/src/main/java/org/trpr/platform/runtime/spi/bootstrap/BootstrapInfo.java
After fixing this two issues, im able to run properly,here's the output
** Trooper runtime Bootstrap start **
Using logging config file : /home/kuntal/knowledge/bigdata/phantom/sample-http-proxy/./src/main/resources/external/logback.xml
16:58:15.834 [main] INFO o.t.p.r.i.bootstrap.spring.Bootstrap - Logging framework is now initialized!
16:58:15.943 [main] INFO o.s.c.s.FileSystemXmlApplicationContext - Refreshing org.springframework.context.support.FileSystemXmlApplicationContext@73871392: startup date [Sun Mar 20 16:58:15 IST 2016]; root of context hierarchy
16:58:15.983 [main] INFO o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [file:/home/kuntal/knowledge/bigdata/phantom/sample-http-proxy/./src/main/resources/external/bootstrap.xml]
16:58:16.113 [main] INFO o.t.p.r.i.c.s.SpringContainerImpl - Initializing Bootstrap extension .... ~~~TrprPlatformCommonBeansContext~~~
16:58:16.113 [main] INFO o.t.p.r.i.c.s.SpringContainerImpl - No component container configured for this runtime instance.
16:58:16.115 [main] INFO o.t.p.r.i.bootstrap.spring.Bootstrap -
Trooper __
**/ \ Runtime Nature : SERVER
__/ **/ Component Container : None
/ __/ \ Startup Time : 409 ms
__/ __/ Host Name: kuntal-Lenovo-G500
__/
16:58:16.115 [main] INFO o.t.p.r.i.bootstrap.spring.Bootstrap - ** Trooper Bootstrap complete **
But now when i'm trying to run the below commands, nothing is happening:
http://localhost:8080
http://localhost:8081/admin/dashboard
http://localhost:8081/admin/configuration
I checked with *netstat * command and nothing is listening on this ports.
- Please tell me what to do in-order to make my proxy work and redirect to Google.com as configured in spring proxy handler config???
Also i tried with With org.trpr.version - 1.3.4
I faced the same issues of the above ( logback cast exception and spring invalid attributes)
Logback issue was fixed similar to above, but even after commenting the spring attributes, im getting this error:
* Trooper runtime Bootstrap start **
Using logging config file : /home/kuntal/knowledge/bigdata/phantom/sample-http-proxy/./src/main/resources/external/logback.xml
16:51:47.314 [main] INFO o.t.p.r.i.bootstrap.spring.Bootstrap - Logging framework is now initialized!
16:51:47.423 [main] INFO o.s.c.s.FileSystemXmlApplicationContext - Refreshing org.springframework.context.support.FileSystemXmlApplicationContext@2916117f: startup date [Sun Mar 20 16:51:47 IST 2016]; root of context hierarchy
16:51:47.462 [main] INFO o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [file:/home/kuntal/knowledge/bigdata/phantom/sample-http-proxy/./src/main/resources/external/bootstrap.xml]
16:51:47.609 [main] INFO o.t.p.r.i.c.s.SpringContainerImpl - Initializing Bootstrap extension .... ~~~TrprPlatformCommonBeansContext~~~
16:51:47.613 [main] ERROR o.t.p.r.i.bootstrap.spring.Bootstrap - Fatal error in bootstrap sequence. Cannot continue!
java.lang.NullPointerException: null
at org.trpr.platform.runtime.impl.container.spring.SpringContainerImpl.init(SpringContainerImpl.java:89) ~[runtime-core-1.3.4.jar:na]
at org.trpr.platform.runtime.impl.bootstrap.spring.Bootstrap.start(Bootstrap.java:254) ~[runtime-core-1.3.4.jar:na]
at org.trpr.platform.runtime.impl.bootstrap.spring.Bootstrap.init(Bootstrap.java:136) ~[runtime-core-1.3.4.jar:na]
at org.trpr.platform.runtime.impl.bootstrap.BootstrapLauncher.main(BootstrapLauncher.java:39) [runtime-core-1.3.4.jar:na]
Fatal error in bootstrap sequence. Cannot continue!
java.lang.NullPointerException
at org.trpr.platform.runtime.impl.container.spring.SpringContainerImpl.init(SpringContainerImpl.java:89)
at org.trpr.platform.runtime.impl.bootstrap.spring.Bootstrap.start(Bootstrap.java:254)
at org.trpr.platform.runtime.impl.bootstrap.spring.Bootstrap.init(Bootstrap.java:136)
at org.trpr.platform.runtime.impl.bootstrap.BootstrapLauncher.main(BootstrapLauncher.java:39)
* Trooper runtime shutdown initiated....
* Trooper runtime Stopping....*
In brief ,i couldn't run Phantom by using trooper version <org.trpr.version>1.3.4</org.trpr.version>