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

Phantom sample-http-proxy not running with error in bootstrap sequence #56

Closed
Kuntal-G opened this issue Mar 20, 2016 · 3 comments
Closed

Comments

@Kuntal-G
Copy link

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

  1. 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.

  1. 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>

@regunathb
Copy link
Contributor

The changes you have done may not be needed at all. Can you please check if you have any additional jars in your classpath before you run Phantom?
Also by removing the componentContainerClassName in bootstrap.xml, you are effectively removing the proxy from bootstrapping and that explains why you don't get to see anything post start up.

@Kuntal-G
Copy link
Author

Kuntal-G commented Apr 5, 2016

I have checked there is no additional jars in classpath. May be I will check the phantom build on different machine(fresh new) and will let you know soon.

@regunathb
Copy link
Contributor

Closing this issue due to inactivity.

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

2 participants