SolrCloud server restart hangs - solrcloud

I am using SolrCloud with 2 shards (no replicas), both running in the same machine. I use a separate Zookeeper instance. The problem I am facing is that if I reboot the server, SolrCloud fails to start up .
Log in the first shard:
May 23, 2013 3:10:53 PM org.apache.solr.core.CachingDirectoryFactory close
INFO: Releasing directory:/opt/solr-4.1.0/example/solr/my-collection/data
May 23, 2013 3:10:53 PM org.apache.solr.core.CachingDirectoryFactory close
INFO: Releasing directory:/opt/solr-4.1.0/example/solr/my-collection/data/index
May 23, 2013 3:11:01 PM org.apache.solr.common.cloud.ZkStateReader$3 process
INFO: Updating live nodes... (2)
Log in the second shard:
May 23, 2013 3:11:09 PM org.apache.solr.core.CachingDirectoryFactory close
INFO: Releasing directory:/opt/solr-4.1.0/example2/solr/my-collection/data
May 23, 2013 3:11:09 PM org.apache.solr.core.CachingDirectoryFactory close
INFO: Releasing directory:/opt/solr-4.1.0/example2/solr/my-collection/data/index
To start the service, I have to delete the entire data folder in SolrCloud shards and start again. Deleting just the tlog folder also does not help. Is there a way to prevent this from happening.

There would be a zoo_data folder created in your solr home directory.Delete that folder and then do a restart.It might help in your case.

Related

How to configure the GAE Datastore emulator on Windows?

Following the docs I have started the GAE Datastore Emulator from a CMD shell.
I used:
gcloud beta emulators datastore start --data-dir=j:\projects\project\datastore
The output is:
WARNING: Reusing existing data in [j:\projects\project\datastore].
Executing: cmd /c C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\cloud-datastore-emulator\cloud_datastore_emulator.cmd start --host=localhost --port=8081 --store_on_disk=True --consistency=0.9 --allow_remote_shutdown j:\projects\project\datastore
[datastore] Jun 08, 2019 5:24:52 PM com.google.cloud.datastore.emulator.CloudDatastore$FakeDatastoreAction$9 apply
[datastore] INFO: Provided --allow_remote_shutdown to start command which is no longer necessary.
[datastore] Jun 08, 2019 5:24:52 PM com.google.cloud.datastore.emulator.impl.LocalDatastoreFileStub <init>
[datastore] INFO: Local Datastore initialized:
[datastore] Type: High Replication
[datastore] Storage: j:\projects\jupiter\datastore\WEB-INF\appengine-generated\local_db.bin
[datastore] Jun 08, 2019 5:24:53 PM com.google.cloud.datastore.emulator.impl.LocalDatastoreFileStub load
[datastore] INFO: The backing store, j:\projects\project\datastore\WEB-INF\appengine-generated\local_db.bin, does not exist. It will be created.
[datastore] API endpoint: http://localhost:8081
[datastore] If you are using a library that supports the DATASTORE_EMULATOR_HOST environment variable, run:
[datastore]
[datastore] export DATASTORE_EMULATOR_HOST=localhost:8081
[datastore]
[datastore] Dev App Server is now running.
[datastore]
[datastore] The previous line was printed for backwards compatibility only.
[datastore] If your tests rely on it to confirm emulator startup,
[datastore] please migrate to the emulator health check endpoint (/). Thank you!
Browsing to localhost:8081 returns Ok
In a second CMD shell I try:
gcloud beta emulators datastore env-init --data-dir=j:\projects\project\datastore > set_vars.cmd && set_vars.cmd
(Google docs don't mention --data-dir=j:\projects\project\datastore but without it the tool looks in the wrong place)
But it fails with:
ERROR: (gcloud.beta.emulators.datastore.env-init) Unable to find env.yaml in the data_dir
[C:\Users\c\AppData\Roaming\gcloud\emulators\datastore]. Please ensure you have started the appropriate emulator.
If I set-up the environment variables manually I get the same results from my CMD shells.
I have tried to reproduced your use case scenario and it worked for me. This is what I have followed:
From Running the Datastore mode Emulator documentation.
Make sure that A Java JRE (version 8 or greater) is installed.
Install the Google Cloud SDK (If already have, update it)
Run the CMD as administrator
Execute $ gcloud components install cloud-datastore-emulator
Exectue $ gcloud beta emulators datastore start --data-dir=C:\PATH\TO\datastore
If get You do not currently have this command group installed. Using it requires the installation of components: [beta]
Then execute $ gcloud components install beta
Execute again $ gcloud beta emulators datastore start --data-dir=C:\PATH\TO\datastore
Open new CMD again as administrator
Execute $ gcloud beta emulators datastore env-init --data-dir=C:\PATH\TO\datastore > set_vars.cmd && set_vars.cmd
The command executed without any issues. This is the response:
C:\Windows\system32>set DATASTORE_DATASET=[PROJECT_ID]
C:\Windows\system32>set DATASTORE_EMULATOR_HOST=localhost:8081
C:\Windows\system32>set DATASTORE_EMULATOR_HOST_PATH=localhost:8081/datastore
C:\Windows\system32>set DATASTORE_HOST=http://localhost:8081
C:\Windows\system32>set DATASTORE_PROJECT_ID=[PROJECT_ID]
C:\Windows\system32>
I would suggest to try the process again from different directory. Make sure that:
You have admin permissions to access the directory.
For testing purposes, try a directory in your desktop.
Update the Google Cloud SDK.
The directory's path don't have a space in it.
Both CMDs should open with administrative privileges.
UPDATED 2019-09-07 following comments.
If you are stuck with Google App Engine (GAE) Standard Python 2.7, and have to run local version of GDS, here is my way of doing it (thought not an answer directly to the question, but still might be relevant to).
I run dev_appengine with datastore parameters. on windows the .bat file might look like this:
set PY="c:\/python27\/python.exe"
set GAE="C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\dev_appserver.py"
set GCSEMU="C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\cloud-datastore-emulator\cloud_datastore_emulator.cmd"
%PY% %GAE% --skip_sdk_update_check=True --datastore_emulator_cmd=%GCSEMU% --port 8080 --host oe.loc .
There are parameters for store location too.

Taking PNG from Desktop while jar is running

I'm working on a project on an IDE, of course when using it I have no problems saving files into resources and using them. Though, I'm running the .jar of the project on a raspbian system and the image file is saved on Desktop, the same directory where the jar is saved, not a problem actually, the main problem is that I need to access that file and it does not let me, giving me a FileNotFoundException. Here is the code:
ImageIO.write(bi, "png", new File("mandelbrot.png"));
SendPhoto spr = new SendPhoto();
spr.setChatId(update.getMessage().getChatId());
spr.setReplyToMessageId(update.getMessage().getMessageId());
spr.setPhoto(new File("home/pi/Desktop/mandelbrot.png")); //I've also tried with ~/Desktop/mandelbrot.png
The exact error is the following one:
Mar 07, 2019 6:24:58 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.io.FileNotFoundException) caught when processing request to {s}->https://api.telegram.org:443: home/pi/Desktop/mandelbrot.png (No such file or directory)
Mar 07, 2019 6:24:58 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://api.telegram.org:443
Mar 07, 2019 6:24:58 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.io.FileNotFoundException) caught when processing request to {s}->https://api.telegram.org:443: home/pi/Desktop/mandelbrot.png (No such file or directory)
Mar 07, 2019 6:24:58 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://api.telegram.org:443
Mar 07, 2019 6:24:58 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.io.FileNotFoundException) caught when processing request to {s}->https://api.telegram.org:443: home/pi/Desktop/mandelbrot.png (No such file or directory)
Mar 07, 2019 6:24:58 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://api.telegram.org:443
I have little knowledge on how a jar file works, so I assume I'm doing something wrong, because it makes no sense otherwise since that directory exists.
I solved the problem, it was a misunderstanding. I needed to write just mandelbrot.png and not all to path to get to the file, since it's in the same directory. I leave this in case someone will need it.

rootContext && dispatcher-servlet are not being initialized

I am newly learning Spring MVC and facing a problem. I have configured my project correctly and all things were going well .For some reasons, I have done maven clean than maven install than update project.After that, if I run the project ->->-> rootContext && dispatcher-servlet are not being initialized. In the console just the following->
Dec 05, 2016 11:20:39 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1093 ms
Dec 05, 2016 11:20:40 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 801 ms
and in the browser->
HTTP Status 404 - /st/add
type Status report
message /st/add
description The requested resource is not available.
If I change the workspace and in a new project just paste the previous configuration, it works again.
How can i solve the problem without copying and pasting again and again?????
My project tree is-
-- src
-- main
-- webapp
-- WEB-INF
-- spring
--rootContext.xml
--dispatcher-servlet.xml
-- web.xml
As IDE, I am using Spring Suit Tool (STS) and as server Pivotal tc Server Developer Edition.

How to clone codeplex code with current changes in tortoiseSVN or tortoiseHG

I want to download the code of nopcommorce with this changes
http://nopcommerce.codeplex.com/SourceControl/changeset/f438f188fa4e
For get this I am going to clone the code and it's not make clone. I got error that
% hg clone --verbose -- https://hg.codeplex.com/nopcommerce .
requesting all changes
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: stream ended unexpectedly (got 1718536 bytes, expected 3694604)
[command returned code 255 Sat Oct 27 14:51:03 2012]
% hg clone --verbose -- https://hg.codeplex.com/nopcommerce .
requesting all changes
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: stream ended unexpectedly (got 997670 bytes, expected 5238782)
[command returned code 255 Sat Oct 27 14:53:37 2012]
Can someone tell me how I can got it worked. I have both tortoseHG and tortoiseSVN both installed..
how I can got the code on my computer with the recent changes.
It's mercurial repo, you have to use only hg
It's big repo, for such cases clone to some non-tip revision and set of pulls may work better (-r option for clone|pull)
% hg clone --verbose -- https://hg.codeplex.com/nopcommerce .
requesting all changes
adding changesets
adding manifests
adding file changes
added 3021 changesets with 54579 changes to 15033 files (+6 heads)
...
4280 files updated, 0 files merged, 0 files removed, 0 files unresolved
[command completed successfully Sat Oct 27 15:48:37 2012]

Flex 4, Spring 3 with Hibernate & MySQl setup + configuration issues

This kind of question has been asked before, but has not been well supported at StackOverlfow...maybe because some people think its elementary..but beginners like me have spent days on this but to no avail. Kindly help [I'm sure its going to be an ever occurring issue]
I'm trying to make a flex project and want to integrate Spring 3.0 with it and later Hibernate.
I was trying to follow James Ward's Refcard instructions - http://refcardz.dzone.com/refcardz/flex-4-and-spring-3 ,
Sadly, I got stuck at an initial point itself as some problem in deploying the project to JBoss (in refcardz it says Tomcat)..
I was trying to use the book 'Flex and Java integration Bible' [it uses JBoss], can somebody tell me if its the right way...or is there some other text ? please help as I have been stuck on this for 2 days now...I want to code and move ahead, not be stuck in configuration issues. I'll be most thankful.
UPDATE-MORE DETAILS :
I started off with using 'Flex and Java Integration Bible, as had no idea of how to integrate so many things (there is no text out there what so ever)'. When I reached the middle of the book, I was not able to do some steps as I guess the version of things changed.
I searched and went towards James Ward example (again, not very detailed for a stupid beginner like Me). Using Refcardz, I am stuck at following --
While making the flex spring project, I see the error in console that cannot deploy to server (tried both JBoss and Tomcat). Error trace is as follows (I think some jar as mentioned in Refcardz is to do with it) :
Oct 8, 2010 2:07:24 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_21\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\Program Files\Common Files\Lenovo;C:\Program Files\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files\ThinkPad\ConnectUtilities;C:\Program Files\Lenovo\Client Security Solution;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\WinSCP3\;C:\Program Files\Java\jdk1.6.0_21\bin;C:\apache-ant-1.8.1\bin;C:\Program Files\Java\jdk1.6.0_21\bin;C:\apache-ant-1.8.1\bin
Oct 8, 2010 2:07:24 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:flexspring' did not find a matching property.
Oct 8, 2010 2:07:24 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-80
Oct 8, 2010 2:07:24 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 398 ms
Oct 8, 2010 2:07:24 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Oct 8, 2010 2:07:24 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
Oct 8, 2010 2:07:25 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Oct 8, 2010 2:07:25 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.springframework.flex.core.ExceptionTranslationAdvice] for bean with name 'org.springframework.flex.core.ExceptionTranslationAdvice#0' defined in null: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1238)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)
at org.springframework.beans.factory.support.AbstractBeanFactory.getType(AbstractBeanFactory.java:549)
at org.springframework.flex.config.RemotingAnnotationPostProcessor.findRemotingDestinations(RemotingAnnotationPostProcessor.java:148)
at org.springframework.flex.config.RemotingAnnotationPostProcessor.postProcessBeanFactory(RemotingAnnotationPostProcessor.java:79)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:663)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:653)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:407)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2733)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1124)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1612)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2733)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1124)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1612)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2733)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1124)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1612)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408)
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1256)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1227)
... 25 more
Caused by: java.lang.ClassNotFoundException: org.aopalliance.aop.Advice
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
... 53 more
Oct 8, 2010 2:07:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Oct 8, 2010 2:07:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/flexspring] startup failed due to previous errors
Oct 8, 2010 2:07:25 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
Can somebody please give some step by step method to do so..or some existent text to get that intuition. I am a student and interning. Have not felt this helpless in years. I just can't make things happen. [I wonder am I the dumbest to have such a problem.]
Regards,
Chirayu
NEXT PROBLEM UPDATE-10/21/2010
The above problem was solved thanks to Splash and James(ans. below), but now after I have done as said in Refcardz, and the sayHello.mxml loads in browser, I enter text, and press sayHello button, upon which this error comes -
[RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://localhost:8080/flexsping/messagebroker/amf'"]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:345]
at mx.rpc::Responder/fault()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\Responder.as:68]
at mx.rpc::AsyncRequest/fault()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:113]
at mx.messaging::ChannelSet/faultPendingSends()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messaging\ChannelSet.as:1614]
at mx.messaging::ChannelSet/channelFaultHandler()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messaging\ChannelSet.as:1206]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.messaging::Channel/connectFailed()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messaging\Channel.as:1128]
at mx.messaging.channels::PollingChannel/connectFailed()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messaging\channels\PollingChannel.as:406]
at mx.messaging.channels::AMFChannel/statusHandler()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messaging\channels\AMFChannel.as:453]
I have no idea what this means...ave spent toooo much of time on this...kindly please help me through. I am trying, and have tried everything..but now do need help of somebody who knows this well. I'll be really thankful.
-Chirayu
You need to deploy the jar for org.aopalliance.aop.Advice. I guess it is aopalliance-alpha1.jar (which is referenced in the refcard tutorial) which seems not to be in the classpath. This step is explained on page 2 of the Refcard tutorial:
Next, you need to add the dependencies to the flexspring web application. Copy all of the Spring Framework libraries / JAR files to the WebContent/WEB-INF/lib folder. [...] Do the same for aopalliance.jar, [...]
Please read the Refcard attentively. It's an in-depth walkthrough and should cover any needed step.
For more tutorials look at the Adobe Developer Connection:
Adobe Flex, BlazeDS, and Hibernate JPA on Tomcat and MySQL
The Flex, Spring, and BlazeDS full stack
Try using something other than bloated Spring garbage and especially "AOP" trash. Use pure-Java PicoContainer and ditch all that ridiculous XML dependency injection config (convention over configuration? ...yeah right) AND the outrageous number of jar hell dependencies (such as the aopappliance junk that is giving you trouble now).
Spring has had it's day, and won big championing a few good concepts like DI and TDD but the implementation of the concept sucks, at this point it's just an absurd number of sub-projects riding the Spring bandwagon. Now there are better alternatives out there which rely on actual Java programming rather than "XML programming".
If you're new you'll be spending time learning anyway, and I guarantee the learning curve for constructor-based Pico dependency injection is easier.
http://www.picocontainer.org/

Resources