Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider_url tag in JMSSouceConnector.xml file for JMSSource operator not correctly parsed #89

Closed
christianIreland opened this issue Feb 6, 2015 · 9 comments

Comments

@christianIreland
Copy link

Hi,
I am using the JMSSource operator from Github. Streams version is 3.2.1. In my connector document I am setting the following provider_url value:

provider_url = "file://../binding/"

However while trying to start the operator the following error is returned:

javax.naming.NameNotFoundException; remaining name '"/binding"'
com.sun.jndi.fscontext.FSContext.checkExists(FSContext.java:850)
com.sun.jndi.fscontext.FSContext.checkIsDirectory(FSContext.java:883)
com.sun.jndi.fscontext.FSContext.(FSContext.java:108)
com.sun.jndi.fscontext.FSContext.(FSContext.java:81)
com.sun.jndi.fscontext.RefFSContext.(RefFSContext.java:97)
com.sun.jndi.fscontext.RefFSContextFactory.createContext(RefFSContextFactory.java:42)
com.sun.jndi.fscontext.RefFSContextFactory.createContextAux(RefFSContextFactory.java:47)
....

it looks like the .. are trimmed and so the relative path cannot be set.
Any suggestion to workaround?

Thank you

@conglisc
Copy link
Member

conglisc commented Feb 6, 2015

Hi christianIreland,

Can you let me know the absolute path to the .bindings file. Are you able to provide the absolute path to this parameter in connections.xml file?

Can you also elaborate why you want to use file://../binding/, the content of the URL is pointing at binding/ directory under / instead of a directory relative to current working directory.

Thanks

Cong

@christianIreland
Copy link
Author

Hi Connglisc,
thank you for looking at this issue. To answer to your questions:

I want to use the path ../binding/ because I need to place the binding file inside the package of my project, so that no hard coded path will be needed to point to a specific location, and the installer can be coded with no issues.

As I reported in the description of this post, it is exactly in the connection.xml document where I am trying to provide the location to the binding. The format of the path is correct since it the SPL file of the JMS operator I have provided the following path to the Connection.xml file and it is correctly resolved:

getSubmissionTimeValue("connectionDoc","../binding/JMSSourceConnection.xml") ;

From the examples I found on line in the connection.xml document it is not needed to specify the bindings file name in the connection.xml.

When the relative path provided is correctly resolved this is how it looks like:

/home/streamsadmin/worspace/iit_idm_incident_fusion_engine/binding

At the moment the path I need to provide to make the things work is the following:

"file:///home/streamsadmin/worspace/iit_idm_incident_fusion_engine/binding"

please notice that we have 3 back splashes at the beginning which should be needed to Java to accept the / from the path as part of the string. We have now a string that starts with .. how would the relative path I am trying to provide as parameter look like?

Thank you

@conglisc
Copy link
Member

conglisc commented Feb 9, 2015

Hi christianIreland,

Thank you for providing the details.

Because The provider_URL needs to conform to the URL format, in your case, please set the provider_url string in the connections.xml file to

provider_url = "file:../binding/"

Let me know if this helps.

You have specified this string to be provider_url = "file://../binding/", this value is interpreted as a absolute path i.e /binding/

Thank you.

@christianIreland
Copy link
Author

Thank you consglisc,
this time worked

@chanskw
Copy link
Collaborator

chanskw commented Feb 10, 2015

For Streams 3.2.2, how do we interpret this relative path? Where is it relative to?

@conglisc
Copy link
Member

In 3.2.2, relative provider_url will not work due to appBundle. We are simply passing this value to InitialContext. If relative path is specified, then it will be relative to the current working directory and in 3.2.2, this working dir is determined for each instance of application with the domain property applicationCurrentWorkingPath something like /homes/hny4/user/.streams/var/Streams.sab_DLZ-domain-instance/d51dd2d6-43c4-485c-87cf-2cd4c72ecaed/currentWorkingDir/0

I think we can support relative provider_url path in 3.2.2 by making it relative to application directory.

@chanskw
Copy link
Collaborator

chanskw commented Feb 11, 2015

So for 3.2.1, if path is relative, this path is relative to the data directory.
For 3.2.2, because this is a config file, the default location should be in app/etc directory... and any relative path should be relative to the app directory, correct?

In Streams 3.2.2, the current behavior is that the relative path is interpreted against the current working directory, which is in the application landing zone. This is not the right behavior for 3.2.2.

@conglisc
Copy link
Member

Just want to list few sample provider_url and show how they are interpreted.

file:///a/b/ // absolute path pointing at local file system /a/b
file://a/b/ // absolute path indicating path at /b on host a
file://../b/ // This also means absolute path /b. the double dot is translated as host rather than part of path
file:../b/ // relative path to current working directory. say current dir is /a/c then this mean /a/b

conglisc added a commit to conglisc/streamsx.messaging that referenced this issue Mar 4, 2015
conglisc added a commit to conglisc/streamsx.messaging that referenced this issue Mar 31, 2015
…w must take a

valid form of URL value, it can be only either absolute (file:///a/b/c)
or relative (file:etc/) value, which must include the scheme.
conglisc added a commit to conglisc/streamsx.messaging that referenced this issue Mar 31, 2015
chanskw added a commit that referenced this issue Apr 22, 2015
@chanskw
Copy link
Collaborator

chanskw commented Apr 22, 2015

Fixed.

@chanskw chanskw closed this as completed Apr 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants