You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by 安藤 正 <ta...@brycen.co.jp> on 2009/01/23 09:55:09 UTC

Problem when XML file is up-loaded

I'm sorry for my poor English. 

The following problems happen. 

1)The xml file was up-loaded through SimpleWebdavServlet.
  PersistenceManager was
org.apache.jackrabbit.core.state.xml.XMLPersistenceManager. 

2)The file was downloaded. 

And, the content of xml changes. 

Why is it changed?

The following are content of the change. 

Up-loaded xml:
<?xml version="1.0" encoding="UTF-8"?>
<configdata>
	<!--
		connfig selection
	-->
	<selectConfig>production</selectConfig>
	<!--
		prod
	-->
	<production>
		<code>
			<params>
				<base>Shift_JIS</base>
			</params>
		</code>
	
Downloaded XML:
<?xml version="1.0" encoding="UTF-8" ?> 
 <configdata xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
xmlns:fn_old="http://www.w3.org/2004/10/xpath-functions"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:rep="internal"
xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="nt:unstructured">
  <selectConfig jcr:primaryType="nt:unstructured">production</selectConfig> 
 <production jcr:primaryType="nt:unstructured">
 <code jcr:primaryType="nt:unstructured">
 <params jcr:primaryType="nt:unstructured">
  <base jcr:primaryType="nt:unstructured">Shift_JIS</base> 
  </params>
  </code>


Re: Problem when XML file is up-loaded

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Fri, Jan 23, 2009 at 9:55 AM, 安藤 正 <ta...@brycen.co.jp> wrote:
> 1)The xml file was up-loaded through SimpleWebdavServlet.
>  PersistenceManager was
> org.apache.jackrabbit.core.state.xml.XMLPersistenceManager.
>
> 2)The file was downloaded.
>
> And, the content of xml changes.
>
> Why is it changed?

The default configuration of SimpleWebdavServlet contains a special
handler for XML files. This handler
(org.apache.jackrabbit.server.io.XmlHandler) will convert the incoming
XML to a JCR node tree on import and back to XML on export using the
document view mapping defined in the JCR spec.

You can disable this feature by removing the XmlHandler entry from the
config.xml file used to configure the SimpleWebdavServlet.

BR,

Jukka Zitting

RE: Problem when XML file is up-loaded

Posted by 安藤 正 <ta...@brycen.co.jp>.
I am ashamed. . . 

It was cash of IE. I'm sorry.

-----Original Message-----
From: 安藤 正 [mailto:tando@brycen.co.jp] 
Sent: Monday, January 26, 2009 10:27 AM
To: users@jackrabbit.apache.org
Subject: RE: Problem when XML file is up-loaded

The following reports that I wrote were wrong. 
- - - - - - - - - - - - - - - - - - - - I was troubled even if I removed
org.apache.jackrabbit.server.io.XmlHandler
of config.xml because it was the same result.  
- - - - - - - - - - - - - - - - - - - - 

I removed it from propertymanager, but did not remove it from iomanager. 

A download was made when I removed it from both without it being converted. 

However, it is converted, and it is displayed when I double-click in client
(IE). 

Will not there be the method to prevent this?


RE: Problem when XML file is up-loaded

Posted by 安藤 正 <ta...@brycen.co.jp>.
The following reports that I wrote were wrong. 
- - - - - - - - - - - - - - - - - - - - 
I was troubled even if I removed org.apache.jackrabbit.server.io.XmlHandler 
of config.xml because it was the same result.  
- - - - - - - - - - - - - - - - - - - - 

I removed it from propertymanager, but did not remove it from iomanager. 

A download was made when I removed it from both without it being converted. 

However, it is converted, and it is displayed when I double-click in client
(IE). 

Will not there be the method to prevent this?


RE: Problem when XML file is up-loaded

Posted by "Connor, Brett (LNG-TWY)" <Br...@lexisnexis.co.uk>.
The conversion Jukka describes happens on the upload (I think) not the download. Are you just trying to download the file you had previously or are you uploading a new file now you've made the change?
 

-----Original Message-----
From: 安藤 正 [mailto:tando@brycen.co.jp] 
Sent: 23 January 2009 09:48
To: users@jackrabbit.apache.org
Subject: RE: Problem when XML file is up-loaded

Thank you, everyone. 

I was troubled even if I removed org.apache.jackrabbit.server.io.XmlHandler
of config.xml because it was the same result. 

I try JCR-Explorer.

-----Original Message-----
From: Johannes Boneschanscher [mailto:jackrabbit@boneschanscher.net]
Sent: Friday, January 23, 2009 6:36 PM
To: users@jackrabbit.apache.org
Subject: Re: Problem when XML file is up-loaded

I expect that the way you download it is wrong, it may help to use this tool to look at the structure and contents of Jackrabbit:

http://www.jcr-explorer.org/

Regards,

Johannes

安藤 正 wrote:
> I'm sorry for my poor English. 
>
> The following problems happen. 
>
> 1)The xml file was up-loaded through SimpleWebdavServlet.
>   PersistenceManager was
> org.apache.jackrabbit.core.state.xml.XMLPersistenceManager. 
>
> 2)The file was downloaded. 
>
> And, the content of xml changes. 
>
> Why is it changed?
>
> The following are content of the change. 
>
> Up-loaded xml:
> <?xml version="1.0" encoding="UTF-8"?> <configdata>
> 	<!--
> 		connfig selection
> 	-->
> 	<selectConfig>production</selectConfig>
> 	<!--
> 		prod
> 	-->
> 	<production>
> 		<code>
> 			<params>
> 				<base>Shift_JIS</base>
> 			</params>
> 		</code>
> 	
> Downloaded XML:
> <?xml version="1.0" encoding="UTF-8" ?>  <configdata 
> xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
> xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
> xmlns:fn_old="http://www.w3.org/2004/10/xpath-functions"
> xmlns:fn="http://www.w3.org/2005/xpath-functions"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:rep="internal"
> xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="nt:unstructured">
>   <selectConfig
> jcr:primaryType="nt:unstructured">production</selectConfig>
>  <production jcr:primaryType="nt:unstructured">
>  <code jcr:primaryType="nt:unstructured">
>  <params jcr:primaryType="nt:unstructured">
>   <base jcr:primaryType="nt:unstructured">Shift_JIS</base> 
>   </params>
>   </code>
>
>   


LexisNexis is a trading name of REED ELSEVIER (UK) LIMITED - Registered office - 1-3 STRAND, LONDON WC2N 5JR
Registered in England - Company No. 02746621


RE: Problem when XML file is up-loaded

Posted by 安藤 正 <ta...@brycen.co.jp>.
Thank you, everyone. 

I was troubled even if I removed org.apache.jackrabbit.server.io.XmlHandler
of config.xml because it was the same result. 

I try JCR-Explorer.

-----Original Message-----
From: Johannes Boneschanscher [mailto:jackrabbit@boneschanscher.net] 
Sent: Friday, January 23, 2009 6:36 PM
To: users@jackrabbit.apache.org
Subject: Re: Problem when XML file is up-loaded

I expect that the way you download it is wrong, it may help to use this tool
to look at the structure and contents of Jackrabbit:

http://www.jcr-explorer.org/

Regards,

Johannes

安藤 正 wrote:
> I'm sorry for my poor English. 
>
> The following problems happen. 
>
> 1)The xml file was up-loaded through SimpleWebdavServlet.
>   PersistenceManager was
> org.apache.jackrabbit.core.state.xml.XMLPersistenceManager. 
>
> 2)The file was downloaded. 
>
> And, the content of xml changes. 
>
> Why is it changed?
>
> The following are content of the change. 
>
> Up-loaded xml:
> <?xml version="1.0" encoding="UTF-8"?> <configdata>
> 	<!--
> 		connfig selection
> 	-->
> 	<selectConfig>production</selectConfig>
> 	<!--
> 		prod
> 	-->
> 	<production>
> 		<code>
> 			<params>
> 				<base>Shift_JIS</base>
> 			</params>
> 		</code>
> 	
> Downloaded XML:
> <?xml version="1.0" encoding="UTF-8" ?>  <configdata 
> xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
> xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
> xmlns:fn_old="http://www.w3.org/2004/10/xpath-functions"
> xmlns:fn="http://www.w3.org/2005/xpath-functions"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:rep="internal"
> xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="nt:unstructured">
>   <selectConfig 
> jcr:primaryType="nt:unstructured">production</selectConfig>
>  <production jcr:primaryType="nt:unstructured">
>  <code jcr:primaryType="nt:unstructured">
>  <params jcr:primaryType="nt:unstructured">
>   <base jcr:primaryType="nt:unstructured">Shift_JIS</base> 
>   </params>
>   </code>
>
>   


RE: Problem reading from Repository useing ocm

Posted by "Ye, Forest (MAN-Corporate)" <Fo...@manheim.com>.
It seems you do not have a default constructor.





-----Original Message-----
From: Kurz Wolfgang [mailto:wolfgang.kurz@gwvs.de] 
Sent: Friday, January 23, 2009 5:27 AM
To: users@jackrabbit.apache.org
Subject: Problem reading from Repository useing ocm

Hello everyone,

I have a problem readign my content from the repository useing ocm.

This is what I do:

I create a entry like this:

private boolean createArtikelContent(JCRArtikelContent entry) {		
		try {
			ObjectContentManager ocm =
ocmFactory.createObjectContentManager();			
			ocm.insert(entry);
			ocm.save();		
			
			return true;
		} catch (RepositoryException e) {
			logger.error(e.getLocalizedMessage(), e);
			return false;
		} catch (ObjectContentManagerException e) {
			logger.error(e.getLocalizedMessage(), e);
			return false;
		}		
	}

When I check with the WebdaV browser in the jackrabbit web application I
can see it created a Artikel node.

Then I try to read from the repository:

private List<JCRContentNode> getContentEntrysByMenuId(final long menuId,
final boolean all, final boolean article,
			final boolean document, final boolean form,
final boolean report, final boolean independentDocumentsOnly) {		
			
		try{			
						
			ObjectContentManager ocm =
ocmFactory.createObjectContentManager();
						
			org.apache.jackrabbit.ocm.query.QueryManager
queryManager = ocm.getQueryManager();
						
			Filter filter =
queryManager.createFilter(JCRArtikelContent.class);
	

			org.apache.jackrabbit.ocm.query.Query query =
queryManager.createQuery(filter);
						
			List<JCRArtikelContent> artikelList =
(List<JCRArtikelContent>)ocm.getObjects(query);			
			
			
		} catch (Exception e) {			
						
			e.printStackTrace();
			logger.error(e.getLocalizedMessage(), e);
			return null;
		}		
		return null;
}

And I get the following error:

org.apache.jackrabbit.ocm.exception.JcrMappingException: Cannot create
instance for class
de.gwvs.tos.commons.jackrabbit.domain.JCRArtikelContent; nested
exception is java.lang.InstantiationException:
de.gwvs.tos.commons.jackrabbit.domain.JCRArtikelContent
java.lang.InstantiationException:
de.gwvs.tos.commons.jackrabbit.domain.JCRArtikelContent
	at java.lang.Class.newInstance0(Unknown Source)
	at java.lang.Class.newInstance(Unknown Source)
	at
org.apache.jackrabbit.ocm.reflection.ReflectionUtils.newInstance(Reflect
ionUtils.java:172)
	at
org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterIm
pl.getObject(ObjectConverterImpl.java:388)
	at
org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.getObjec
ts(ObjectContentManagerImpl.java:624)
	at
org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.getObjec
ts(ObjectContentManagerImpl.java:548)
	at
de.gwvs.tos.commons.jackrabbit.dao.jcr.JCRDaoImpl.getContentEntrysByMenu
Id(JCRDaoImpl.java:1262)



Anyone have an idea what I am doing wrong?

Thx a lot in Advance!

Problem reading from Repository useing ocm

Posted by Kurz Wolfgang <wo...@gwvs.de>.
Hello everyone,

I have a problem readign my content from the repository useing ocm.

This is what I do:

I create a entry like this:

private boolean createArtikelContent(JCRArtikelContent entry) {		
		try {
			ObjectContentManager ocm = ocmFactory.createObjectContentManager();			
			ocm.insert(entry);
			ocm.save();		
			
			return true;
		} catch (RepositoryException e) {
			logger.error(e.getLocalizedMessage(), e);
			return false;
		} catch (ObjectContentManagerException e) {
			logger.error(e.getLocalizedMessage(), e);
			return false;
		}		
	}

When I check with the WebdaV browser in the jackrabbit web application I can see it created a Artikel node.

Then I try to read from the repository:

private List<JCRContentNode> getContentEntrysByMenuId(final long menuId, final boolean all, final boolean article,
			final boolean document, final boolean form, final boolean report, final boolean independentDocumentsOnly) {		
			
		try{			
						
			ObjectContentManager ocm = ocmFactory.createObjectContentManager();
						
			org.apache.jackrabbit.ocm.query.QueryManager queryManager = ocm.getQueryManager();
						
			Filter filter = queryManager.createFilter(JCRArtikelContent.class);
										
			org.apache.jackrabbit.ocm.query.Query query = queryManager.createQuery(filter);
						
			List<JCRArtikelContent> artikelList = (List<JCRArtikelContent>)ocm.getObjects(query);			
			
			
		} catch (Exception e) {			
						
			e.printStackTrace();
			logger.error(e.getLocalizedMessage(), e);
			return null;
		}		
		return null;
}

And I get the following error:

org.apache.jackrabbit.ocm.exception.JcrMappingException: Cannot create instance for class de.gwvs.tos.commons.jackrabbit.domain.JCRArtikelContent; nested exception is java.lang.InstantiationException: de.gwvs.tos.commons.jackrabbit.domain.JCRArtikelContent
java.lang.InstantiationException: de.gwvs.tos.commons.jackrabbit.domain.JCRArtikelContent
	at java.lang.Class.newInstance0(Unknown Source)
	at java.lang.Class.newInstance(Unknown Source)
	at org.apache.jackrabbit.ocm.reflection.ReflectionUtils.newInstance(ReflectionUtils.java:172)
	at org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.getObject(ObjectConverterImpl.java:388)
	at org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.getObjects(ObjectContentManagerImpl.java:624)
	at org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.getObjects(ObjectContentManagerImpl.java:548)
	at de.gwvs.tos.commons.jackrabbit.dao.jcr.JCRDaoImpl.getContentEntrysByMenuId(JCRDaoImpl.java:1262)



Anyone have an idea what I am doing wrong?

Thx a lot in Advance!

AW: Problem when XML file is up-loaded

Posted by Kurz Wolfgang <wo...@gwvs.de>.
When i tried to use this explorer I get the following error:

javax.faces.FacesException: Could not retrieve value of component with path : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /login.jsp][Class: javax.faces.component.html.HtmlForm,Id: _idJsp0][Class: javax.faces.component.html.HtmlPanelGrid,Id: _idJsp3][Class: javax.faces.component.html.HtmlInputText,Id: JNDIName]}

Could it be that my JNDI isn’t configured correctly in my Tomcat server?
And if so could someone give me a hint on how to configure the server so I can use this explorer?

Thx a lot!

-----Ursprüngliche Nachricht-----
Von: Johannes Boneschanscher [mailto:jackrabbit@boneschanscher.net] 
Gesendet: Freitag, 23. Januar 2009 10:36
An: users@jackrabbit.apache.org
Betreff: Re: Problem when XML file is up-loaded

I expect that the way you download it is wrong, it may help to use this
tool to look at the structure and contents of Jackrabbit:

http://www.jcr-explorer.org/

Regards,

Johannes

安藤 正 wrote:
> I'm sorry for my poor English. 
>
> The following problems happen. 
>
> 1)The xml file was up-loaded through SimpleWebdavServlet.
>   PersistenceManager was
> org.apache.jackrabbit.core.state.xml.XMLPersistenceManager. 
>
> 2)The file was downloaded. 
>
> And, the content of xml changes. 
>
> Why is it changed?
>
> The following are content of the change. 
>
> Up-loaded xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <configdata>
> 	<!--
> 		connfig selection
> 	-->
> 	<selectConfig>production</selectConfig>
> 	<!--
> 		prod
> 	-->
> 	<production>
> 		<code>
> 			<params>
> 				<base>Shift_JIS</base>
> 			</params>
> 		</code>
> 	
> Downloaded XML:
> <?xml version="1.0" encoding="UTF-8" ?> 
>  <configdata xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
> xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
> xmlns:fn_old="http://www.w3.org/2004/10/xpath-functions"
> xmlns:fn="http://www.w3.org/2005/xpath-functions"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:rep="internal"
> xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="nt:unstructured">
>   <selectConfig jcr:primaryType="nt:unstructured">production</selectConfig> 
>  <production jcr:primaryType="nt:unstructured">
>  <code jcr:primaryType="nt:unstructured">
>  <params jcr:primaryType="nt:unstructured">
>   <base jcr:primaryType="nt:unstructured">Shift_JIS</base> 
>   </params>
>   </code>
>
>   


Re: Problem when XML file is up-loaded

Posted by Johannes Boneschanscher <ja...@boneschanscher.net>.
I expect that the way you download it is wrong, it may help to use this
tool to look at the structure and contents of Jackrabbit:

http://www.jcr-explorer.org/

Regards,

Johannes

安藤 正 wrote:
> I'm sorry for my poor English. 
>
> The following problems happen. 
>
> 1)The xml file was up-loaded through SimpleWebdavServlet.
>   PersistenceManager was
> org.apache.jackrabbit.core.state.xml.XMLPersistenceManager. 
>
> 2)The file was downloaded. 
>
> And, the content of xml changes. 
>
> Why is it changed?
>
> The following are content of the change. 
>
> Up-loaded xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <configdata>
> 	<!--
> 		connfig selection
> 	-->
> 	<selectConfig>production</selectConfig>
> 	<!--
> 		prod
> 	-->
> 	<production>
> 		<code>
> 			<params>
> 				<base>Shift_JIS</base>
> 			</params>
> 		</code>
> 	
> Downloaded XML:
> <?xml version="1.0" encoding="UTF-8" ?> 
>  <configdata xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
> xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
> xmlns:fn_old="http://www.w3.org/2004/10/xpath-functions"
> xmlns:fn="http://www.w3.org/2005/xpath-functions"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:rep="internal"
> xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="nt:unstructured">
>   <selectConfig jcr:primaryType="nt:unstructured">production</selectConfig> 
>  <production jcr:primaryType="nt:unstructured">
>  <code jcr:primaryType="nt:unstructured">
>  <params jcr:primaryType="nt:unstructured">
>   <base jcr:primaryType="nt:unstructured">Shift_JIS</base> 
>   </params>
>   </code>
>
>