You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Raj M <mo...@gmail.com> on 2006/10/02 22:20:57 UTC

source build, configure db url

Greetings,
I am trying to do a source build where I need to connect to the DB
using additional
query parameters as below:

<org.apache.jetspeed.test.database.url>jdbc:postgresql://xyz.com/testDB?ssl=true&amp;sslfactory=org.postgresql.ssl.NonValidatingFactory&amp;</org.apache.jetspeed.test.database.url>

But, maven2 keeps complaining about '=' in the value parameter. Is
there any way to pass the
additional parameters. Here is the exception list:
====
Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException:
entity reference name can not contain character =' (....
====

Thanks
MK

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: source build, configure db url

Posted by Aaron Evans <aa...@gmail.com>.
On 10/4/06, Raj M <mo...@gmail.com> wrote:
> Aaron,
> Thanks for sticking with the thread. What appears to work is escaping the '&' so
> "ssl=trues&amp;amp;slfactory=org.postgresql.ssl.NonValidatingFactory&amp;amp;"
> appears to keep maven2/plexus happy.
> Cheers
> MK
>
So you are double escaping them, eh? Yeah, I guess that makes sense
since it appeared that it was doubly evaluating the string before.  It
is definitely someone's bug then because it should be enough to escape
it once.

My guess is that even if you used  &#38; or &#x26; you'd have to
double escape them as well (ie. &#38;#38; or &#x26;#x26;  or even some
combination like &amp;#38;!).

Anyhow, glad you got it working...

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: source build, configure db url

Posted by Raj M <mo...@gmail.com>.
Aaron,
Thanks for sticking with the thread. What appears to work is escaping the '&' so
"ssl=trues&amp;amp;slfactory=org.postgresql.ssl.NonValidatingFactory&amp;amp;"
appears to keep maven2/plexus happy.
Cheers
MK

On 10/3/06, Aaron Evans <aa...@gmail.com> wrote:
> On 10/3/06, Raj M <mo...@gmail.com> wrote:
> > Aaron,
> > Yes, that is my problem. I am only allowed SSL connection to the db, I
> > did try to
> > remove the lines, but the build failed during the 'access' to the db
> > phase (as you noted).
> > Is this a maven2 issue? I even tried CDATA block, but I guess the XML
> > parser does not like it.
> > Thanks
> >
>
> Looking more closely at your error message:
>
> Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException:
> entity reference name can not contain character ='
>
> and your XML:
>
> <org.apache.jetspeed.test.database.url>jdbc:postgresql://xyz.com/testDB?ssl=true&amp;sslfactory=org.postgresql.ssl.NonValidatingFactory&amp;</org.apache.jetspeed.test.database.url>
>
> I would say that there is a bug with the XML parser that maven2 is
> using (org.codehaus.plexus?).
>
> I believe it is complaining about the second ampersand and thinks that
>
> 'sslfactory=org.postgresql.ssl.NonValidatingFactory&amp' or some
> substring is an entity reference, which can't have an equal sign in
> it.
>
> However, you have correctly escaped the ampersand using '&amp', so it
> should not think that.
>
> My guess is that it is replacing the first &amp; with an ampersand and
> then evaluating it along with everything after it as an entity
> reference, which is clearly wrong.
>
> One thing you could try though is to use the decimal or hex
> representations for the ampersand:
>
> HTML Entity (decimal)   &#38;
> HTML Entity (hex)       &#x26;
>
> For example:
> <org.apache.jetspeed.test.database.url>jdbc:postgresql://xyz.com/testDB?ssl=true&#38;sslfactory=org.postgresql.ssl.NonValidatingFactory&#38;</org.apache.jetspeed.test.database.url>
>
> I would say give that a shot...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: source build, configure db url

Posted by Aaron Evans <aa...@gmail.com>.
On 10/3/06, Raj M <mo...@gmail.com> wrote:
> Aaron,
> Yes, that is my problem. I am only allowed SSL connection to the db, I
> did try to
> remove the lines, but the build failed during the 'access' to the db
> phase (as you noted).
> Is this a maven2 issue? I even tried CDATA block, but I guess the XML
> parser does not like it.
> Thanks
>

Looking more closely at your error message:

Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException:
entity reference name can not contain character ='

and your XML:

<org.apache.jetspeed.test.database.url>jdbc:postgresql://xyz.com/testDB?ssl=true&amp;sslfactory=org.postgresql.ssl.NonValidatingFactory&amp;</org.apache.jetspeed.test.database.url>

I would say that there is a bug with the XML parser that maven2 is
using (org.codehaus.plexus?).

I believe it is complaining about the second ampersand and thinks that

'sslfactory=org.postgresql.ssl.NonValidatingFactory&amp' or some
substring is an entity reference, which can't have an equal sign in
it.

However, you have correctly escaped the ampersand using '&amp', so it
should not think that.

My guess is that it is replacing the first &amp; with an ampersand and
then evaluating it along with everything after it as an entity
reference, which is clearly wrong.

One thing you could try though is to use the decimal or hex
representations for the ampersand:

HTML Entity (decimal)  	&#38;
HTML Entity (hex) 	&#x26;

For example:
<org.apache.jetspeed.test.database.url>jdbc:postgresql://xyz.com/testDB?ssl=true&#38;sslfactory=org.postgresql.ssl.NonValidatingFactory&#38;</org.apache.jetspeed.test.database.url>

I would say give that a shot...

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: source build, configure db url

Posted by Raj M <mo...@gmail.com>.
Aaron,
Yes, that is my problem. I am only allowed SSL connection to the db, I
did try to
remove the lines, but the build failed during the 'access' to the db
phase (as you noted).
Is this a maven2 issue? I even tried CDATA block, but I guess the XML
parser does not like it.
Thanks


On 10/3/06, Aaron Evans <aa...@gmail.com> wrote:
> You don't need to turn off the DB during build.  I'm just suggesting you remove
>
>  ?ssl=true&amp;sslfactory=org.postgresql.ssl.NonValidatingFactory&amp;
>
> for the build and then put it back into the context.xml so it runs
> with these options in production.
>
> Of course this assumes your DB will accept non-ssl connections during
> the build process...
>
> On 10/3/06, Raj M <mo...@gmail.com> wrote:
> > Aaron,
> > I could try that. But I don't which profiles to use to turn off the
> > 'db' during the test/build.
> > Is it 'nodb'?.
> > Thanks
> >
> > On 10/3/06, Aaron Evans <aa...@gmail.com> wrote:
> > > Could you leave the extra params out for the build and then put them
> > > back into jetspeed's context.xml once it is built?
> > >
> > > On 10/2/06, Raj M <mo...@gmail.com> wrote:
> > > > Greetings,
> > > > I am trying to do a source build where I need to connect to the DB
> > > > using additional
> > > > query parameters as below:
> > > >
> > > > <org.apache.jetspeed.test.database.url>jdbc:postgresql://xyz.com/testDB?ssl=true&amp;sslfactory=org.postgresql.ssl.NonValidatingFactory&amp;</org.apache.jetspeed.test.database.url>
> > > >
> > > > But, maven2 keeps complaining about '=' in the value parameter. Is
> > > > there any way to pass the
> > > > additional parameters. Here is the exception list:
> > > > ====
> > > > Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException:
> > > > entity reference name can not contain character =' (....
> > > > ====
> > > >
> > > > Thanks
> > > > MK
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > > > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: source build, configure db url

Posted by Aaron Evans <aa...@gmail.com>.
You don't need to turn off the DB during build.  I'm just suggesting you remove

 ?ssl=true&amp;sslfactory=org.postgresql.ssl.NonValidatingFactory&amp;

for the build and then put it back into the context.xml so it runs
with these options in production.

Of course this assumes your DB will accept non-ssl connections during
the build process...

On 10/3/06, Raj M <mo...@gmail.com> wrote:
> Aaron,
> I could try that. But I don't which profiles to use to turn off the
> 'db' during the test/build.
> Is it 'nodb'?.
> Thanks
>
> On 10/3/06, Aaron Evans <aa...@gmail.com> wrote:
> > Could you leave the extra params out for the build and then put them
> > back into jetspeed's context.xml once it is built?
> >
> > On 10/2/06, Raj M <mo...@gmail.com> wrote:
> > > Greetings,
> > > I am trying to do a source build where I need to connect to the DB
> > > using additional
> > > query parameters as below:
> > >
> > > <org.apache.jetspeed.test.database.url>jdbc:postgresql://xyz.com/testDB?ssl=true&amp;sslfactory=org.postgresql.ssl.NonValidatingFactory&amp;</org.apache.jetspeed.test.database.url>
> > >
> > > But, maven2 keeps complaining about '=' in the value parameter. Is
> > > there any way to pass the
> > > additional parameters. Here is the exception list:
> > > ====
> > > Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException:
> > > entity reference name can not contain character =' (....
> > > ====
> > >
> > > Thanks
> > > MK
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: source build, configure db url

Posted by Raj M <mo...@gmail.com>.
Aaron,
I could try that. But I don't which profiles to use to turn off the
'db' during the test/build.
Is it 'nodb'?.
Thanks

On 10/3/06, Aaron Evans <aa...@gmail.com> wrote:
> Could you leave the extra params out for the build and then put them
> back into jetspeed's context.xml once it is built?
>
> On 10/2/06, Raj M <mo...@gmail.com> wrote:
> > Greetings,
> > I am trying to do a source build where I need to connect to the DB
> > using additional
> > query parameters as below:
> >
> > <org.apache.jetspeed.test.database.url>jdbc:postgresql://xyz.com/testDB?ssl=true&amp;sslfactory=org.postgresql.ssl.NonValidatingFactory&amp;</org.apache.jetspeed.test.database.url>
> >
> > But, maven2 keeps complaining about '=' in the value parameter. Is
> > there any way to pass the
> > additional parameters. Here is the exception list:
> > ====
> > Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException:
> > entity reference name can not contain character =' (....
> > ====
> >
> > Thanks
> > MK
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: source build, configure db url

Posted by Aaron Evans <aa...@gmail.com>.
Could you leave the extra params out for the build and then put them
back into jetspeed's context.xml once it is built?

On 10/2/06, Raj M <mo...@gmail.com> wrote:
> Greetings,
> I am trying to do a source build where I need to connect to the DB
> using additional
> query parameters as below:
>
> <org.apache.jetspeed.test.database.url>jdbc:postgresql://xyz.com/testDB?ssl=true&amp;sslfactory=org.postgresql.ssl.NonValidatingFactory&amp;</org.apache.jetspeed.test.database.url>
>
> But, maven2 keeps complaining about '=' in the value parameter. Is
> there any way to pass the
> additional parameters. Here is the exception list:
> ====
> Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException:
> entity reference name can not contain character =' (....
> ====
>
> Thanks
> MK
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org