You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apps-dev@avalon.apache.org by bp...@dankseeds.org on 2002/06/17 23:06:42 UTC

application is NULL

afternoon folks, 

	ive searched high and low for some info on this one and its got me baffled 
at the moment. Ive been through the extensive (yeah right) manuals, ive searched 
google groups (to no avail) and ive search through the mailing list archives coming 
up with squat. im hoping someone can help me with this one as my apps are ready 
to go. 

im running:
phoenix 4.0a3 & avalon4.1.2 under the WebSphere Studio Application Developer 
4.0 environment. Im pretty sure the IBM JDK is 1.3 

Ive setup a simple phoenix application. Ive packaged it up into a sar ( making sure 
that the format is correct.) I am loading the application using the PhoenixServlet 
and ive setup all the parameters correctly. i.e. 

application-name = CoreWebApp
application-location = /WEB-INF/apps/CoreWebApp.sar

Everything loads fine. My components get initalized with the info from the 
config.xml files. My dependencies check out ok from assembly.xml. 

My only problem is when i try to access the application through the embeddor. 

assuming "embeddor" is a SingleAppEmbeddor and the "embeddor" obtained from 
the ServletContext is NOT null. 

these give me problems. 

embeddor.list();
embeddor.lookup(...);

m_application is null, as im getting null pointer exceptions from these methods. 

any suggestions folks ? i really don't have the time to dig toooo much deeper and 
figure this out. Phoenix is supposed to help me not hinder me, arrrgh. 

Thanks !

				BP





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: application is NULL

Posted by Peter Royal <pr...@apache.org>.
On Thursday 20 June 2002 07:11 pm, bp@dankseeds.org wrote:
> > good work! you figured it out before i had a chance to look at it. If you
> > want to send a patch, that would be superb. It might be good to make the
> > sleep time configurable.
> > -pete
>
> sure thing. when you say "patch", do you mean a diff of the source, or do
> you want me to check out a copy and update the cvs ?

A diff of the source.

One way is to check out a copy of the CVS, make your change and then do
cvs diff -u

to generate a patch that can be put in bugzilla or sent to the mailing list
-pete

-- 
peter royal -> proyal@apache.org

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: application is NULL

Posted by bp...@dankseeds.org.
> eh, this is avalon-apps-dev, it should do, but I'll crosspost to 
> avalon-phoenix-dev.

yeah that's what i meant, avalon-phoenix-dev. 
 
> good work! you figured it out before i had a chance to look at it. If you 
> want to send a patch, that would be superb. It might be good to make the 
> sleep time configurable.
> -pete

sure thing. when you say "patch", do you mean a diff of the source, or do you want 
me to check out a copy and update the cvs ? 

i'll be out of town the rest of the week so i'll fix this monday unless someone has 
already done it. 

							BP



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: application is NULL

Posted by Peter Royal <pr...@apache.org>.
On Wednesday 19 June 2002 03:53 pm, bp@dankseeds.org wrote:
> > I don't know reason of NPE at this time.
> > I try PhoenixServlet in current cvs. It is not works. Installtion is very
> > difficult.
> > Current SingleAppEmbeddor and PhoenixServlet are broken.
>
> Not any more ;) check this:
>
> In the PhoenixServlet init() the Thread that you assigned to the embeddor
> doesn't have a chance to get the Application setup properly before it is
> used. Thus i just dropped in a 'Thread.sleep(1000)' and gave it a second to
> get setup properly. This seems to be a logical fix. Any comments ot the
> contrary ? Im guessing this should go on the avalon-dev list also since it
> involves internal code.

eh, this is avalon-apps-dev, it should do, but I'll crosspost to 
avalon-phoenix-dev.

good work! you figured it out before i had a chance to look at it. If you 
want to send a patch, that would be superb. It might be good to make the 
sleep time configurable.
-pete

-- 
peter royal -> proyal@apache.org

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: application is NULL

Posted by Peter Royal <pr...@apache.org>.
On Wednesday 19 June 2002 03:53 pm, bp@dankseeds.org wrote:
> > I don't know reason of NPE at this time.
> > I try PhoenixServlet in current cvs. It is not works. Installtion is very
> > difficult.
> > Current SingleAppEmbeddor and PhoenixServlet are broken.
>
> Not any more ;) check this:
>
> In the PhoenixServlet init() the Thread that you assigned to the embeddor
> doesn't have a chance to get the Application setup properly before it is
> used. Thus i just dropped in a 'Thread.sleep(1000)' and gave it a second to
> get setup properly. This seems to be a logical fix. Any comments ot the
> contrary ? Im guessing this should go on the avalon-dev list also since it
> involves internal code.

eh, this is avalon-apps-dev, it should do, but I'll crosspost to 
avalon-phoenix-dev.

good work! you figured it out before i had a chance to look at it. If you 
want to send a patch, that would be superb. It might be good to make the 
sleep time configurable.
-pete

-- 
peter royal -> proyal@apache.org

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: application is NULL

Posted by bp...@dankseeds.org.
> I don't know reason of NPE at this time.
> I try PhoenixServlet in current cvs. It is not works. Installtion is very
> difficult.
> Current SingleAppEmbeddor and PhoenixServlet are broken.

Not any more ;) check this:

In the PhoenixServlet init() the Thread that you assigned to the embeddor doesn't 
have a chance to get the Application setup properly before it is used. Thus i just 
dropped in a 'Thread.sleep(1000)' and gave it a second to get setup properly. This 
seems to be a logical fix. Any comments ot the contrary ? Im guessing this should 
go on the avalon-dev list also since it involves internal code. 

try
{
    m_embeddor = new SingleAppEmbeddor();
    if ( m_embeddor instanceof Parameterizable )
    {
        ((Parameterizable)m_embeddor).parameterize( 
m_parameters );
    }
    m_embeddor.initialize();
    new Thread( this ).start();
    // Added a pause so the Application can start up properly. 
    Thread.sleep(1000);
}
catch ( final Throwable throwable )
{
	<SNIP>
}

			BP



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: application is NULL

Posted by Eung-ju Park <co...@hotmail.com>.
I don't know reason of NPE at this time.
I try PhoenixServlet in current cvs. It is not works. Installtion is very
difficult.
Current SingleAppEmbeddor and PhoenixServlet are broken.
Please do not use PhoenixServlet for production web application. Try to
fortress, merlin or your own container for component container.
I will remove SingleAppEmbeddor and PhoenixServlet from phoenix.
Sorry for irresponsibility.

----- Original Message -----
From: <bp...@dankseeds.org>
To: "Avalon Applications Developers List"
<av...@jakarta.apache.org>
Sent: Wednesday, June 19, 2002 5:17 AM
Subject: Re: application is NULL


> > Can you send a copy of your logfiles w/everything running in DEBUG?
> > -pete
>
> ok here goes:
>
> just for background once again - Im using the PhoenixServlet which in turn
uses the
> SingleAppEmbeddor class. The PhoenixServlet does the following in init():
>
> --- new SingleAppEmbeddor() m_embeddor
>
> --- m_embeddor.parameterize(...)
> ive included all the appropriate parms in the Initialization Parms for the
servlet,
> which get passed on to m_embeddor.parameterize(...). The sar file gets
picked up
> and the components get configure(...)d properly, as i see the info in the
logs. i use
> the following parameters:
> ~~~
> log-destination = PhoenixServlet
> log-priority = DEBUG
> application-name = CoreWebApp
> application-location = /WEB-INF/apps/CoreWebApp.sar
> ~~~
>
> --- m_embeddor.intialize(...)
>
> --- new Thread( this ).start()
> This calls m_embeddor.execute() which in turn calls
> m_embeddor.deployDefaultApplications(). This should setup the single
application.
>
> --- getServletContext().setAttribute(Embeddor.ROLE,m_embeddor)
> Then PhoenixServlet places the SingleAppEmbeddor in the ServletContext
from
> which i access it in another Servlet.
>
> Ok the SingleAppEmbeddor comes out of the ServletContext fine and the cast
to
> SingleAppEmbeddor is ok also. BUUUT when i try to call ANY method on the
> SingleAppEmbeddor which access'  the inner m_application reference i get
> NullPointerExceptions. i.e.
>
> m_embeddor.lookup(...)
> m_embeddor.hasComponent(...)
> m_embeddor.list()
>
> The following are my log files.
> ******************************************************
> /WEB-INF/apps/CoreWebApp/logs/default.log*
> *******************************************************
> 1024430557421 [INFO   ] (CommandRepository): Got config
> 1024430557437 [INFO   ] (CommandRepository): Added 'DefaultHttpForward.do'
> Command to the repository
> 1024430557437 [INFO   ] (CommandRepository): Added
'DefaultHttpRedirect.do'
> Command to the repository
> 1024430557453 [INFO   ] (UserRepository): Got config. Loading users.
> 1024430557468 [INFO   ] (UserRepository): Added 'bpurvis' to the User
Repository
> 1024430557500 [INFO   ] (CommandDispatcher): Got config
> *******************************************************
>
> *********************************
> /WEB-INF/logs/phoenix.log*
> **********************************
> 1024430002203 [INFO   ] (Phoenix): Logger started
> 1024430002453 [INFO   ] (Phoenix.deployer): Installing Sar located at
> file:/G:/Workspace/CVSROOT/CoreWebApp/webApplication/WEB-
> INF/apps/CoreWebApp.sar.
> 1024430002453 [WARN   ] (Phoenix.deployer): The file SAR-INF/config.xml
can
> not be extracted from the Sar
> "file:/G:/Workspace/CVSROOT/CoreWebApp/webApplication/WEB-
> INF/apps/CoreWebApp.sar" into directory
> G:\Workspace\CVSROOT\CoreWebApp\webApplication\WEB-
> INF\apps\CoreWebApp because there is a file in the way.
> 1024430002453 [WARN   ] (Phoenix.deployer): The file
SAR-INF/environment.xml
> can not be extracted from the Sar
> "file:/G:/Workspace/CVSROOT/CoreWebApp/webApplication/WEB-
> INF/apps/CoreWebApp.sar" into directory
> G:\Workspace\CVSROOT\CoreWebApp\webApplication\WEB-
> INF\apps\CoreWebApp because there is a file in the way.
> 1024430002703 [WARN   ] (Phoenix.deployer): Warning: BlockInfo for class
> com.bpurvis.webapp.service.DefaultCommandDispatcher redundently specifies
role
> name "com.bpurvis.webapp.services.CommandRepository" in dependency when it
> is identical to the name of service. It is recomended that the <role/>
section be
> elided.
> 1024430002703 [WARN   ] (Phoenix.deployer): Warning: BlockInfo for class
> com.bpurvis.webapp.service.DefaultCommandDispatcher redundently specifies
role
> name "com.bpurvis.webapp.services.UserRepository" in dependency when it is
> identical to the name of service. It is recomended that the <role/>
section be elided.
> 1024430002703 [WARN   ] (Phoenix.deployer): Warning: BlockInfo for class
> com.bpurvis.webapp.service.DefaultCommandDispatcher redundently specifies
role
> name "com.bpurvis.webapp.services.AuthorizationManager" in dependency when
it
> is identical to the name of service. It is recomended that the <role/>
section be
> elided.
> 1024430002859 [INFO   ] (Phoenix.deployer): Verifying that the name
specified for
> Blocks and BlockListeners are valid.
> 1024430002859 [INFO   ] (Phoenix.deployer): Verifying that the name
specified for
> Blocks and BlockListeners are unique.
> 1024430002859 [INFO   ] (Phoenix.deployer): Verifying that the specified
> Dependencies are valid according to BlockInfo.
> 1024430002859 [INFO   ] (Phoenix.deployer): Verifying that the
dependencies of
> Blocks are valid with respect to other Blocks.
> 1024430002859 [INFO   ] (Phoenix.deployer): Verifying that there are no
circular
> dependencies between Blocks.
> 1024430002859 [INFO   ] (Phoenix.deployer): Verifying that the specified
Blocks
> have valid types.
> 1024430003000 [INFO   ] (Phoenix.deployer): Verifying that the specified
> BlockListeners have valid types.
> 1024430003140 [INFO   ] (Phoenix.kernel.CoreWebApp): 4 Blocks to process
for
> phase "startup". Order of processing = [AuthorizationManager,
> CommandRepository, UserRepository, CommandDispatcher].
> 1024430428468 [INFO   ] (Phoenix.kernel.CoreWebApp): 4 Blocks to process
for
> phase "shutdown". Order of processing = [CommandDispatcher,
> AuthorizationManager, CommandRepository, UserRepository].
>
****************************************************************************
**************
>
> ok those are the only 2 logs i have setup at the moment. If you wish to
see
> config.xml, assembly.xml, or environment.xml please let me know.
>
> Thanks !
>
> BP
>
>
>
>
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: application is NULL

Posted by bp...@dankseeds.org.
> Can you send a copy of your logfiles w/everything running in DEBUG?
> -pete

ok here goes:

just for background once again - Im using the PhoenixServlet which in turn uses the 
SingleAppEmbeddor class. The PhoenixServlet does the following in init():

--- new SingleAppEmbeddor() m_embeddor

--- m_embeddor.parameterize(...) 
ive included all the appropriate parms in the Initialization Parms for the servlet, 
which get passed on to m_embeddor.parameterize(...). The sar file gets picked up 
and the components get configure(...)d properly, as i see the info in the logs. i use 
the following parameters:
~~~
log-destination = PhoenixServlet
log-priority = DEBUG
application-name = CoreWebApp
application-location = /WEB-INF/apps/CoreWebApp.sar
~~~

--- m_embeddor.intialize(...)

--- new Thread( this ).start()
This calls m_embeddor.execute() which in turn calls 
m_embeddor.deployDefaultApplications(). This should setup the single application. 

--- getServletContext().setAttribute(Embeddor.ROLE,m_embeddor)
Then PhoenixServlet places the SingleAppEmbeddor in the ServletContext from 
which i access it in another Servlet. 

Ok the SingleAppEmbeddor comes out of the ServletContext fine and the cast to 
SingleAppEmbeddor is ok also. BUUUT when i try to call ANY method on the 
SingleAppEmbeddor which access'  the inner m_application reference i get 
NullPointerExceptions. i.e. 

m_embeddor.lookup(...)
m_embeddor.hasComponent(...)
m_embeddor.list()

The following are my log files. 
******************************************************
/WEB-INF/apps/CoreWebApp/logs/default.log*
*******************************************************
1024430557421 [INFO   ] (CommandRepository): Got config
1024430557437 [INFO   ] (CommandRepository): Added 'DefaultHttpForward.do' 
Command to the repository
1024430557437 [INFO   ] (CommandRepository): Added 'DefaultHttpRedirect.do' 
Command to the repository
1024430557453 [INFO   ] (UserRepository): Got config. Loading users.
1024430557468 [INFO   ] (UserRepository): Added 'bpurvis' to the User Repository
1024430557500 [INFO   ] (CommandDispatcher): Got config
*******************************************************

*********************************
/WEB-INF/logs/phoenix.log*
**********************************
1024430002203 [INFO   ] (Phoenix): Logger started
1024430002453 [INFO   ] (Phoenix.deployer): Installing Sar located at 
file:/G:/Workspace/CVSROOT/CoreWebApp/webApplication/WEB-
INF/apps/CoreWebApp.sar.
1024430002453 [WARN   ] (Phoenix.deployer): The file SAR-INF/config.xml can 
not be extracted from the Sar 
"file:/G:/Workspace/CVSROOT/CoreWebApp/webApplication/WEB-
INF/apps/CoreWebApp.sar" into directory 
G:\Workspace\CVSROOT\CoreWebApp\webApplication\WEB-
INF\apps\CoreWebApp because there is a file in the way.
1024430002453 [WARN   ] (Phoenix.deployer): The file SAR-INF/environment.xml 
can not be extracted from the Sar 
"file:/G:/Workspace/CVSROOT/CoreWebApp/webApplication/WEB-
INF/apps/CoreWebApp.sar" into directory 
G:\Workspace\CVSROOT\CoreWebApp\webApplication\WEB-
INF\apps\CoreWebApp because there is a file in the way.
1024430002703 [WARN   ] (Phoenix.deployer): Warning: BlockInfo for class 
com.bpurvis.webapp.service.DefaultCommandDispatcher redundently specifies role 
name "com.bpurvis.webapp.services.CommandRepository" in dependency when it 
is identical to the name of service. It is recomended that the <role/> section be 
elided.
1024430002703 [WARN   ] (Phoenix.deployer): Warning: BlockInfo for class 
com.bpurvis.webapp.service.DefaultCommandDispatcher redundently specifies role 
name "com.bpurvis.webapp.services.UserRepository" in dependency when it is 
identical to the name of service. It is recomended that the <role/> section be elided.
1024430002703 [WARN   ] (Phoenix.deployer): Warning: BlockInfo for class 
com.bpurvis.webapp.service.DefaultCommandDispatcher redundently specifies role 
name "com.bpurvis.webapp.services.AuthorizationManager" in dependency when it 
is identical to the name of service. It is recomended that the <role/> section be 
elided.
1024430002859 [INFO   ] (Phoenix.deployer): Verifying that the name specified for 
Blocks and BlockListeners are valid.
1024430002859 [INFO   ] (Phoenix.deployer): Verifying that the name specified for 
Blocks and BlockListeners are unique.
1024430002859 [INFO   ] (Phoenix.deployer): Verifying that the specified 
Dependencies are valid according to BlockInfo.
1024430002859 [INFO   ] (Phoenix.deployer): Verifying that the dependencies of 
Blocks are valid with respect to other Blocks.
1024430002859 [INFO   ] (Phoenix.deployer): Verifying that there are no circular 
dependencies between Blocks.
1024430002859 [INFO   ] (Phoenix.deployer): Verifying that the specified Blocks 
have valid types.
1024430003000 [INFO   ] (Phoenix.deployer): Verifying that the specified 
BlockListeners have valid types.
1024430003140 [INFO   ] (Phoenix.kernel.CoreWebApp): 4 Blocks to process for 
phase "startup". Order of processing = [AuthorizationManager, 
CommandRepository, UserRepository, CommandDispatcher].
1024430428468 [INFO   ] (Phoenix.kernel.CoreWebApp): 4 Blocks to process for 
phase "shutdown". Order of processing = [CommandDispatcher, 
AuthorizationManager, CommandRepository, UserRepository].
******************************************************************************************

ok those are the only 2 logs i have setup at the moment. If you wish to see 
config.xml, assembly.xml, or environment.xml please let me know. 

Thanks !

			BP








--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: application is NULL

Posted by Peter Royal <pr...@apache.org>.
On Monday 17 June 2002 05:06 pm, bp@dankseeds.org wrote:
> My only problem is when i try to access the application through the
> embeddor.
>
> assuming "embeddor" is a SingleAppEmbeddor and the "embeddor" obtained from
> the ServletContext is NOT null.
>
> these give me problems.
>
> embeddor.list();
> embeddor.lookup(...);
>
> m_application is null, as im getting null pointer exceptions from these
> methods.
>
> any suggestions folks ? i really don't have the time to dig toooo much
> deeper and figure this out. Phoenix is supposed to help me not hinder me,
> arrrgh.

I've never used the PhoenixServlet but I'll try to help the best I can.

Can you send a copy of your logfiles w/everything running in DEBUG?
-pete

-- 
peter royal -> proyal@apache.org

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>