Tags » Lawliet

Why undefined referenced to mMutex in my singleton class

I have implemented a Meyer’s singleton pattern. And I try to do some stuff testing it in a multithreading environment. Here is how I implemented the class in C++. 199 more words

Recent Questions - Stack Overflow

No Persistence provider for EntityManager named connect

I have some error when i’m trying to start servlet.

Code of my servlet:

package servlets;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/users")
public class usersView extends HttpServlet {

    private static final long serialVersionUID = 1L;


    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

            String userzy = "";
            EntityManagerFactory emf = Persistence.createEntityManagerFactory("connect");
            EntityManager em = emf.createEntityManager();
            userzy += "<table>";
            userzy += "<td class='main'>id</td>";
            userzy += "<td class='main'>login</td>";
            userzy += "<td class='main'>hasło</td>";
            userzy += "<td class='main'>grupa</td>";
            /*for(User c : persons)
            {
                userzy+="<tr><td>"+c.getIdekey()+"</td><td>"+c.getLogin()+"</td><td>"+c.getPassword()+"</td><td>"+c.getGroup()+"</td></tr>";
            }*/
            userzy += "</table>";
            response.setCharacterEncoding("UTF-8");
            response.setContentType("text/html");
            PrintWriter out = response.getWriter();

            out.println("<html>");
            out.println("<meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />");
            out.println("<head>");

            out.println("<title>Mój projekcik!</title>");
            out.println("<link rel=\"stylesheet\" type=\"text/css\" href=\"css/global.css\" />");
            out.println("</head>");
            out.println("<body>");
            out.println("<div class='header'></div>");
            out.println("<div class='left_block'>");
            out.println("<div class='logo'></div>");
            out.println("<ul class='left_menu'>");
            out.println("<a href='index.jsp'><li>Strona główna</li></a>");
            out.println("<a href='events'><li>Eventy</li></a>");
            out.println("<a href='groups'><li>Grupy</li></a>");
            out.println("<a href='categories'><li>Kategorie</li></a>");
            out.println("</ul>");
            out.println("</div>");
            out.println("<div class='right_block'>");
            /*if(repo.getAll().size() <= 0) {
                out.println("<div class='i_error'>");
                out.println("There is no users in database!");
                out.println("</div>");
            }*/
            out.println("<div class='i_message'>");
            out.println(userzy);
            out.println("</div>");
            out.println("</div>");
            out.println("</body>");
            out.println("</html>");
            out.close();
            em.close();
            emf.close();
    }
}
… 179 more words
Recent Questions - Stack Overflow

Monster

There are…many types of monsters in this world: Monsters who will not show themselves and who cause trouble; monsters who abduct children; monsters who devour dreams; monsters who suck blood, and… monsters who always tell lies.

83 more words
My Quotes