Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6890185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:14:59+00:00 2026-05-27T06:14:59+00:00

I have a JavaEE application that needs to access a file in order to

  • 0

I have a JavaEE application that needs to access a file in order to obtain certain informations about the installation.

This access is read-only, I do not need to change that file within the application, i.e. I do not need the “file” directly, just it’s content (a byte array).

There’s a restriction on EJBs using the filesystem. I do understand the problems associated with it but I can’t figure out a alternative solution to this.

The file path should be configurable by the user, but there’s no need to track changes to the file contents. Once loaded, it stays the same unless the user choose another file. So, I can’t package it within the application archive.

This file-based approach is a decision made long time ago by some legacy systems we have. There’s no practical way to change it now, i.e. I need that my JavaEE application uses the file (at least once) to load it’s content.

Another restriction is that this file can not be persisted on the database.

How should I do this without violating the EJB restriction of filesystem access?

I thought about user uploading the file to the server and then persisting this information on the server. But how do I do this? This information should be globally accessible, including multiple instances of the server (e.g. in a cluster architecture).

The user should configure this file once (not necessarily within the main application, it could be other app just to configure this). Even if the server restart, the file’s content should still be accessible without any further configuration by the user.

I’m using JavaEE 5 with EJB 3.0 specification on a GlassFish v2.1.1 server.

Thanks,
Thiago.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:14:59+00:00Added an answer on May 27, 2026 at 6:14 am

    My suggestion is as follows:

    1. User JAX-WS with EJB 3 for enable to user upload the file through a WebService (You can provide the client).
    2. Store the content of the file in the JNDI using the menthod bind() of Context class. As I know the JNDI will be propagated across the cluster, but maybe you need to check the doc of your Java EE Application Server.

    Hope it can be useful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an application that needs to access a database that is owned by
We have a Java EE application running on Glassfish 3.1 that needs to accept
I have built a web application using Java EE platform that sells one of
I have a JavaEE 1.4 web application running on WebSphere Application Server 6.0. In
i have a java ee project which has a text file that uses a
I have to design a data model (in a Java EE 6 application) that
I have a monitoring application which via gui displays that status of a number
I have a Java EE web application that does not make use of EJBs.
I have a legacy application that I'm trying to port to Java EE. Presently
Technology(Java EE 6 with Glassfish 3.1, Netbeans 7.0) I have an application client that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.