4

I have a web app with the Tridion jars included. When I try to use the API, I get the following error:

11:36:51,353 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/nhweb-web].[bookingProcess]] (http-localhost/127.0.0.1:8080-1) JBWEB000236: Servlet.service() for servlet bookingProcess threw exception: java.lang.IllegalArgumentException: URI scheme is not "file" at java.io.File.(File.java:395) [rt.jar:1.7.0] at com.tridion.storage.StorageConfigurationLoader.writeNewConfigurationToFile(StorageConfigurationLoader.java:141) [cd_datalayer-2013.jar:] at com.tridion.storage.StorageConfigurationLoader.handleBrokerConfiguration(StorageConfigurationLoader.java:111) [cd_datalayer-2013.jar:] at com.tridion.storage.StorageConfigurationLoader.loadConfiguration(StorageConfigurationLoader.java:77) [cd_datalayer-2013.jar:] at com.tridion.storage.StorageConfigurationLoader.(StorageConfigurationLoader.java:61) [cd_datalayer-2013.jar:] at com.tridion.storage.StorageConfigurationLoader.(StorageConfigurationLoader.java:47) [cd_datalayer-2013.jar:] at com.tridion.storage.StorageManagerFactory.loadConfiguration(StorageManagerFactory.java:675) [cd_datalayer-2013.jar:] at com.tridion.services.BaseService.(BaseService.java:111) [cd_core-2013.jar:] at com.tridion.storage.StorageManagerFactory.(StorageManagerFactory.java:104) [cd_datalayer-2013.jar:] at com.tridion.storage.StorageManagerFactory.reloadInstance(StorageManagerFactory.java:84) [cd_datalayer-2013.jar:] at com.tridion.storage.StorageManagerFactory.(StorageManagerFactory.java:56) [cd_datalayer-2013.jar:] at com.tridion.dcp.ComponentPresentationFactory.init(ComponentPresentationFactory.java:106) [cd_broker-2013.jar:] at com.tridion.dcp.ComponentPresentationFactory.(ComponentPresentationFactory.java:88) [cd_broker-2013.jar:] at com.nh.nhweb.tridion.TridionDAOImpl.findComponente(TridionDAOImpl.java:23) [tridionapi-impl.jar:] at com.nh.nhweb.tridion.TridionFacadeImpl.getComponente(TridionFacadeImpl.java:19) [tridionapi-impl.jar:]

I have a cd_broker_config.xml, but I don´t have a cd_storage_conf.xml. I have researched, and the problem is when the library cd_datalayer.jar creates cd_storage_conf.xml.transformed from cd_broker_config.xml, in the following lines (i decompiled the cd_datalayer.jar):

URL brokerConfigURL = getClass().getClassLoader().getResource(this.brokerConfigurationFile);
if (brokerConfigURL != null) {
  File configDir = new File(brokerConfigURL.toURI()).getParentFile();
  File configFile = new File(configDir, "cd_storage_conf.xml.transformed");
  FileWriter fileWriter = new FileWriter(configFile);
  fileWriter.write(storageConfiguration);
  fileWriter.close();
  log.info("Successfully written transformed configuration to: {}", configFile.getAbsolutePath());
}

It seems it is not a good practice getting the physical path from a resource in the classpath:

https://stackoverflow.com/questions/941754/how-to-get-a-path-to-a-resource-in-a-java-jar-file

As the resulting URL starts with vfs:// instead of file://

I have worked around this by replacing 'vfs' with 'file', as I know 'cd_broker_conf.xml' will be always in the filesystem (I have forced it), but I would appreciate a better solution.

7

Transforming a broker configuration file to a storage configuration file is something that should only take place during an upgrade. In normal running, current versions of Tridion use only the storage configuration. If you don't have one, the correct way to get one is to create one with a text editor. Generally it's a good idea to begin with the sample configurations that are shipped with Tridion. The documentation also covers this in detail.

Forcing the existence of a broker configuration file is completely the wrong way to solve this problem.

Also - it's worth noting that the standard license forbids you from decompiling the Tridion jars, so it's bad form to state on a public site like this that you have done so. (To be honest - I don't think SDL's corporate lawyers will hunt you down for a small "first offence" like this, but it's better to avoid it.)

| improve this answer | |
2

you can also transform your cd_broker_config file to cd_storage_conf using following xslt from your installation directory

Content Delivery\resources\xslt\cd_storage_conf.xsl`.

but configuration file produced by above XSLT is not optimized, so you can refer the documentation to improve it.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.