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

Running from within a firewall #3

Closed
jlpoolen opened this issue Mar 6, 2012 · 2 comments
Closed

Running from within a firewall #3

jlpoolen opened this issue Mar 6, 2012 · 2 comments

Comments

@jlpoolen
Copy link

jlpoolen commented Mar 6, 2012

This is really a maven issue; however, others may be in the same position I find myself and addressing this issue could prove helpful.

I was able to successfully run the cleo-primer from behind a less-restrictive firewall; the remote fetching worked and the server started. Now I am trying to run the sample from behind a restrictive firewall and the startup fails because remote files cannot be downloaded.

I checked Maven's site http://maven.apache.org/guides/mini/guide-proxies.html and duly created a file ~jlpoole/.m2/repository/settings.xml as follows:

jlpoole@themis /usr/local/src/cleo-primer $ cat ~/.m2/repository/settings.xml
--settings--
--proxies--
--proxy--
--active--true--/active--
--protocol>http--/protocol--
--host--[the proxy server]--/host--
--port--[the proxy port]--/port--
--/proxy--
--/proxies--
--/settings--

Note: I had to substitute "--" for opening and closing markup since my pasting them in caused them to disappear.
jlpoole@themis /usr/local/src/cleo-primer $

Yet, when I try to run the launching command, it's showing the proxy is not working:

    jlpoole@themis /usr/local/src/cleo-primer $ MAVEN_OPTS="-Xms1g -Xmx1g" mvn jetty:run -Dcleo.instance.name=Company -Dcleo.instance.type=cleo.primer.GenericTypeaheadInstance -Dcleo.instance.conf=src/main/resources/config/generic-typeahead
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building cleo-primer 1.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> maven-jetty-plugin:6.1.25:run (default-cli) @ cleo-primer >>>
[WARNING] The POM for org.codehaus.jackson:jackson-lgpl:jar:0.9.4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] Could not transfer metadata org.springframework:spring-core/maven-metadata.xml from/to m1.dev.java.net (http://download.java.net/maven/1): No connector available to access repository m1.dev.java.net (http://download.java.net/maven/1) of type legacy using the available factories WagonRepositoryConnectorFactory
[WARNING] Could not transfer metadata org.springframework:spring/maven-metadata.xml from/to m1.dev.java.net (http://download.java.net/maven/1): No connector available to access repository m1.dev.java.net (http://download.java.net/maven/1) of type legacy using the available factories WagonRepositoryConnectorFactory
[WARNING] Could not transfer metadata org.springframework:spring-beans/maven-metadata.xml from/to m1.dev.java.net (http://download.java.net/maven/1): No connector available to access repository m1.dev.java.net (http://download.java.net/maven/1) of type legacy using the available factories WagonRepositoryConnectorFactory
[WARNING] Could not transfer metadata org.springframework:spring-context/maven-metadata.xml from/to m1.dev.java.net (http://download.java.net/maven/1): No connector available to access repository m1.dev.java.net (http://download.java.net/maven/1) of type legacy using the available factories WagonRepositoryConnectorFactory
[WARNING] Could not transfer metadata org.springframework:spring-web/maven-metadata.xml from/to m1.dev.java.net (http://download.java.net/maven/1): No connector available to access repository m1.dev.java.net (http://download.java.net/maven/1) of type legacy using the available factories WagonRepositoryConnectorFactory
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ cleo-primer ---
[debug] execute contextualize
[WARNING] Using platform encoding (ANSI_X3.4-1968 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ cleo-primer ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ cleo-primer ---
[debug] execute contextualize
[WARNING] Using platform encoding (ANSI_X3.4-1968 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /usr/local/src/cleo-primer/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ cleo-primer ---
[INFO] No sources to compile
[INFO] 
[INFO] <<< maven-jetty-plugin:6.1.25:run (default-cli) @ cleo-primer <<<
[WARNING] Failure to transfer org.springframework:spring-core/maven-metadata.xml from http://download.java.net/maven/1 was cached in the local repository, resolution will not be reattempted until the update interval of m1.dev.java.net has elapsed or updates are forced. Original error: Could not transfer metadata org.springframework:spring-core/maven-metadata.xml from/to m1.dev.java.net (http://download.java.net/maven/1): No connector available to access repository m1.dev.java.net (http://download.java.net/maven/1) of type legacy using the available factories WagonRepositoryConnectorFactory
[WARNING] Failure to transfer org.springframework:spring/maven-metadata.xml from http://download.java.net/maven/1 was cached in the local repository, resolution will not be reattempted until the update interval of m1.dev.java.net has elapsed or updates are forced. Original error: Could not transfer metadata org.springframework:spring/maven-metadata.xml from/to m1.dev.java.net (http://download.java.net/maven/1): No connector available to access repository m1.dev.java.net (http://download.java.net/maven/1) of type legacy using the available factories WagonRepositoryConnectorFactory
[WARNING] Failure to transfer org.springframework:spring-beans/maven-metadata.xml from http://download.java.net/maven/1 was cached in the local repository, resolution will not be reattempted until the update interval of m1.dev.java.net has elapsed or updates are forced. Original error: Could not transfer metadata org.springframework:spring-beans/maven-metadata.xml from/to m1.dev.java.net (http://download.java.net/maven/1): No connector available to access repository m1.dev.java.net (http://download.java.net/maven/1) of type legacy using the available factories WagonRepositoryConnectorFactory
[WARNING] Failure to transfer org.springframework:spring-context/maven-metadata.xml from http://download.java.net/maven/1 was cached in the local repository, resolution will not be reattempted until the update interval of m1.dev.java.net has elapsed or updates are forced. Original error: Could not transfer metadata org.springframework:spring-context/maven-metadata.xml from/to m1.dev.java.net (http://download.java.net/maven/1): No connector available to access repository m1.dev.java.net (http://download.java.net/maven/1) of type legacy using the available factories WagonRepositoryConnectorFactory
[WARNING] Failure to transfer org.springframework:spring-web/maven-metadata.xml from http://download.java.net/maven/1 was cached in the local repository, resolution will not be reattempted until the update interval of m1.dev.java.net has elapsed or updates are forced. Original error: Could not transfer metadata org.springframework:spring-web/maven-metadata.xml from/to m1.dev.java.net (http://download.java.net/maven/1): No connector available to access repository m1.dev.java.net (http://download.java.net/maven/1) of type legacy using the available factories WagonRepositoryConnectorFactory
[INFO] 
[INFO] --- maven-jetty-plugin:6.1.25:run (default-cli) @ cleo-primer ---
[INFO] Configuring Jetty for project: cleo-primer
[INFO] Webapp source directory = /usr/local/src/cleo-primer/src/main/webapp
[INFO] Reload Mechanic: manual
[INFO] Classes = /usr/local/src/cleo-primer/target/classes
2012-03-06 14:48:47.802:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
[INFO] Jetty server exiting.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.554s
[INFO] Finished at: Tue Mar 06 14:48:47 PST 2012
[INFO] Final Memory: 10M/981M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.mortbay.jetty:maven-jetty-plugin:6.1.25:run (default-cli) on project cleo-primer: Failure: Bad temp directory: /usr/local/src/cleo-primer/target/work -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
2012-03-06 14:48:48.074:INFO::Shutdown hook executing
2012-03-06 14:48:48.074:INFO::Shutdown hook complete
jlpoole@themis /usr/local/src/cleo-primer $

Is there something that can be tweaked to bypass refreshing from remote sources so when the example is run from within a restrictive firewall it is ready to run and/or aborts trying to get the latest files? Or have I missed some basic Maven configuration making my attempt to create a proxy entry useless?

@jlpoolen
Copy link
Author

jlpoolen commented Mar 7, 2012

When I first installed the cleo-primer, I did so as root and with a not-as-restrictive firewall. The appropriate files were downloaded by maven and stored under root's .m2/repository. When I was under a restrictive firewall, I attempted to run as user jlpoole and since it was the first time, the failed attempt to download through the proxy proved fatal to the launching of the server. When I changed to root and ran the cleo-primer, attempts were made to download, again, but since the previous run in the less restrictive environment had successfully downloaded the requisite files, the files were available for this session where the Maven proxy configuration does not seem to be working.

Conclusion, once you're able to download the required files, they can be used later when download is not possible. The project uses cached files.

@jingwei
Copy link
Contributor

jingwei commented Mar 7, 2012

It is not necessary to install cleo-primer as root. It can be any user like jlpoolen under a restrictive firewall. For the maven repository/cache, once you have needed jars downloaded, they are cached and reused.

@jingwei jingwei closed this as completed Mar 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants