You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrp4j-dev@portals.apache.org by "Diego Louzán (JIRA)" <ws...@ws.apache.org> on 2005/04/27 12:14:23 UTC
[jira] Created: (WSRP4J-55) WSRP4J incorrectly assumes there's always valid registration information
WSRP4J incorrectly assumes there's always valid registration information
------------------------------------------------------------------------
Key: WSRP4J-55
URL: http://issues.apache.org/jira/browse/WSRP4J-55
Project: WSRP4J
Type: Bug
Reporter: Diego Louzán
>From WSRP specification, section 6.1.9 "MarkupParams Type", page 31, line 29:
« [O] ClientData clientData »
The clientData structure in MarkupParams type is optional, it could be null. However, WSRP4J assumes there's always valid registration information. In case of WSRP4J, this registration information is in a file like portlets/proxyportlet/war/WEB-INF/persistence/producers/org.apache.wsrp4j.consumer.driver.ProducerImpl@wsrp4j-8081.xml:
[...]
<registration-data>
<consumer-name>WSRP4J Proxy Portlet</consumer-name>
<consumer-agent>WSRP4J Proxy Portlet</consumer-agent>
</registration-data>
[...]
In relation to code provided in #WSRP4J-40, take a look at this code for class org.apache.wsrp4j.consumer.driver.PortletDriverImpl:
private MarkupParams getMarkupParams(WSRPBaseRequest request)
{
MarkupParams markupParams = new MarkupParams();
ClientData clientData = new ClientData();
// lets just set this to the consumer agent for now
clientData.setUserAgent(producer.getRegistrationData().getConsumerAgent());
markupParams.setClientData(clientData);
[...]
}
This code produces a NullPointerException when producer.getRegistrationData() == null, that is, when there's no registration info specified in the xml file. A possible solution is to recode it like this:
private MarkupParams getMarkupParams(WSRPBaseRequest request)
{
MarkupParams markupParams = new MarkupParams();
ClientData clientData = null;
if (producer.getRegistrationData() != null)
{
clientData = new ClientData();
clientData.setUserAgent(producer.getRegistrationData().getConsumerAgent());
}
[...]
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Closed: (WSRP4J-55) WSRP4J incorrectly assumes there's always valid registration information
Posted by "Julie MacNaught (JIRA)" <ws...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/WSRP4J-55?page=all ]
Julie MacNaught closed WSRP4J-55:
---------------------------------
> WSRP4J incorrectly assumes there's always valid registration information
> ------------------------------------------------------------------------
>
> Key: WSRP4J-55
> URL: http://issues.apache.org/jira/browse/WSRP4J-55
> Project: WSRP4J
> Type: Bug
> Reporter: Diego Louzán
> Fix For: current (nightly)
>
> From WSRP specification, section 6.1.9 "MarkupParams Type", page 31, line 29:
> « [O] ClientData clientData »
> The clientData structure in MarkupParams type is optional, it could be null. However, WSRP4J assumes there's always valid registration information. In case of WSRP4J, this registration information is in a file like portlets/proxyportlet/war/WEB-INF/persistence/producers/org.apache.wsrp4j.consumer.driver.ProducerImpl@wsrp4j-8081.xml:
> [...]
> <registration-data>
> <consumer-name>WSRP4J Proxy Portlet</consumer-name>
> <consumer-agent>WSRP4J Proxy Portlet</consumer-agent>
> </registration-data>
> [...]
> In relation to code provided in #WSRP4J-40, take a look at this code for class org.apache.wsrp4j.consumer.driver.PortletDriverImpl:
> private MarkupParams getMarkupParams(WSRPBaseRequest request)
> {
> MarkupParams markupParams = new MarkupParams();
> ClientData clientData = new ClientData();
> // lets just set this to the consumer agent for now
> clientData.setUserAgent(producer.getRegistrationData().getConsumerAgent());
> markupParams.setClientData(clientData);
> [...]
> }
> This code produces a NullPointerException when producer.getRegistrationData() == null, that is, when there's no registration info specified in the xml file. A possible solution is to recode it like this:
> private MarkupParams getMarkupParams(WSRPBaseRequest request)
> {
> MarkupParams markupParams = new MarkupParams();
>
> ClientData clientData = null;
> if (producer.getRegistrationData() != null)
> {
> clientData = new ClientData();
> clientData.setUserAgent(producer.getRegistrationData().getConsumerAgent());
> }
> [...]
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Resolved: (WSRP4J-55) WSRP4J incorrectly assumes there's always valid registration information
Posted by "Julie MacNaught (JIRA)" <ws...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/WSRP4J-55?page=all ]
Julie MacNaught resolved WSRP4J-55:
-----------------------------------
Resolution: Fixed
Fix Version: current (nightly)
> WSRP4J incorrectly assumes there's always valid registration information
> ------------------------------------------------------------------------
>
> Key: WSRP4J-55
> URL: http://issues.apache.org/jira/browse/WSRP4J-55
> Project: WSRP4J
> Type: Bug
> Reporter: Diego Louzán
> Fix For: current (nightly)
>
> From WSRP specification, section 6.1.9 "MarkupParams Type", page 31, line 29:
> « [O] ClientData clientData »
> The clientData structure in MarkupParams type is optional, it could be null. However, WSRP4J assumes there's always valid registration information. In case of WSRP4J, this registration information is in a file like portlets/proxyportlet/war/WEB-INF/persistence/producers/org.apache.wsrp4j.consumer.driver.ProducerImpl@wsrp4j-8081.xml:
> [...]
> <registration-data>
> <consumer-name>WSRP4J Proxy Portlet</consumer-name>
> <consumer-agent>WSRP4J Proxy Portlet</consumer-agent>
> </registration-data>
> [...]
> In relation to code provided in #WSRP4J-40, take a look at this code for class org.apache.wsrp4j.consumer.driver.PortletDriverImpl:
> private MarkupParams getMarkupParams(WSRPBaseRequest request)
> {
> MarkupParams markupParams = new MarkupParams();
> ClientData clientData = new ClientData();
> // lets just set this to the consumer agent for now
> clientData.setUserAgent(producer.getRegistrationData().getConsumerAgent());
> markupParams.setClientData(clientData);
> [...]
> }
> This code produces a NullPointerException when producer.getRegistrationData() == null, that is, when there's no registration info specified in the xml file. A possible solution is to recode it like this:
> private MarkupParams getMarkupParams(WSRPBaseRequest request)
> {
> MarkupParams markupParams = new MarkupParams();
>
> ClientData clientData = null;
> if (producer.getRegistrationData() != null)
> {
> clientData = new ClientData();
> clientData.setUserAgent(producer.getRegistrationData().getConsumerAgent());
> }
> [...]
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira