You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@roller.apache.org by Dudee <gu...@gmail.com> on 2007/09/11 13:55:55 UTC

Help noob with rome propono !!

What am I doing wrong. I'm trying to post to my roller app but I get an
error. Looks like no workspace are found which is strange since the user has
a blog and when I look at the service-document there is a workspace. Help
needed!


Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0,
Size: 0
	at java.util.ArrayList.RangeCheck(Unknown Source)
	at java.util.ArrayList.get(Unknown Source)
	at Post1.main(Post1.java:19)



My Java-app:

import com.sun.syndication.propono.atom.client.*;
import java.io.FileInputStream;

public class Post1
{
    public static void main(String[] args) throws Exception {
    	
        String username = "admin";
        String password = "admin";
        String filepath = "Photo.jpg";
        String slug =  "Photo";
        String uri  ="http://localhost:8080/roller/roller-services/app";

        // Connect to service, GET Service Doc.
        ClientAtomService service = 
        AtomClientFactory.getAtomService(uri, username, password);

        // Find workspace
        ClientWorkspace workspace =
(ClientWorkspace)service.getWorkspaces().get(0);   ///LINE 19
        
        // Find first collection in workspace that will accept a JPG
        ClientCollection collection = (ClientCollection)
        workspace.findCollection(null, "image/jpg");    
        
        // Create entry, set title and content but don't POST it yet
        ClientMediaEntry entry = collection.createMediaEntry(
            slug, slug, "image/jpg", new FileInputStream(filepath)); 
        
        // POST entry to collection on server
        collection.addEntry(entry);
    }
}
-- 
View this message in context: http://www.nabble.com/Help-noob-with-rome-propono-%21%21-tf4422109s12275.html#a12613150
Sent from the Roller - User mailing list archive at Nabble.com.


Re: Help noob with rome propono !!

Posted by Dave <sn...@gmail.com>.
On 9/12/07, Dudee <gu...@gmail.com> wrote:
> Thanks for all the help. It's working now! :)
> I had put the rome-propono-0.6-snapshot.jar file in my roller lib folder, so
> I removed it and it's now working! :)

Glad to hear it.

There will definitely be some additional changes in Roller 4.0 RC2 and
the final Propono 0.6 releases so you'll want to re-test once those
come out.

- Dave

Re: Help noob with rome propono !!

Posted by Dudee <gu...@gmail.com>.
Thanks for all the help. It's working now! :)
I had put the rome-propono-0.6-snapshot.jar file in my roller lib folder, so
I removed it and it's now working! :)


Dave Johnson-8 wrote:
> 
> On 9/12/07, Dudee <gu...@gmail.com> wrote:
>> Thanks for all the help, but it's still not working.
>> I use all the jar-files from your download but I get a new error on the
>> last
>> line of code:
>>
>> Exception in thread "main"
>> com.sun.syndication.propono.utils.ProponoException: ERROR HTTP
>> status-code=500 status-line: HTTP/1.1 500
>> org.apache.roller.weblogger.webservices.atomprotocol.AppModuleImpl cannot
>> be
>> cast to com.sun.syndication.propono.atom.common.rome.AppModule
> 
> Sounds like you are mixing Roller jars in with your client-side jars.
> You should not have "org.apache.roller" packages in your client
> program's classpath.
> 
> What jars are you putting on the classpath when you run your client
> program?
> 
> - Dave
> 
> 

-- 
View this message in context: http://www.nabble.com/Help-noob-with-rome-propono-%21%21-tf4422109s12275.html#a12634594
Sent from the Roller - User mailing list archive at Nabble.com.


Re: Help noob with rome propono !!

Posted by Dave <sn...@gmail.com>.
On 9/12/07, Dudee <gu...@gmail.com> wrote:
> Thanks for all the help, but it's still not working.
> I use all the jar-files from your download but I get a new error on the last
> line of code:
>
> Exception in thread "main"
> com.sun.syndication.propono.utils.ProponoException: ERROR HTTP
> status-code=500 status-line: HTTP/1.1 500
> org.apache.roller.weblogger.webservices.atomprotocol.AppModuleImpl cannot be
> cast to com.sun.syndication.propono.atom.common.rome.AppModule

Sounds like you are mixing Roller jars in with your client-side jars.
You should not have "org.apache.roller" packages in your client
program's classpath.

What jars are you putting on the classpath when you run your client program?

- Dave

Re: Help noob with rome propono !!

Posted by Dudee <gu...@gmail.com>.
Thanks for all the help, but it's still not working.
I use all the jar-files from your download but I get a new error on the last
line of code:

Exception in thread "main"
com.sun.syndication.propono.utils.ProponoException: ERROR HTTP
status-code=500 status-line: HTTP/1.1 500
org.apache.roller.weblogger.webservices.atomprotocol.AppModuleImpl cannot be
cast to com.sun.syndication.propono.atom.common.rome.AppModule
	at
com.sun.syndication.propono.atom.client.ClientMediaEntry.addToCollection(ClientMediaEntry.java:259)
	at
com.sun.syndication.propono.atom.client.ClientCollection.addEntry(ClientCollection.java:212)
	at Post1.main(Post1.java:34)

LOG:
DEBUG 2007-09-12 14:18:17,455 AtomServlet:doGet - Entering
DEBUG 2007-09-12 14:18:17,455 AtomServlet:createAtomRequestHandler -
Creating Atom handler
DEBUG 2007-09-12 14:18:17,468 RollerAtomHandler:getIntrospection - Entering
DEBUG 2007-09-12 14:18:17,498 RollerAtomHandler:getIntrospection - Exiting
DEBUG 2007-09-12 14:18:17,499 AtomServlet:doGet - Exiting
DEBUG 2007-09-12 14:18:17,722 AtomServlet:doPost - Entering
DEBUG 2007-09-12 14:18:17,722 AtomServlet:createAtomRequestHandler -
Creating Atom handler
DEBUG 2007-09-12 14:18:17,736 RollerAtomHandler:postMedia - Entering
DEBUG 2007-09-12 14:18:17,804 RollerAtomHandler:postMedia - Exiting
DEBUG 2007-09-12 14:18:17,806 AtomServlet:doPost -
java.lang.ClassCastException:
org.apache.roller.weblogger.webservices.atomprotocol.AppModuleImpl cannot be
cast to com.sun.syndication.propono.atom.common.rome.AppModule
DEBUG 2007-09-12 14:18:17,806 AtomServlet:doPost - Exiting



Dave Johnson-8 wrote:
> 
> On 9/12/07, Dudee <gu...@gmail.com> wrote:
>> Where can I find rome-0.9.1-dev.jar? It's not included in Propono 0.6.
> 
> Here's the full Propono 0.6 (pre-release snapshot) build with all
> dependencies:
> http://people.apache.org/~snoopdave/experimental/rome-propono-0.6-20070912.zip
> 
> - Dave
> 
> 

-- 
View this message in context: http://www.nabble.com/Help-noob-with-rome-propono-%21%21-tf4422109s12275.html#a12634284
Sent from the Roller - User mailing list archive at Nabble.com.


Re: Help noob with rome propono !!

Posted by Dave <sn...@gmail.com>.
On 9/12/07, Dudee <gu...@gmail.com> wrote:
> Where can I find rome-0.9.1-dev.jar? It's not included in Propono 0.6.

Here's the full Propono 0.6 (pre-release snapshot) build with all dependencies:
http://people.apache.org/~snoopdave/experimental/rome-propono-0.6-20070912.zip

- Dave

Re: Help noob with rome propono !!

Posted by Dudee <gu...@gmail.com>.
Where can I find rome-0.9.1-dev.jar? It's not included in Propono 0.6.


Dave Johnson-8 wrote:
> 
> On 9/12/07, Dudee <gu...@gmail.com> wrote:
>> Thanks for the help.
>> Fixed the file-upload settings but got a new error I don't understand.
>> It's on the last line of code,
>>
>> Exception in thread "main" java.lang.IllegalAccessError: tried to access
>> method
>> com.sun.syndication.io.impl.Atom10Parser.isAbsoluteURI(Ljava/lang/String;)Z
>> from class com.sun.syndication.propono.atom.common.Collection
>>         at
>> com.sun.syndication.propono.atom.common.Collection.getHrefResolved(Collection.java:97)
>>         at
>> com.sun.syndication.propono.atom.client.ClientMediaEntry.addToCollection(ClientMediaEntry.java:236)
>>         at
>> com.sun.syndication.propono.atom.client.ClientCollection.addEntry(ClientCollection.java:212)
>>         at Post1.main(Post1.java:30)
>>
>> Whats the problem?
> 
> Propono 0.6 depoends on some changes that are in ROME 0.9.1-dev so it
> includes rome-0.9.1-dev.jar. Is there a chance that you also have a
> copy of rome-0.9.jar in your classpath?
> 
> - Dave
> 
> 

-- 
View this message in context: http://www.nabble.com/Help-noob-with-rome-propono-%21%21-tf4422109s12275.html#a12633602
Sent from the Roller - User mailing list archive at Nabble.com.


Re: Help noob with rome propono !!

Posted by Dave <sn...@gmail.com>.
On 9/12/07, Dudee <gu...@gmail.com> wrote:
> Thanks for the help.
> Fixed the file-upload settings but got a new error I don't understand.
> It's on the last line of code,
>
> Exception in thread "main" java.lang.IllegalAccessError: tried to access
> method
> com.sun.syndication.io.impl.Atom10Parser.isAbsoluteURI(Ljava/lang/String;)Z
> from class com.sun.syndication.propono.atom.common.Collection
>         at
> com.sun.syndication.propono.atom.common.Collection.getHrefResolved(Collection.java:97)
>         at
> com.sun.syndication.propono.atom.client.ClientMediaEntry.addToCollection(ClientMediaEntry.java:236)
>         at
> com.sun.syndication.propono.atom.client.ClientCollection.addEntry(ClientCollection.java:212)
>         at Post1.main(Post1.java:30)
>
> Whats the problem?

Propono 0.6 depoends on some changes that are in ROME 0.9.1-dev so it
includes rome-0.9.1-dev.jar. Is there a chance that you also have a
copy of rome-0.9.jar in your classpath?

- Dave

Re: Help noob with rome propono !!

Posted by Dudee <gu...@gmail.com>.
Thanks for the help.
Fixed the file-upload settings but got a new error I don't understand.
It's on the last line of code,

Exception in thread "main" java.lang.IllegalAccessError: tried to access
method
com.sun.syndication.io.impl.Atom10Parser.isAbsoluteURI(Ljava/lang/String;)Z
from class com.sun.syndication.propono.atom.common.Collection
	at
com.sun.syndication.propono.atom.common.Collection.getHrefResolved(Collection.java:97)
	at
com.sun.syndication.propono.atom.client.ClientMediaEntry.addToCollection(ClientMediaEntry.java:236)
	at
com.sun.syndication.propono.atom.client.ClientCollection.addEntry(ClientCollection.java:212)
	at Post1.main(Post1.java:30)

Whats the problem?


Dave Johnson-8 wrote:
> 
> On 9/11/07, Dudee <gu...@gmail.com> wrote:
>>
>> Hi again,
>> I upgrade to Propono 0.6 and that solved the problem but gave me a new
>> one.
>> "Exception in thread "main" java.lang.NullPointerException at
>> Post1.main(Post1.java:26)"
>>
>> Line 26: ClientMediaEntry entry = collection.createMediaEntry(slug, slug,
>> "image/jpg", new FileInputStream(filepath));
>>
>> The roller log gave me this:
>> DEBUG 2007-09-11 15:42:33,233 AtomServlet:createAtomRequestHandler -
>> Creating Atom handler
>> DEBUG 2007-09-11 15:42:33,250 RollerAtomHandler:getIntrospection -
>> Entering
>> DEBUG 2007-09-11 15:42:33,276 RollerAtomHandler:getIntrospection -
>> Exiting
>> DEBUG 2007-09-11 15:42:33,278 AtomServlet:doGet - Exiting
>>
>> I don't know what the problem is now.
> 
> Sounds like this call is returning a null collection:
> 
>     ClientCollection collection = (ClientCollection)
>         workspace.findCollection(null, "image/jpg");
> 
> Which means that no collection could be found for content type
> "image/jpg".
> 
> Make sure your file-upload settings allow "image/jpg" or "image/*" if
> you want to allow all image types. You can set the list of allowed
> File Upload types on the Server Admin page.
> 
> - Dave
> 
> 

-- 
View this message in context: http://www.nabble.com/Help-noob-with-rome-propono-%21%21-tf4422109s12275.html#a12629426
Sent from the Roller - User mailing list archive at Nabble.com.


Re: Help noob with rome propono !!

Posted by Dave <sn...@gmail.com>.
On 9/11/07, Dudee <gu...@gmail.com> wrote:
>
> Hi again,
> I upgrade to Propono 0.6 and that solved the problem but gave me a new one.
> "Exception in thread "main" java.lang.NullPointerException at
> Post1.main(Post1.java:26)"
>
> Line 26: ClientMediaEntry entry = collection.createMediaEntry(slug, slug,
> "image/jpg", new FileInputStream(filepath));
>
> The roller log gave me this:
> DEBUG 2007-09-11 15:42:33,233 AtomServlet:createAtomRequestHandler -
> Creating Atom handler
> DEBUG 2007-09-11 15:42:33,250 RollerAtomHandler:getIntrospection - Entering
> DEBUG 2007-09-11 15:42:33,276 RollerAtomHandler:getIntrospection - Exiting
> DEBUG 2007-09-11 15:42:33,278 AtomServlet:doGet - Exiting
>
> I don't know what the problem is now.

Sounds like this call is returning a null collection:

    ClientCollection collection = (ClientCollection)
        workspace.findCollection(null, "image/jpg");

Which means that no collection could be found for content type "image/jpg".

Make sure your file-upload settings allow "image/jpg" or "image/*" if
you want to allow all image types. You can set the list of allowed
File Upload types on the Server Admin page.

- Dave

Re: Help noob with rome propono !!

Posted by Dudee <gu...@gmail.com>.
Hi again,
I upgrade to Propono 0.6 and that solved the problem but gave me a new one.
"Exception in thread "main" java.lang.NullPointerException at
Post1.main(Post1.java:26)"

Line 26: ClientMediaEntry entry = collection.createMediaEntry(slug, slug,
"image/jpg", new FileInputStream(filepath)); 

The roller log gave me this:
DEBUG 2007-09-11 15:42:33,233 AtomServlet:createAtomRequestHandler -
Creating Atom handler
DEBUG 2007-09-11 15:42:33,250 RollerAtomHandler:getIntrospection - Entering
DEBUG 2007-09-11 15:42:33,276 RollerAtomHandler:getIntrospection - Exiting
DEBUG 2007-09-11 15:42:33,278 AtomServlet:doGet - Exiting

I don't know what the problem is now.




Dave Johnson-8 wrote:
> 
> Turn on debugging for Atom, restart Roller, make a post and take a
> look at what happened in the logs at the time you made that post.
> 
> To enable Atom protocol debug, add this to your roller-custom.properties
> file:
> log4j.category.org.apache.roller.weblogger.webservices.atomprotocol=DEBUG
> 
> The problem might be that Roller 4.0 has been updated for the final
> APP spec and Propono 0.5 has not. I just uploaded a snapshot of
> Propono 0.6, which has been updated and is just about ready for
> release:
> 
>   
> http://people.apache.org/~snoopdave/experimental/rome-propono-0.6-snapshot.jar
> 
> - Dave
> 
> 
> 
> On 9/11/07, Dudee <gu...@gmail.com> wrote:
>>
>> OK, I'm using:
>> Apache Roller Weblogger Version 4.0
>> MySQL 5 (I know this is working at least, because I get another error
>> when
>> username and password is incorrect.)
>> Tomcat 5.5
>> Java 6.0
>> Rome Propono 0.5 (latest release)
>> Windows Vista
>> Blogger and MetaWeblog API support is enabled.
>>
>>
>>
>>
>> Dave Johnson-8 wrote:
>> >
>> > On 9/11/07, Dudee <gu...@gmail.com> wrote:
>> >> What am I doing wrong. I'm trying to post to my roller app but I get
>> an
>> >> error. Looks like no workspace are found which is strange since the
>> user
>> >> has
>> >> a blog and when I look at the service-document there is a workspace.
>> Help
>> >> needed!
>> >
>> > It's almost always helpful to answer the standard questions when
>> > seeking Roller support:
>> > -What version of Roller are you using? If you are building from
>> > sources, on which branch are you building?
>> > - What Application Server version are you using?
>> > - What database are you using?
>> > - What Java version are you using?
>> > - What operating system are you using?
>> >
>> > And which version of Propono?
>> >
>> > And note that you have to enable Blogger and MetaWeblog API support on
>> > your weblog's preferences page for APP to work.
>> >
>> > - Dave
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Help-noob-with-rome-propono-%21%21-tf4422109s12275.html#a12613694
>> Sent from the Roller - User mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Help-noob-with-rome-propono-%21%21-tf4422109s12275.html#a12615130
Sent from the Roller - User mailing list archive at Nabble.com.


Re: Help noob with rome propono !!

Posted by Dave <sn...@gmail.com>.
Turn on debugging for Atom, restart Roller, make a post and take a
look at what happened in the logs at the time you made that post.

To enable Atom protocol debug, add this to your roller-custom.properties file:
log4j.category.org.apache.roller.weblogger.webservices.atomprotocol=DEBUG

The problem might be that Roller 4.0 has been updated for the final
APP spec and Propono 0.5 has not. I just uploaded a snapshot of
Propono 0.6, which has been updated and is just about ready for
release:

   http://people.apache.org/~snoopdave/experimental/rome-propono-0.6-snapshot.jar

- Dave



On 9/11/07, Dudee <gu...@gmail.com> wrote:
>
> OK, I'm using:
> Apache Roller Weblogger Version 4.0
> MySQL 5 (I know this is working at least, because I get another error when
> username and password is incorrect.)
> Tomcat 5.5
> Java 6.0
> Rome Propono 0.5 (latest release)
> Windows Vista
> Blogger and MetaWeblog API support is enabled.
>
>
>
>
> Dave Johnson-8 wrote:
> >
> > On 9/11/07, Dudee <gu...@gmail.com> wrote:
> >> What am I doing wrong. I'm trying to post to my roller app but I get an
> >> error. Looks like no workspace are found which is strange since the user
> >> has
> >> a blog and when I look at the service-document there is a workspace. Help
> >> needed!
> >
> > It's almost always helpful to answer the standard questions when
> > seeking Roller support:
> > -What version of Roller are you using? If you are building from
> > sources, on which branch are you building?
> > - What Application Server version are you using?
> > - What database are you using?
> > - What Java version are you using?
> > - What operating system are you using?
> >
> > And which version of Propono?
> >
> > And note that you have to enable Blogger and MetaWeblog API support on
> > your weblog's preferences page for APP to work.
> >
> > - Dave
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Help-noob-with-rome-propono-%21%21-tf4422109s12275.html#a12613694
> Sent from the Roller - User mailing list archive at Nabble.com.
>
>

Re: Help noob with rome propono !!

Posted by Dudee <gu...@gmail.com>.
OK, I'm using:
Apache Roller Weblogger Version 4.0 
MySQL 5 (I know this is working at least, because I get another error when
username and password is incorrect.)
Tomcat 5.5
Java 6.0
Rome Propono 0.5 (latest release)
Windows Vista
Blogger and MetaWeblog API support is enabled.




Dave Johnson-8 wrote:
> 
> On 9/11/07, Dudee <gu...@gmail.com> wrote:
>> What am I doing wrong. I'm trying to post to my roller app but I get an
>> error. Looks like no workspace are found which is strange since the user
>> has
>> a blog and when I look at the service-document there is a workspace. Help
>> needed!
> 
> It's almost always helpful to answer the standard questions when
> seeking Roller support:
> -What version of Roller are you using? If you are building from
> sources, on which branch are you building?
> - What Application Server version are you using?
> - What database are you using?
> - What Java version are you using?
> - What operating system are you using?
> 
> And which version of Propono?
> 
> And note that you have to enable Blogger and MetaWeblog API support on
> your weblog's preferences page for APP to work.
> 
> - Dave
> 
> 

-- 
View this message in context: http://www.nabble.com/Help-noob-with-rome-propono-%21%21-tf4422109s12275.html#a12613694
Sent from the Roller - User mailing list archive at Nabble.com.


Re: Help noob with rome propono !!

Posted by Dave <sn...@gmail.com>.
On 9/11/07, Dudee <gu...@gmail.com> wrote:
> What am I doing wrong. I'm trying to post to my roller app but I get an
> error. Looks like no workspace are found which is strange since the user has
> a blog and when I look at the service-document there is a workspace. Help
> needed!

It's almost always helpful to answer the standard questions when
seeking Roller support:
-What version of Roller are you using? If you are building from
sources, on which branch are you building?
- What Application Server version are you using?
- What database are you using?
- What Java version are you using?
- What operating system are you using?

And which version of Propono?

And note that you have to enable Blogger and MetaWeblog API support on
your weblog's preferences page for APP to work.

- Dave